Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include <cstdint> |
| 12 | #include <memory> |
| 13 | |
Artem Titov | 7bf8c7f | 2019-03-15 15:00:37 +0100 | [diff] [blame] | 14 | #include "api/test/create_network_emulation_manager.h" |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 15 | #include "api/test/create_peerconnection_quality_test_fixture.h" |
Artem Titov | 7bf8c7f | 2019-03-15 15:00:37 +0100 | [diff] [blame] | 16 | #include "api/test/network_emulation_manager.h" |
Artem Titov | d57628f | 2019-03-22 12:34:25 +0100 | [diff] [blame] | 17 | #include "api/test/peerconnection_quality_test_fixture.h" |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 18 | #include "call/simulated_network.h" |
Niels Möller | d27a0c1 | 2019-09-26 16:21:02 +0200 | [diff] [blame] | 19 | #include "system_wrappers/include/field_trial.h" |
| 20 | #include "test/field_trial.h" |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 21 | #include "test/gtest.h" |
Mirko Bonadei | 12ae4f4 | 2019-02-26 15:19:07 +0100 | [diff] [blame] | 22 | #include "test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h" |
Artem Titov | 6b88a8f | 2019-02-13 22:15:04 +0100 | [diff] [blame] | 23 | #include "test/pc/e2e/analyzer/video/default_video_quality_analyzer.h" |
Artem Titov | 1845922 | 2019-04-24 11:09:35 +0200 | [diff] [blame] | 24 | #include "test/pc/e2e/network_quality_metrics_reporter.h" |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 25 | #include "test/testsupport/file_utils.h" |
| 26 | |
| 27 | namespace webrtc { |
Artem Titov | 0b44314 | 2019-03-20 11:11:08 +0100 | [diff] [blame] | 28 | namespace webrtc_pc_e2e { |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 29 | namespace { |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 30 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 31 | class PeerConnectionE2EQualityTestSmokeTest : public ::testing::Test { |
| 32 | public: |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 33 | using PeerConfigurer = PeerConnectionE2EQualityTestFixture::PeerConfigurer; |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 34 | using RunParams = PeerConnectionE2EQualityTestFixture::RunParams; |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 35 | using VideoConfig = PeerConnectionE2EQualityTestFixture::VideoConfig; |
| 36 | using AudioConfig = PeerConnectionE2EQualityTestFixture::AudioConfig; |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 37 | using ScreenShareConfig = |
| 38 | PeerConnectionE2EQualityTestFixture::ScreenShareConfig; |
| 39 | using ScrollingParams = PeerConnectionE2EQualityTestFixture::ScrollingParams; |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 40 | using VideoSimulcastConfig = |
| 41 | PeerConnectionE2EQualityTestFixture::VideoSimulcastConfig; |
Artem Titov | 728a0ee | 2019-08-20 13:36:35 +0200 | [diff] [blame] | 42 | using EchoEmulationConfig = |
| 43 | PeerConnectionE2EQualityTestFixture::EchoEmulationConfig; |
Artem Titov | 7c55415 | 2019-02-28 10:25:52 +0100 | [diff] [blame] | 44 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 45 | void RunTest(const std::string& test_case_name, |
| 46 | const RunParams& run_params, |
| 47 | rtc::FunctionView<void(PeerConfigurer*)> alice_configurer, |
| 48 | rtc::FunctionView<void(PeerConfigurer*)> bob_configurer) { |
| 49 | // Setup emulated network |
| 50 | std::unique_ptr<NetworkEmulationManager> network_emulation_manager = |
| 51 | CreateNetworkEmulationManager(); |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 52 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 53 | auto alice_network_behavior = |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 54 | std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig()); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 55 | SimulatedNetwork* alice_network_behavior_ptr = alice_network_behavior.get(); |
| 56 | EmulatedNetworkNode* alice_node = |
| 57 | network_emulation_manager->CreateEmulatedNode( |
| 58 | std::move(alice_network_behavior)); |
| 59 | EmulatedNetworkNode* bob_node = |
| 60 | network_emulation_manager->CreateEmulatedNode( |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 61 | std::make_unique<SimulatedNetwork>(BuiltInNetworkBehaviorConfig())); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 62 | auto* alice_endpoint = |
| 63 | network_emulation_manager->CreateEndpoint(EmulatedEndpointConfig()); |
| 64 | EmulatedEndpoint* bob_endpoint = |
| 65 | network_emulation_manager->CreateEndpoint(EmulatedEndpointConfig()); |
| 66 | network_emulation_manager->CreateRoute(alice_endpoint, {alice_node}, |
| 67 | bob_endpoint); |
| 68 | network_emulation_manager->CreateRoute(bob_endpoint, {bob_node}, |
| 69 | alice_endpoint); |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 70 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 71 | // Create analyzers. |
| 72 | std::unique_ptr<VideoQualityAnalyzerInterface> video_quality_analyzer = |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 73 | std::make_unique<DefaultVideoQualityAnalyzer>(); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 74 | // This is only done for the sake of smoke testing. In general there should |
| 75 | // be no need to explicitly pull data from analyzers after the run. |
| 76 | auto* video_analyzer_ptr = |
| 77 | static_cast<DefaultVideoQualityAnalyzer*>(video_quality_analyzer.get()); |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 78 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 79 | auto fixture = CreatePeerConnectionE2EQualityTestFixture( |
| 80 | test_case_name, /*audio_quality_analyzer=*/nullptr, |
| 81 | std::move(video_quality_analyzer)); |
| 82 | fixture->ExecuteAt(TimeDelta::seconds(2), |
| 83 | [alice_network_behavior_ptr](TimeDelta) { |
| 84 | BuiltInNetworkBehaviorConfig config; |
| 85 | config.loss_percent = 5; |
| 86 | alice_network_behavior_ptr->SetConfig(config); |
| 87 | }); |
Mirko Bonadei | 12ae4f4 | 2019-02-26 15:19:07 +0100 | [diff] [blame] | 88 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 89 | // Setup components. We need to provide rtc::NetworkManager compatible with |
| 90 | // emulated network layer. |
| 91 | EmulatedNetworkManagerInterface* alice_network = |
| 92 | network_emulation_manager->CreateEmulatedNetworkManagerInterface( |
| 93 | {alice_endpoint}); |
| 94 | EmulatedNetworkManagerInterface* bob_network = |
| 95 | network_emulation_manager->CreateEmulatedNetworkManagerInterface( |
| 96 | {bob_endpoint}); |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 97 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 98 | fixture->AddPeer(alice_network->network_thread(), |
| 99 | alice_network->network_manager(), alice_configurer); |
| 100 | fixture->AddPeer(bob_network->network_thread(), |
| 101 | bob_network->network_manager(), bob_configurer); |
| 102 | fixture->AddQualityMetricsReporter( |
Mirko Bonadei | 317a1f0 | 2019-09-17 17:06:18 +0200 | [diff] [blame] | 103 | std::make_unique<NetworkQualityMetricsReporter>(alice_network, |
| 104 | bob_network)); |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 105 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 106 | fixture->Run(run_params); |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 107 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 108 | EXPECT_GE(fixture->GetRealTestDuration(), run_params.run_duration); |
| 109 | for (auto stream_label : video_analyzer_ptr->GetKnownVideoStreams()) { |
| 110 | FrameCounters stream_conters = |
| 111 | video_analyzer_ptr->GetPerStreamCounters().at(stream_label); |
| 112 | // 150 = 30fps * 5s. On some devices pipeline can be too slow, so it can |
| 113 | // happen, that frames will stuck in the middle, so we actually can't |
| 114 | // force real constraints here, so lets just check, that at least 1 frame |
| 115 | // passed whole pipeline. |
| 116 | EXPECT_GE(stream_conters.captured, 150); |
| 117 | EXPECT_GE(stream_conters.pre_encoded, 1); |
| 118 | EXPECT_GE(stream_conters.encoded, 1); |
| 119 | EXPECT_GE(stream_conters.received, 1); |
| 120 | EXPECT_GE(stream_conters.decoded, 1); |
| 121 | EXPECT_GE(stream_conters.rendered, 1); |
| 122 | } |
| 123 | } |
| 124 | }; |
| 125 | |
| 126 | } // namespace |
| 127 | |
| 128 | // IOS debug builds can be quite slow, disabling to avoid issues with timeouts. |
| 129 | #if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG) |
Artem Titov | ad82e8e | 2019-06-14 10:45:18 +0200 | [diff] [blame] | 130 | #define MAYBE_Smoke DISABLED_Smoke |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 131 | #else |
Artem Titov | ad82e8e | 2019-06-14 10:45:18 +0200 | [diff] [blame] | 132 | #define MAYBE_Smoke Smoke |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 133 | #endif |
| 134 | TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { |
| 135 | RunParams run_params(TimeDelta::seconds(7)); |
| 136 | run_params.video_codec_name = cricket::kVp9CodecName; |
| 137 | run_params.video_codec_required_params = {{"profile-id", "0"}}; |
| 138 | run_params.use_flex_fec = true; |
| 139 | run_params.use_ulp_fec = true; |
| 140 | run_params.video_encoder_bitrate_multiplier = 1.1; |
Niels Möller | d27a0c1 | 2019-09-26 16:21:02 +0200 | [diff] [blame] | 141 | test::ScopedFieldTrials field_trials( |
| 142 | std::string(field_trial::GetFieldTrialString()) + |
| 143 | "WebRTC-UseStandardBytesStats/Enabled/"); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 144 | RunTest( |
| 145 | "smoke", run_params, |
| 146 | [](PeerConfigurer* alice) { |
| 147 | VideoConfig video(640, 360, 30); |
| 148 | video.stream_label = "alice-video"; |
| 149 | alice->AddVideoConfig(std::move(video)); |
| 150 | |
| 151 | AudioConfig audio; |
| 152 | audio.stream_label = "alice-audio"; |
| 153 | audio.mode = AudioConfig::Mode::kFile; |
| 154 | audio.input_file_name = |
| 155 | test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); |
Artem Titov | bc558ce | 2019-07-08 19:13:21 +0200 | [diff] [blame] | 156 | audio.sampling_frequency_in_hz = 48000; |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 157 | alice->SetAudioConfig(std::move(audio)); |
| 158 | }, |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 159 | [](PeerConfigurer* bob) { |
| 160 | VideoConfig video(640, 360, 30); |
| 161 | video.stream_label = "bob-video"; |
Artem Titov | 1e49ab2 | 2019-07-30 13:17:25 +0200 | [diff] [blame] | 162 | video.temporal_layers_count = 2; |
Artem Titov | 7581ff7 | 2019-05-15 15:45:33 +0200 | [diff] [blame] | 163 | bob->AddVideoConfig(std::move(video)); |
| 164 | |
| 165 | VideoConfig screenshare(640, 360, 30); |
| 166 | screenshare.stream_label = "bob-screenshare"; |
| 167 | screenshare.screen_share_config = |
| 168 | ScreenShareConfig(TimeDelta::seconds(2)); |
| 169 | screenshare.screen_share_config->scrolling_params = ScrollingParams( |
| 170 | TimeDelta::ms(1800), kDefaultSlidesWidth, kDefaultSlidesHeight); |
| 171 | bob->AddVideoConfig(screenshare); |
| 172 | |
| 173 | AudioConfig audio; |
| 174 | audio.stream_label = "bob-audio"; |
| 175 | audio.mode = AudioConfig::Mode::kFile; |
| 176 | audio.input_file_name = |
| 177 | test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); |
| 178 | bob->SetAudioConfig(std::move(audio)); |
| 179 | }); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 180 | } |
Artem Titov | d09bc55 | 2019-03-20 11:18:58 +0100 | [diff] [blame] | 181 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 182 | // IOS debug builds can be quite slow, disabling to avoid issues with timeouts. |
| 183 | #if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG) |
Artem Titov | 728a0ee | 2019-08-20 13:36:35 +0200 | [diff] [blame] | 184 | #define MAYBE_Echo DISABLED_Echo |
| 185 | #else |
| 186 | #define MAYBE_Echo Echo |
| 187 | #endif |
| 188 | TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Echo) { |
| 189 | RunParams run_params(TimeDelta::seconds(7)); |
| 190 | run_params.echo_emulation_config = EchoEmulationConfig(); |
| 191 | RunTest( |
| 192 | "smoke", run_params, |
| 193 | [](PeerConfigurer* alice) { |
| 194 | AudioConfig audio; |
| 195 | audio.stream_label = "alice-audio"; |
| 196 | audio.mode = AudioConfig::Mode::kFile; |
| 197 | audio.input_file_name = |
| 198 | test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); |
| 199 | audio.sampling_frequency_in_hz = 48000; |
| 200 | alice->SetAudioConfig(std::move(audio)); |
| 201 | }, |
| 202 | [](PeerConfigurer* bob) { |
| 203 | AudioConfig audio; |
| 204 | audio.stream_label = "bob-audio"; |
| 205 | audio.mode = AudioConfig::Mode::kFile; |
| 206 | audio.input_file_name = |
| 207 | test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); |
| 208 | bob->SetAudioConfig(std::move(audio)); |
| 209 | }); |
| 210 | } |
| 211 | |
| 212 | // IOS debug builds can be quite slow, disabling to avoid issues with timeouts. |
| 213 | #if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG) |
Artem Titov | ad82e8e | 2019-06-14 10:45:18 +0200 | [diff] [blame] | 214 | #define MAYBE_Simulcast DISABLED_Simulcast |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 215 | #else |
Artem Titov | ad82e8e | 2019-06-14 10:45:18 +0200 | [diff] [blame] | 216 | #define MAYBE_Simulcast Simulcast |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 217 | #endif |
| 218 | TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) { |
Artem Titov | 70f80e5 | 2019-04-12 13:13:39 +0200 | [diff] [blame] | 219 | RunParams run_params(TimeDelta::seconds(7)); |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 220 | run_params.video_codec_name = cricket::kVp8CodecName; |
| 221 | RunTest( |
| 222 | "simulcast", run_params, |
| 223 | [](PeerConfigurer* alice) { |
| 224 | VideoConfig simulcast(1280, 720, 30); |
| 225 | simulcast.stream_label = "alice-simulcast"; |
| 226 | simulcast.simulcast_config = VideoSimulcastConfig(3, 0); |
| 227 | alice->AddVideoConfig(std::move(simulcast)); |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 228 | |
Artem Titov | ef3fd9c | 2019-06-13 16:36:52 +0200 | [diff] [blame] | 229 | AudioConfig audio; |
| 230 | audio.stream_label = "alice-audio"; |
| 231 | audio.mode = AudioConfig::Mode::kFile; |
| 232 | audio.input_file_name = |
| 233 | test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); |
| 234 | alice->SetAudioConfig(std::move(audio)); |
| 235 | }, |
| 236 | [](PeerConfigurer* bob) { |
| 237 | VideoConfig video(640, 360, 30); |
| 238 | video.stream_label = "bob-video"; |
| 239 | bob->AddVideoConfig(std::move(video)); |
| 240 | |
| 241 | AudioConfig audio; |
| 242 | audio.stream_label = "bob-audio"; |
| 243 | audio.mode = AudioConfig::Mode::kFile; |
| 244 | audio.input_file_name = |
| 245 | test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); |
| 246 | bob->SetAudioConfig(std::move(audio)); |
| 247 | }); |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 248 | } |
| 249 | |
Artem Titov | d70d80d | 2019-07-19 11:00:40 +0200 | [diff] [blame] | 250 | // IOS debug builds can be quite slow, disabling to avoid issues with timeouts. |
| 251 | #if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG) |
| 252 | #define MAYBE_Svc DISABLED_Svc |
| 253 | #else |
| 254 | #define MAYBE_Svc Svc |
| 255 | #endif |
| 256 | TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) { |
| 257 | RunParams run_params(TimeDelta::seconds(7)); |
| 258 | run_params.video_codec_name = cricket::kVp9CodecName; |
| 259 | RunTest( |
| 260 | "simulcast", run_params, |
| 261 | [](PeerConfigurer* alice) { |
| 262 | VideoConfig simulcast(1280, 720, 30); |
| 263 | simulcast.stream_label = "alice-simulcast"; |
| 264 | // Because we have network with packets loss we can analyze only the |
| 265 | // highest spatial layer in SVC mode. |
| 266 | simulcast.simulcast_config = VideoSimulcastConfig(3, 2); |
| 267 | alice->AddVideoConfig(std::move(simulcast)); |
| 268 | |
| 269 | AudioConfig audio; |
| 270 | audio.stream_label = "alice-audio"; |
| 271 | audio.mode = AudioConfig::Mode::kFile; |
| 272 | audio.input_file_name = |
| 273 | test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); |
| 274 | alice->SetAudioConfig(std::move(audio)); |
| 275 | }, |
| 276 | [](PeerConfigurer* bob) { |
| 277 | VideoConfig video(640, 360, 30); |
| 278 | video.stream_label = "bob-video"; |
| 279 | bob->AddVideoConfig(std::move(video)); |
| 280 | |
| 281 | AudioConfig audio; |
| 282 | audio.stream_label = "bob-audio"; |
| 283 | audio.mode = AudioConfig::Mode::kFile; |
| 284 | audio.input_file_name = |
| 285 | test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); |
| 286 | bob->SetAudioConfig(std::move(audio)); |
| 287 | }); |
| 288 | } |
| 289 | |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 290 | // IOS debug builds can be quite slow, disabling to avoid issues with timeouts. |
| 291 | #if defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64) && !defined(NDEBUG) |
| 292 | #define MAYBE_HighBitrate DISABLED_HighBitrate |
| 293 | #else |
| 294 | #define MAYBE_HighBitrate HighBitrate |
| 295 | #endif |
| 296 | TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) { |
| 297 | RunParams run_params(TimeDelta::seconds(7)); |
| 298 | run_params.video_codec_name = cricket::kVp9CodecName; |
| 299 | run_params.video_codec_required_params = {{"profile-id", "0"}}; |
| 300 | |
| 301 | RunTest( |
| 302 | "smoke", run_params, |
| 303 | [](PeerConfigurer* alice) { |
| 304 | PeerConnectionInterface::BitrateParameters bitrate_params; |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 305 | bitrate_params.current_bitrate_bps = 3'000'000; |
| 306 | bitrate_params.max_bitrate_bps = 3'000'000; |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 307 | alice->SetBitrateParameters(bitrate_params); |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 308 | VideoConfig video(800, 600, 30); |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 309 | video.stream_label = "alice-video"; |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 310 | video.min_encode_bitrate_bps = 500'000; |
| 311 | video.max_encode_bitrate_bps = 3'000'000; |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 312 | alice->AddVideoConfig(std::move(video)); |
| 313 | |
| 314 | AudioConfig audio; |
| 315 | audio.stream_label = "alice-audio"; |
| 316 | audio.mode = AudioConfig::Mode::kFile; |
| 317 | audio.input_file_name = |
| 318 | test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); |
| 319 | audio.sampling_frequency_in_hz = 48000; |
| 320 | alice->SetAudioConfig(std::move(audio)); |
| 321 | }, |
| 322 | [](PeerConfigurer* bob) { |
| 323 | PeerConnectionInterface::BitrateParameters bitrate_params; |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 324 | bitrate_params.current_bitrate_bps = 3'000'000; |
| 325 | bitrate_params.max_bitrate_bps = 3'000'000; |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 326 | bob->SetBitrateParameters(bitrate_params); |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 327 | VideoConfig video(800, 600, 30); |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 328 | video.stream_label = "bob-video"; |
Johannes Kron | 3433d56 | 2019-09-23 14:46:16 +0200 | [diff] [blame] | 329 | video.min_encode_bitrate_bps = 500'000; |
| 330 | video.max_encode_bitrate_bps = 3'000'000; |
Johannes Kron | ac315b2 | 2019-09-19 14:55:58 +0200 | [diff] [blame] | 331 | bob->AddVideoConfig(std::move(video)); |
| 332 | |
| 333 | AudioConfig audio; |
| 334 | audio.stream_label = "bob-audio"; |
| 335 | audio.mode = AudioConfig::Mode::kFile; |
| 336 | audio.input_file_name = |
| 337 | test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); |
| 338 | bob->SetAudioConfig(std::move(audio)); |
| 339 | }); |
| 340 | } |
| 341 | |
Artem Titov | 0b44314 | 2019-03-20 11:11:08 +0100 | [diff] [blame] | 342 | } // namespace webrtc_pc_e2e |
Artem Titov | a6a273d | 2019-02-07 16:43:51 +0100 | [diff] [blame] | 343 | } // namespace webrtc |