blob: 05348744d86e1403ce7c292d60e4912e27c0e667 [file] [log] [blame]
Artem Titov137f6c82019-05-17 10:51:15 +02001/*
2 * Copyright (c) 2013 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#include <memory>
11#include <string>
12#include <utility>
13#include <vector>
14
15#include "absl/memory/memory.h"
16#include "api/test/create_network_emulation_manager.h"
17#include "api/test/create_peerconnection_quality_test_fixture.h"
18#include "api/test/network_emulation_manager.h"
19#include "api/test/peerconnection_quality_test_fixture.h"
20#include "api/test/simulated_network.h"
21#include "call/simulated_network.h"
22#include "media/base/vp9_profile.h"
23#include "modules/video_coding/codecs/vp9/include/vp9.h"
24#include "system_wrappers/include/field_trial.h"
25#include "test/field_trial.h"
26#include "test/gtest.h"
27#include "test/pc/e2e/network_quality_metrics_reporter.h"
28#include "test/testsupport/file_utils.h"
29
30namespace webrtc {
31
32using PeerConfigurer =
33 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::PeerConfigurer;
34using RunParams = webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::RunParams;
35using VideoConfig =
36 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoConfig;
37using AudioConfig =
38 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::AudioConfig;
39using VideoGeneratorType =
40 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoGeneratorType;
Artem Titov39483c62019-07-19 17:03:52 +020041using ScreenShareConfig =
42 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::ScreenShareConfig;
43using VideoSimulcastConfig =
44 webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture::VideoSimulcastConfig;
Artem Titov137f6c82019-05-17 10:51:15 +020045
46namespace {
47
48constexpr int kTestDurationSec = 45;
49constexpr char kVp8TrustedRateControllerFieldTrial[] =
50 "WebRTC-LibvpxVp8TrustedRateController/Enabled/";
51
52EmulatedNetworkNode* CreateEmulatedNodeWithConfig(
53 NetworkEmulationManager* emulation,
54 const BuiltInNetworkBehaviorConfig& config) {
55 return emulation->CreateEmulatedNode(
56 absl::make_unique<SimulatedNetwork>(config));
57}
58
59std::pair<EmulatedNetworkManagerInterface*, EmulatedNetworkManagerInterface*>
60CreateTwoNetworkLinks(NetworkEmulationManager* emulation,
61 const BuiltInNetworkBehaviorConfig& config) {
62 auto* alice_node = CreateEmulatedNodeWithConfig(emulation, config);
63 auto* bob_node = CreateEmulatedNodeWithConfig(emulation, config);
64
65 auto* alice_endpoint = emulation->CreateEndpoint(EmulatedEndpointConfig());
66 auto* bob_endpoint = emulation->CreateEndpoint(EmulatedEndpointConfig());
67
68 emulation->CreateRoute(alice_endpoint, {alice_node}, bob_endpoint);
69 emulation->CreateRoute(bob_endpoint, {bob_node}, alice_endpoint);
70
71 return {
72 emulation->CreateEmulatedNetworkManagerInterface({alice_endpoint}),
73 emulation->CreateEmulatedNetworkManagerInterface({bob_endpoint}),
74 };
75}
76
77std::unique_ptr<webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture>
78CreateTestFixture(const std::string& test_case_name,
79 std::pair<EmulatedNetworkManagerInterface*,
80 EmulatedNetworkManagerInterface*> network_links,
81 rtc::FunctionView<void(PeerConfigurer*)> alice_configurer,
82 rtc::FunctionView<void(PeerConfigurer*)> bob_configurer) {
83 auto fixture = webrtc_pc_e2e::CreatePeerConnectionE2EQualityTestFixture(
84 test_case_name, /*audio_quality_analyzer=*/nullptr,
85 /*video_quality_analyzer=*/nullptr);
86 fixture->AddPeer(network_links.first->network_thread(),
87 network_links.first->network_manager(), alice_configurer);
88 fixture->AddPeer(network_links.second->network_thread(),
89 network_links.second->network_manager(), bob_configurer);
90 fixture->AddQualityMetricsReporter(
91 absl::make_unique<webrtc_pc_e2e::NetworkQualityMetricsReporter>(
92 network_links.first, network_links.second));
93 return fixture;
94}
95
96// Takes the current active field trials set, and appends some new trials.
97std::string AppendFieldTrials(std::string new_trial_string) {
98 return std::string(field_trial::GetFieldTrialString()) + new_trial_string;
99}
100
101std::string ClipNameToClipPath(const char* clip_name) {
102 return test::ResourcePath(clip_name, "yuv");
103}
104
105} // namespace
106
107class PCGenericDescriptorTest : public ::testing::TestWithParam<std::string> {
108 public:
109 PCGenericDescriptorTest()
110 : field_trial_(AppendFieldTrials(GetParam())),
111 generic_descriptor_enabled_(
112 field_trial::IsEnabled("WebRTC-GenericDescriptor")) {}
113
114 std::string GetTestName(std::string base) {
115 if (generic_descriptor_enabled_)
116 base += "_generic_descriptor";
117 return base;
118 }
119
120 private:
121 test::ScopedFieldTrials field_trial_;
122 bool generic_descriptor_enabled_;
123};
124
125#if defined(RTC_ENABLE_VP9)
126TEST(PCFullStackTest, ForemanCifWithoutPacketLossVp9) {
127 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
128 CreateNetworkEmulationManager();
129 auto fixture = CreateTestFixture(
130 "pc_foreman_cif_net_delay_0_0_plr_0_VP9",
131 CreateTwoNetworkLinks(network_emulation_manager.get(),
132 BuiltInNetworkBehaviorConfig()),
133 [](PeerConfigurer* alice) {
134 VideoConfig video(352, 288, 30);
135 video.input_file_name = ClipNameToClipPath("foreman_cif");
136 video.stream_label = "alice-video";
137 alice->AddVideoConfig(std::move(video));
138 },
139 [](PeerConfigurer* bob) {});
140 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
141 run_params.video_codec_name = cricket::kVp9CodecName;
142 run_params.video_codec_required_params = {
143 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
144 run_params.use_flex_fec = false;
145 run_params.use_ulp_fec = false;
146 fixture->Run(std::move(run_params));
147}
148
149TEST_P(PCGenericDescriptorTest, ForemanCifPlr5Vp9) {
150 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
151 CreateNetworkEmulationManager();
152 BuiltInNetworkBehaviorConfig config;
153 config.loss_percent = 5;
154 config.queue_delay_ms = 50;
155 auto fixture = CreateTestFixture(
156 GetTestName("pc_foreman_cif_delay_50_0_plr_5_VP9"),
157 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
158 [](PeerConfigurer* alice) {
159 VideoConfig video(352, 288, 30);
160 video.input_file_name = ClipNameToClipPath("foreman_cif");
161 video.stream_label = "alice-video";
162 alice->AddVideoConfig(std::move(video));
163 },
164 [](PeerConfigurer* bob) {});
165 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
166 run_params.video_codec_name = cricket::kVp9CodecName;
167 run_params.video_codec_required_params = {
168 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
169 run_params.use_flex_fec = false;
170 run_params.use_ulp_fec = false;
171 fixture->Run(std::move(run_params));
172}
173
Artem Titove731a2e2019-07-02 10:08:17 +0200174// VP9 2nd profile isn't supported on android arm and arm 64.
Artem Titovcecee992019-07-03 11:55:28 +0200175#if (defined(WEBRTC_ANDROID) && \
176 (defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM))) || \
177 (defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64))
Artem Titove731a2e2019-07-02 10:08:17 +0200178#define MAYBE_GeneratorWithoutPacketLossVp9Profile2 \
179 DISABLED_GeneratorWithoutPacketLossVp9Profile2
180#else
181#define MAYBE_GeneratorWithoutPacketLossVp9Profile2 \
182 GeneratorWithoutPacketLossVp9Profile2
183#endif
184TEST(PCFullStackTest, MAYBE_GeneratorWithoutPacketLossVp9Profile2) {
Artem Titov137f6c82019-05-17 10:51:15 +0200185 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
186 CreateNetworkEmulationManager();
187 auto fixture = CreateTestFixture(
188 "pc_generator_net_delay_0_0_plr_0_VP9Profile2",
189 CreateTwoNetworkLinks(network_emulation_manager.get(),
190 BuiltInNetworkBehaviorConfig()),
191 [](PeerConfigurer* alice) {
192 VideoConfig video(352, 288, 30);
193 video.generator = VideoGeneratorType::kI010;
194 video.stream_label = "alice-video";
195 alice->AddVideoConfig(std::move(video));
196 },
197 [](PeerConfigurer* bob) {});
198 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
199 run_params.video_codec_name = cricket::kVp9CodecName;
200 run_params.video_codec_required_params = {
201 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}};
202 run_params.use_flex_fec = false;
203 run_params.use_ulp_fec = false;
204 fixture->Run(std::move(run_params));
205}
206
207/*
208// TODO(bugs.webrtc.org/10639) migrate commented out test, when required
209// functionality will be supported in PeerConnection level framework.
210TEST(PCFullStackTest, ForemanCifWithoutPacketLossMultiplexI420Frame) {
211 auto fixture = CreateVideoQualityTestFixture();
212 ParamsWithLogging foreman_cif;
213 foreman_cif.call.send_side_bwe = true;
214 foreman_cif.video[0] = {
215 true, 352, 288, 30,
216 700000, 700000, 700000, false,
217 "multiplex", 1, 0, 0,
218 false, false, false, ClipNameToClipPath("foreman_cif")};
219 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
220 kTestDurationSec};
221 fixture->RunWithAnalyzer(foreman_cif);
222}
223
224TEST(PCFullStackTest, GeneratorWithoutPacketLossMultiplexI420AFrame) {
225 auto fixture = CreateVideoQualityTestFixture();
226
227 ParamsWithLogging generator;
228 generator.call.send_side_bwe = true;
229 generator.video[0] = {
230 true, 352, 288, 30, 700000, 700000, 700000, false,
231 "multiplex", 1, 0, 0, false, false, false, "GeneratorI420A"};
232 generator.analyzer = {"generator_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
233 kTestDurationSec};
234 fixture->RunWithAnalyzer(generator);
235}
236*/
237#endif // defined(RTC_ENABLE_VP9)
238
239TEST(PCFullStackTest, ParisQcifWithoutPacketLoss) {
240 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
241 CreateNetworkEmulationManager();
242 auto fixture = CreateTestFixture(
243 "pc_net_delay_0_0_plr_0",
244 CreateTwoNetworkLinks(network_emulation_manager.get(),
245 BuiltInNetworkBehaviorConfig()),
246 [](PeerConfigurer* alice) {
247 VideoConfig video(176, 144, 30);
248 video.input_file_name = ClipNameToClipPath("paris_qcif");
249 video.stream_label = "alice-video";
250 alice->AddVideoConfig(std::move(video));
251 },
252 [](PeerConfigurer* bob) {});
253 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
254 run_params.video_codec_name = cricket::kVp8CodecName;
255 run_params.use_flex_fec = false;
256 run_params.use_ulp_fec = false;
257 fixture->Run(std::move(run_params));
258}
259
260TEST_P(PCGenericDescriptorTest, ForemanCifWithoutPacketLoss) {
261 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
262 CreateNetworkEmulationManager();
263 auto fixture = CreateTestFixture(
264 GetTestName("pc_foreman_cif_net_delay_0_0_plr_0"),
265 CreateTwoNetworkLinks(network_emulation_manager.get(),
266 BuiltInNetworkBehaviorConfig()),
267 [](PeerConfigurer* alice) {
268 VideoConfig video(352, 288, 30);
269 video.input_file_name = ClipNameToClipPath("foreman_cif");
270 video.stream_label = "alice-video";
271 alice->AddVideoConfig(std::move(video));
272 },
273 [](PeerConfigurer* bob) {});
274 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
275 run_params.video_codec_name = cricket::kVp8CodecName;
276 run_params.use_flex_fec = false;
277 run_params.use_ulp_fec = false;
278 fixture->Run(std::move(run_params));
279}
280
Artem Titov85a9d912019-05-29 14:36:50 +0200281TEST_P(PCGenericDescriptorTest, ForemanCif30kbpsWithoutPacketLoss) {
Artem Titov137f6c82019-05-17 10:51:15 +0200282 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
283 CreateNetworkEmulationManager();
284 BuiltInNetworkBehaviorConfig config;
Artem Titov137f6c82019-05-17 10:51:15 +0200285 auto fixture = CreateTestFixture(
Artem Titoved4d1582019-05-20 12:04:05 +0200286 GetTestName("pc_foreman_cif_30kbps_net_delay_0_0_plr_0"),
Artem Titov137f6c82019-05-17 10:51:15 +0200287 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
288 [](PeerConfigurer* alice) {
289 VideoConfig video(352, 288, 10);
290 video.input_file_name = ClipNameToClipPath("foreman_cif");
291 video.stream_label = "alice-video";
292 alice->AddVideoConfig(std::move(video));
Artem Titov85a9d912019-05-29 14:36:50 +0200293
294 PeerConnectionInterface::BitrateParameters bitrate_params;
295 bitrate_params.min_bitrate_bps = 30000;
296 bitrate_params.current_bitrate_bps = 30000;
297 bitrate_params.max_bitrate_bps = 30000;
298 alice->SetBitrateParameters(bitrate_params);
Artem Titov137f6c82019-05-17 10:51:15 +0200299 },
300 [](PeerConfigurer* bob) {});
301 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
302 run_params.video_codec_name = cricket::kVp8CodecName;
303 run_params.use_flex_fec = false;
304 run_params.use_ulp_fec = false;
305 fixture->Run(std::move(run_params));
306}
307
308// TODO(webrtc:9722): Remove when experiment is cleaned up.
309TEST_P(PCGenericDescriptorTest,
Artem Titov85a9d912019-05-29 14:36:50 +0200310 ForemanCif30kbpsWithoutPacketLossTrustedRateControl) {
Artem Titov137f6c82019-05-17 10:51:15 +0200311 test::ScopedFieldTrials override_field_trials(
312 AppendFieldTrials(kVp8TrustedRateControllerFieldTrial));
313 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
314 CreateNetworkEmulationManager();
315 BuiltInNetworkBehaviorConfig config;
Artem Titov137f6c82019-05-17 10:51:15 +0200316 auto fixture = CreateTestFixture(
Artem Titoved4d1582019-05-20 12:04:05 +0200317 GetTestName(
318 "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_trusted_rate_ctrl"),
Artem Titov137f6c82019-05-17 10:51:15 +0200319 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
320 [](PeerConfigurer* alice) {
321 VideoConfig video(352, 288, 10);
322 video.input_file_name = ClipNameToClipPath("foreman_cif");
323 video.stream_label = "alice-video";
324 alice->AddVideoConfig(std::move(video));
Artem Titov85a9d912019-05-29 14:36:50 +0200325
326 PeerConnectionInterface::BitrateParameters bitrate_params;
327 bitrate_params.min_bitrate_bps = 30000;
328 bitrate_params.current_bitrate_bps = 30000;
329 bitrate_params.max_bitrate_bps = 30000;
330 alice->SetBitrateParameters(bitrate_params);
Artem Titov137f6c82019-05-17 10:51:15 +0200331 },
332 [](PeerConfigurer* bob) {});
333 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
334 run_params.video_codec_name = cricket::kVp8CodecName;
335 run_params.use_flex_fec = false;
336 run_params.use_ulp_fec = false;
337 fixture->Run(std::move(run_params));
338}
339
340// Link capacity below default start rate.
341TEST(PCFullStackTest, ForemanCifLink150kbpsWithoutPacketLoss) {
342 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
343 CreateNetworkEmulationManager();
344 BuiltInNetworkBehaviorConfig config;
345 config.link_capacity_kbps = 150;
346 auto fixture = CreateTestFixture(
347 "pc_foreman_cif_link_150kbps_net_delay_0_0_plr_0",
348 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
349 [](PeerConfigurer* alice) {
350 VideoConfig video(352, 288, 30);
351 video.input_file_name = ClipNameToClipPath("foreman_cif");
352 video.stream_label = "alice-video";
353 alice->AddVideoConfig(std::move(video));
354 },
355 [](PeerConfigurer* bob) {});
356 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
357 run_params.video_codec_name = cricket::kVp8CodecName;
358 run_params.use_flex_fec = false;
359 run_params.use_ulp_fec = false;
360 fixture->Run(std::move(run_params));
361}
362
Artem Titov65428262019-07-02 16:48:02 +0200363TEST(PCFullStackTest, ForemanCifLink130kbps100msDelay1PercentPacketLossUlpfec) {
364 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
365 CreateNetworkEmulationManager();
366 BuiltInNetworkBehaviorConfig config;
367 config.link_capacity_kbps = 130;
368 config.queue_delay_ms = 100;
369 config.loss_percent = 1;
370 auto fixture = CreateTestFixture(
371 "pc_foreman_cif_link_130kbps_delay100ms_loss1_ulpfec",
372 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
373 [](PeerConfigurer* alice) {
374 VideoConfig video(352, 288, 30);
375 video.input_file_name = ClipNameToClipPath("foreman_cif");
376 video.stream_label = "alice-video";
377 alice->AddVideoConfig(std::move(video));
378 },
379 [](PeerConfigurer* bob) {});
380 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
381 run_params.video_codec_name = cricket::kVp8CodecName;
382 run_params.use_flex_fec = false;
383 run_params.use_ulp_fec = true;
384 fixture->Run(std::move(run_params));
385}
386
387TEST(PCFullStackTest, ForemanCifLink50kbps100msDelay1PercentPacketLossUlpfec) {
388 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
389 CreateNetworkEmulationManager();
390 BuiltInNetworkBehaviorConfig config;
391 config.link_capacity_kbps = 50;
392 config.queue_delay_ms = 100;
393 config.loss_percent = 1;
394 auto fixture = CreateTestFixture(
395 "pc_foreman_cif_link_50kbps_delay100ms_loss1_ulpfec",
396 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
397 [](PeerConfigurer* alice) {
398 VideoConfig video(352, 288, 30);
399 video.input_file_name = ClipNameToClipPath("foreman_cif");
400 video.stream_label = "alice-video";
401 alice->AddVideoConfig(std::move(video));
402 },
403 [](PeerConfigurer* bob) {});
404 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
405 run_params.video_codec_name = cricket::kVp8CodecName;
406 run_params.use_flex_fec = false;
407 run_params.use_ulp_fec = true;
408 fixture->Run(std::move(run_params));
409}
410
Artem Titov137f6c82019-05-17 10:51:15 +0200411// Restricted network and encoder overproducing by 30%.
412TEST(PCFullStackTest, ForemanCifLink150kbpsBadRateController) {
413 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
414 CreateNetworkEmulationManager();
415 BuiltInNetworkBehaviorConfig config;
416 config.link_capacity_kbps = 150;
417 config.queue_length_packets = 30;
418 config.queue_delay_ms = 100;
419 auto fixture = CreateTestFixture(
420 "pc_foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30",
421 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
422 [](PeerConfigurer* alice) {
423 VideoConfig video(352, 288, 30);
424 video.input_file_name = ClipNameToClipPath("foreman_cif");
425 video.stream_label = "alice-video";
426 alice->AddVideoConfig(std::move(video));
427 },
428 [](PeerConfigurer* bob) {});
429 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
430 run_params.video_codec_name = cricket::kVp8CodecName;
431 run_params.use_flex_fec = false;
432 run_params.use_ulp_fec = false;
433 run_params.video_encoder_bitrate_multiplier = 1.30;
434 fixture->Run(std::move(run_params));
435}
436
437// Weak 3G-style link: 250kbps, 1% loss, 100ms delay, 15 packets queue.
438// Packet rate and loss are low enough that loss will happen with ~3s interval.
439// This triggers protection overhead to toggle between zero and non-zero.
440// Link queue is restrictive enough to trigger loss on probes.
441TEST(PCFullStackTest, ForemanCifMediaCapacitySmallLossAndQueue) {
442 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
443 CreateNetworkEmulationManager();
444 BuiltInNetworkBehaviorConfig config;
445 config.link_capacity_kbps = 250;
446 config.queue_length_packets = 10;
447 config.queue_delay_ms = 100;
448 config.loss_percent = 1;
449 auto fixture = CreateTestFixture(
450 "pc_foreman_cif_link_250kbps_delay100ms_10pkts_loss1",
451 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
452 [](PeerConfigurer* alice) {
453 VideoConfig video(352, 288, 30);
454 video.input_file_name = ClipNameToClipPath("foreman_cif");
455 video.stream_label = "alice-video";
456 alice->AddVideoConfig(std::move(video));
457 },
458 [](PeerConfigurer* bob) {});
459 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
460 run_params.video_codec_name = cricket::kVp8CodecName;
461 run_params.use_flex_fec = false;
462 run_params.use_ulp_fec = false;
463 run_params.video_encoder_bitrate_multiplier = 1.30;
464 fixture->Run(std::move(run_params));
465}
466
467TEST_P(PCGenericDescriptorTest, ForemanCifPlr5) {
468 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
469 CreateNetworkEmulationManager();
470 BuiltInNetworkBehaviorConfig config;
471 config.loss_percent = 5;
472 config.queue_delay_ms = 50;
473 auto fixture = CreateTestFixture(
474 GetTestName("pc_foreman_cif_delay_50_0_plr_5"),
475 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
476 [](PeerConfigurer* alice) {
477 VideoConfig video(352, 288, 30);
478 video.input_file_name = ClipNameToClipPath("foreman_cif");
479 video.stream_label = "alice-video";
480 alice->AddVideoConfig(std::move(video));
481 },
482 [](PeerConfigurer* bob) {});
483 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
484 run_params.video_codec_name = cricket::kVp8CodecName;
485 run_params.use_flex_fec = false;
486 run_params.use_ulp_fec = false;
487 fixture->Run(std::move(run_params));
488}
489
490TEST_P(PCGenericDescriptorTest, ForemanCifPlr5Ulpfec) {
491 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
492 CreateNetworkEmulationManager();
493 BuiltInNetworkBehaviorConfig config;
494 config.loss_percent = 5;
495 config.queue_delay_ms = 50;
496 auto fixture = CreateTestFixture(
497 GetTestName("pc_foreman_cif_delay_50_0_plr_5_ulpfec"),
498 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
499 [](PeerConfigurer* alice) {
500 VideoConfig video(352, 288, 30);
501 video.input_file_name = ClipNameToClipPath("foreman_cif");
502 video.stream_label = "alice-video";
503 alice->AddVideoConfig(std::move(video));
504 },
505 [](PeerConfigurer* bob) {});
506 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
507 run_params.video_codec_name = cricket::kVp8CodecName;
508 run_params.use_flex_fec = false;
509 run_params.use_ulp_fec = true;
510 fixture->Run(std::move(run_params));
511}
512
513TEST(PCFullStackTest, ForemanCifPlr5Flexfec) {
514 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
515 CreateNetworkEmulationManager();
516 BuiltInNetworkBehaviorConfig config;
517 config.loss_percent = 5;
518 config.queue_delay_ms = 50;
519 auto fixture = CreateTestFixture(
520 "pc_foreman_cif_delay_50_0_plr_5_flexfec",
521 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
522 [](PeerConfigurer* alice) {
523 VideoConfig video(352, 288, 30);
524 video.input_file_name = ClipNameToClipPath("foreman_cif");
525 video.stream_label = "alice-video";
526 alice->AddVideoConfig(std::move(video));
527 },
528 [](PeerConfigurer* bob) {});
529 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
530 run_params.video_codec_name = cricket::kVp8CodecName;
531 run_params.use_flex_fec = true;
532 run_params.use_ulp_fec = false;
533 fixture->Run(std::move(run_params));
534}
535
536TEST(PCFullStackTest, ForemanCif500kbpsPlr3Flexfec) {
537 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
538 CreateNetworkEmulationManager();
539 BuiltInNetworkBehaviorConfig config;
540 config.loss_percent = 3;
541 config.link_capacity_kbps = 500;
542 config.queue_delay_ms = 50;
543 auto fixture = CreateTestFixture(
544 "pc_foreman_cif_500kbps_delay_50_0_plr_3_flexfec",
545 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
546 [](PeerConfigurer* alice) {
547 VideoConfig video(352, 288, 30);
548 video.input_file_name = ClipNameToClipPath("foreman_cif");
549 video.stream_label = "alice-video";
550 alice->AddVideoConfig(std::move(video));
551 },
552 [](PeerConfigurer* bob) {});
553 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
554 run_params.video_codec_name = cricket::kVp8CodecName;
555 run_params.use_flex_fec = true;
556 run_params.use_ulp_fec = false;
557 fixture->Run(std::move(run_params));
558}
559
560TEST(PCFullStackTest, ForemanCif500kbpsPlr3Ulpfec) {
561 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
562 CreateNetworkEmulationManager();
563 BuiltInNetworkBehaviorConfig config;
564 config.loss_percent = 3;
565 config.link_capacity_kbps = 500;
566 config.queue_delay_ms = 50;
567 auto fixture = CreateTestFixture(
568 "pc_foreman_cif_500kbps_delay_50_0_plr_3_ulpfec",
569 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
570 [](PeerConfigurer* alice) {
571 VideoConfig video(352, 288, 30);
572 video.input_file_name = ClipNameToClipPath("foreman_cif");
573 video.stream_label = "alice-video";
574 alice->AddVideoConfig(std::move(video));
575 },
576 [](PeerConfigurer* bob) {});
577 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
578 run_params.video_codec_name = cricket::kVp8CodecName;
579 run_params.use_flex_fec = false;
580 run_params.use_ulp_fec = true;
581 fixture->Run(std::move(run_params));
582}
583
584#if defined(WEBRTC_USE_H264)
585TEST(PCFullStackTest, ForemanCifWithoutPacketlossH264) {
586 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
587 CreateNetworkEmulationManager();
588 auto fixture = CreateTestFixture(
589 "pc_foreman_cif_net_delay_0_0_plr_0_H264",
590 CreateTwoNetworkLinks(network_emulation_manager.get(),
591 BuiltInNetworkBehaviorConfig()),
592 [](PeerConfigurer* alice) {
593 VideoConfig video(352, 288, 30);
594 video.input_file_name = ClipNameToClipPath("foreman_cif");
595 video.stream_label = "alice-video";
596 alice->AddVideoConfig(std::move(video));
597 },
598 [](PeerConfigurer* bob) {});
599 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
600 run_params.video_codec_name = cricket::kH264CodecName;
601 run_params.use_flex_fec = false;
602 run_params.use_ulp_fec = false;
603 fixture->Run(std::move(run_params));
604}
605
Artem Titov85a9d912019-05-29 14:36:50 +0200606TEST(PCFullStackTest, ForemanCif30kbpsWithoutPacketlossH264) {
Artem Titov137f6c82019-05-17 10:51:15 +0200607 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
608 CreateNetworkEmulationManager();
609 BuiltInNetworkBehaviorConfig config;
Artem Titov137f6c82019-05-17 10:51:15 +0200610 auto fixture = CreateTestFixture(
Artem Titoved4d1582019-05-20 12:04:05 +0200611 "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_H264",
Artem Titov137f6c82019-05-17 10:51:15 +0200612 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
613 [](PeerConfigurer* alice) {
614 VideoConfig video(352, 288, 10);
615 video.input_file_name = ClipNameToClipPath("foreman_cif");
616 video.stream_label = "alice-video";
617 alice->AddVideoConfig(std::move(video));
Artem Titov85a9d912019-05-29 14:36:50 +0200618
619 PeerConnectionInterface::BitrateParameters bitrate_params;
620 bitrate_params.min_bitrate_bps = 30000;
621 bitrate_params.current_bitrate_bps = 30000;
622 bitrate_params.max_bitrate_bps = 30000;
623 alice->SetBitrateParameters(bitrate_params);
Artem Titov137f6c82019-05-17 10:51:15 +0200624 },
625 [](PeerConfigurer* bob) {});
626 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
627 run_params.video_codec_name = cricket::kH264CodecName;
628 run_params.use_flex_fec = false;
629 run_params.use_ulp_fec = false;
630 fixture->Run(std::move(run_params));
631}
632
633TEST_P(PCGenericDescriptorTest, ForemanCifPlr5H264) {
634 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
635 CreateNetworkEmulationManager();
636 BuiltInNetworkBehaviorConfig config;
637 config.loss_percent = 5;
638 config.queue_delay_ms = 50;
639 auto fixture = CreateTestFixture(
640 GetTestName("pc_foreman_cif_delay_50_0_plr_5_H264"),
641 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
642 [](PeerConfigurer* alice) {
643 VideoConfig video(352, 288, 30);
644 video.input_file_name = ClipNameToClipPath("foreman_cif");
645 video.stream_label = "alice-video";
646 alice->AddVideoConfig(std::move(video));
647 },
648 [](PeerConfigurer* bob) {});
649 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
650 run_params.video_codec_name = cricket::kH264CodecName;
651 run_params.use_flex_fec = false;
652 run_params.use_ulp_fec = false;
653 fixture->Run(std::move(run_params));
654}
655
656TEST(PCFullStackTest, ForemanCifPlr5H264SpsPpsIdrIsKeyframe) {
657 test::ScopedFieldTrials override_field_trials(
658 AppendFieldTrials("WebRTC-SpsPpsIdrIsH264Keyframe/Enabled/"));
659
660 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
661 CreateNetworkEmulationManager();
662 BuiltInNetworkBehaviorConfig config;
663 config.loss_percent = 5;
664 config.queue_delay_ms = 50;
665 auto fixture = CreateTestFixture(
666 "pc_foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr",
667 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
668 [](PeerConfigurer* alice) {
669 VideoConfig video(352, 288, 30);
670 video.input_file_name = ClipNameToClipPath("foreman_cif");
671 video.stream_label = "alice-video";
672 alice->AddVideoConfig(std::move(video));
673 },
674 [](PeerConfigurer* bob) {});
675 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
676 run_params.video_codec_name = cricket::kH264CodecName;
677 run_params.use_flex_fec = false;
678 run_params.use_ulp_fec = false;
679 fixture->Run(std::move(run_params));
680}
681
682TEST(PCFullStackTest, ForemanCifPlr5H264Flexfec) {
683 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
684 CreateNetworkEmulationManager();
685 BuiltInNetworkBehaviorConfig config;
686 config.loss_percent = 5;
687 config.queue_delay_ms = 50;
688 auto fixture = CreateTestFixture(
689 "pc_foreman_cif_delay_50_0_plr_5_H264_flexfec",
690 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
691 [](PeerConfigurer* alice) {
692 VideoConfig video(352, 288, 30);
693 video.input_file_name = ClipNameToClipPath("foreman_cif");
694 video.stream_label = "alice-video";
695 alice->AddVideoConfig(std::move(video));
696 },
697 [](PeerConfigurer* bob) {});
698 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
699 run_params.video_codec_name = cricket::kH264CodecName;
700 run_params.use_flex_fec = true;
701 run_params.use_ulp_fec = false;
702 fixture->Run(std::move(run_params));
703}
704
705// Ulpfec with H264 is an unsupported combination, so this test is only useful
706// for debugging. It is therefore disabled by default.
707TEST(PCFullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) {
708 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
709 CreateNetworkEmulationManager();
710 BuiltInNetworkBehaviorConfig config;
711 config.loss_percent = 5;
712 config.queue_delay_ms = 50;
713 auto fixture = CreateTestFixture(
Artem Titoved4d1582019-05-20 12:04:05 +0200714 "pc_foreman_cif_delay_50_0_plr_5_H264_ulpfec",
Artem Titov137f6c82019-05-17 10:51:15 +0200715 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
716 [](PeerConfigurer* alice) {
717 VideoConfig video(352, 288, 30);
718 video.input_file_name = ClipNameToClipPath("foreman_cif");
719 video.stream_label = "alice-video";
720 alice->AddVideoConfig(std::move(video));
721 },
722 [](PeerConfigurer* bob) {});
723 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
724 run_params.video_codec_name = cricket::kH264CodecName;
725 run_params.use_flex_fec = false;
726 run_params.use_ulp_fec = true;
727 fixture->Run(std::move(run_params));
728}
729#endif // defined(WEBRTC_USE_H264)
730
731TEST(PCFullStackTest, ForemanCif500kbps) {
732 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
733 CreateNetworkEmulationManager();
734 BuiltInNetworkBehaviorConfig config;
735 config.queue_length_packets = 0;
736 config.queue_delay_ms = 0;
737 config.link_capacity_kbps = 500;
738 auto fixture = CreateTestFixture(
739 "pc_foreman_cif_500kbps",
740 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
741 [](PeerConfigurer* alice) {
742 VideoConfig video(352, 288, 30);
743 video.input_file_name = ClipNameToClipPath("foreman_cif");
744 video.stream_label = "alice-video";
745 alice->AddVideoConfig(std::move(video));
746 },
747 [](PeerConfigurer* bob) {});
748 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
749 run_params.video_codec_name = cricket::kVp8CodecName;
750 run_params.use_flex_fec = false;
751 run_params.use_ulp_fec = false;
752 fixture->Run(std::move(run_params));
753}
754
755TEST(PCFullStackTest, ForemanCif500kbpsLimitedQueue) {
756 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
757 CreateNetworkEmulationManager();
758 BuiltInNetworkBehaviorConfig config;
759 config.queue_length_packets = 32;
760 config.queue_delay_ms = 0;
761 config.link_capacity_kbps = 500;
762 auto fixture = CreateTestFixture(
763 "pc_foreman_cif_500kbps_32pkts_queue",
764 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
765 [](PeerConfigurer* alice) {
766 VideoConfig video(352, 288, 30);
767 video.input_file_name = ClipNameToClipPath("foreman_cif");
768 video.stream_label = "alice-video";
769 alice->AddVideoConfig(std::move(video));
770 },
771 [](PeerConfigurer* bob) {});
772 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
773 run_params.video_codec_name = cricket::kVp8CodecName;
774 run_params.use_flex_fec = false;
775 run_params.use_ulp_fec = false;
776 fixture->Run(std::move(run_params));
777}
778
779TEST(PCFullStackTest, ForemanCif500kbps100ms) {
780 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
781 CreateNetworkEmulationManager();
782 BuiltInNetworkBehaviorConfig config;
783 config.queue_length_packets = 0;
784 config.queue_delay_ms = 100;
785 config.link_capacity_kbps = 500;
786 auto fixture = CreateTestFixture(
787 "pc_foreman_cif_500kbps_100ms",
788 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
789 [](PeerConfigurer* alice) {
790 VideoConfig video(352, 288, 30);
791 video.input_file_name = ClipNameToClipPath("foreman_cif");
792 video.stream_label = "alice-video";
793 alice->AddVideoConfig(std::move(video));
794 },
795 [](PeerConfigurer* bob) {});
796 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
797 run_params.video_codec_name = cricket::kVp8CodecName;
798 run_params.use_flex_fec = false;
799 run_params.use_ulp_fec = false;
800 fixture->Run(std::move(run_params));
801}
802
803TEST_P(PCGenericDescriptorTest, ForemanCif500kbps100msLimitedQueue) {
804 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
805 CreateNetworkEmulationManager();
806 BuiltInNetworkBehaviorConfig config;
807 config.queue_length_packets = 32;
808 config.queue_delay_ms = 100;
809 config.link_capacity_kbps = 500;
810 auto fixture = CreateTestFixture(
811 GetTestName("pc_foreman_cif_500kbps_100ms_32pkts_queue"),
812 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
813 [](PeerConfigurer* alice) {
814 VideoConfig video(352, 288, 30);
815 video.input_file_name = ClipNameToClipPath("foreman_cif");
816 video.stream_label = "alice-video";
817 alice->AddVideoConfig(std::move(video));
818 },
819 [](PeerConfigurer* bob) {});
820 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
821 run_params.video_codec_name = cricket::kVp8CodecName;
822 run_params.use_flex_fec = false;
823 run_params.use_ulp_fec = false;
824 fixture->Run(std::move(run_params));
825}
826
827/*
828// TODO(bugs.webrtc.org/10639) we need to disable send side bwe, but it isn't
Artem Titov39483c62019-07-19 17:03:52 +0200829// supported in PC level framework.
Artem Titov137f6c82019-05-17 10:51:15 +0200830TEST(PCFullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
831 auto fixture = CreateVideoQualityTestFixture();
832 ParamsWithLogging foreman_cif;
833 foreman_cif.call.send_side_bwe = false;
834 foreman_cif.video[0] = {
835 true, 352, 288, 30,
836 30000, 500000, 2000000, false,
837 "VP8", 1, 0, 0,
838 false, false, true, ClipNameToClipPath("foreman_cif")};
839 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe",
840 0.0, 0.0, kTestDurationSec};
841 foreman_cif.config->queue_length_packets = 32;
842 foreman_cif.config->queue_delay_ms = 100;
843 foreman_cif.config->link_capacity_kbps = 500;
844 fixture->RunWithAnalyzer(foreman_cif);
845}
846*/
847
848TEST(PCFullStackTest, ForemanCif1000kbps100msLimitedQueue) {
849 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
850 CreateNetworkEmulationManager();
851 BuiltInNetworkBehaviorConfig config;
852 config.queue_length_packets = 32;
853 config.queue_delay_ms = 100;
854 config.link_capacity_kbps = 1000;
855 auto fixture = CreateTestFixture(
856 "pc_foreman_cif_1000kbps_100ms_32pkts_queue",
857 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
858 [](PeerConfigurer* alice) {
859 VideoConfig video(352, 288, 30);
860 video.input_file_name = ClipNameToClipPath("foreman_cif");
861 video.stream_label = "alice-video";
862 alice->AddVideoConfig(std::move(video));
863 },
864 [](PeerConfigurer* bob) {});
865 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
866 run_params.video_codec_name = cricket::kVp8CodecName;
867 run_params.use_flex_fec = false;
868 run_params.use_ulp_fec = false;
869 fixture->Run(std::move(run_params));
870}
871
872// TODO(sprang): Remove this if we have the similar ModerateLimits below?
873TEST(PCFullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
874 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
875 CreateNetworkEmulationManager();
876 BuiltInNetworkBehaviorConfig config;
877 config.queue_length_packets = 32;
878 config.queue_delay_ms = 100;
879 config.link_capacity_kbps = 2000;
880 auto fixture = CreateTestFixture(
881 "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue",
882 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
883 [](PeerConfigurer* alice) {
884 VideoConfig video(1280, 720, 50);
885 video.input_file_name =
886 ClipNameToClipPath("ConferenceMotion_1280_720_50");
887 video.stream_label = "alice-video";
888 alice->AddVideoConfig(std::move(video));
889 },
890 [](PeerConfigurer* bob) {});
891 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
892 run_params.video_codec_name = cricket::kVp8CodecName;
893 run_params.use_flex_fec = false;
894 run_params.use_ulp_fec = false;
895 fixture->Run(std::move(run_params));
896}
897
898// TODO(webrtc:9722): Remove when experiment is cleaned up.
899TEST(PCFullStackTest, ConferenceMotionHd1TLModerateLimitsWhitelistVp8) {
900 test::ScopedFieldTrials override_field_trials(
901 AppendFieldTrials(kVp8TrustedRateControllerFieldTrial));
902 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
903 CreateNetworkEmulationManager();
904 BuiltInNetworkBehaviorConfig config;
905 config.queue_length_packets = 50;
906 config.loss_percent = 3;
907 config.queue_delay_ms = 100;
908 config.link_capacity_kbps = 2000;
909 auto fixture = CreateTestFixture(
910 "pc_conference_motion_hd_1tl_moderate_limits_trusted_rate_ctrl",
911 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
912 [](PeerConfigurer* alice) {
913 VideoConfig video(1280, 720, 50);
914 video.input_file_name =
915 ClipNameToClipPath("ConferenceMotion_1280_720_50");
916 video.stream_label = "alice-video";
917 alice->AddVideoConfig(std::move(video));
918 },
919 [](PeerConfigurer* bob) {});
920 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
921 run_params.video_codec_name = cricket::kVp8CodecName;
922 run_params.use_flex_fec = false;
923 run_params.use_ulp_fec = false;
924 fixture->Run(std::move(run_params));
925}
926
927/*
928// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
929TEST_P(PCGenericDescriptorTest, ConferenceMotionHd2TLModerateLimits) {
930 auto fixture = CreateVideoQualityTestFixture();
931 ParamsWithLogging conf_motion_hd;
932 conf_motion_hd.call.send_side_bwe = true;
933 conf_motion_hd.video[0] = {
934 true, 1280,
935 720, 50,
936 30000, 3000000,
937 3000000, false,
938 "VP8", 2,
939 -1, 0,
940 false, false,
941 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
942 conf_motion_hd.analyzer = {
943 GetTestName("conference_motion_hd_2tl_moderate_limits"), 0.0, 0.0,
944 kTestDurationSec};
945 conf_motion_hd.config->queue_length_packets = 50;
946 conf_motion_hd.config->loss_percent = 3;
947 conf_motion_hd.config->queue_delay_ms = 100;
948 conf_motion_hd.config->link_capacity_kbps = 2000;
949 conf_motion_hd.call.generic_descriptor = GenericDescriptorEnabled();
950 fixture->RunWithAnalyzer(conf_motion_hd);
951}
952
953// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
954TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimits) {
955 auto fixture = CreateVideoQualityTestFixture();
956 ParamsWithLogging conf_motion_hd;
957 conf_motion_hd.call.send_side_bwe = true;
958 conf_motion_hd.video[0] = {
959 true, 1280,
960 720, 50,
961 30000, 3000000,
962 3000000, false,
963 "VP8", 3,
964 -1, 0,
965 false, false,
966 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
967 conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0,
968 0.0, kTestDurationSec};
969 conf_motion_hd.config->queue_length_packets = 50;
970 conf_motion_hd.config->loss_percent = 3;
971 conf_motion_hd.config->queue_delay_ms = 100;
972 conf_motion_hd.config->link_capacity_kbps = 2000;
973 fixture->RunWithAnalyzer(conf_motion_hd);
974}
975
976// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
977TEST(PCFullStackTest, ConferenceMotionHd4TLModerateLimits) {
978 auto fixture = CreateVideoQualityTestFixture();
979 ParamsWithLogging conf_motion_hd;
980 conf_motion_hd.call.send_side_bwe = true;
981 conf_motion_hd.video[0] = {
982 true, 1280,
983 720, 50,
984 30000, 3000000,
985 3000000, false,
986 "VP8", 4,
987 -1, 0,
988 false, false,
989 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
990 conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0,
991 0.0, kTestDurationSec};
992 conf_motion_hd.config->queue_length_packets = 50;
993 conf_motion_hd.config->loss_percent = 3;
994 conf_motion_hd.config->queue_delay_ms = 100;
995 conf_motion_hd.config->link_capacity_kbps = 2000;
996 fixture->RunWithAnalyzer(conf_motion_hd);
997}
998
999// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1000TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) {
1001 test::ScopedFieldTrials field_trial(
1002 AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"));
1003 auto fixture = CreateVideoQualityTestFixture();
1004 ParamsWithLogging conf_motion_hd;
1005 conf_motion_hd.call.send_side_bwe = true;
1006 conf_motion_hd.video[0] = {
1007 true, 1280,
1008 720, 50,
1009 30000, 3000000,
1010 3000000, false,
1011 "VP8", 3,
1012 -1, 0,
1013 false, false,
1014 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1015 conf_motion_hd.analyzer = {"conference_motion_hd_3tl_alt_moderate_limits",
1016 0.0, 0.0, kTestDurationSec};
1017 conf_motion_hd.config->queue_length_packets = 50;
1018 conf_motion_hd.config->loss_percent = 3;
1019 conf_motion_hd.config->queue_delay_ms = 100;
1020 conf_motion_hd.config->link_capacity_kbps = 2000;
1021 fixture->RunWithAnalyzer(conf_motion_hd);
1022}
1023
1024// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1025TEST(PCFullStackTest,
1026 ConferenceMotionHd3TLModerateLimitsAltTLPatternAndBaseHeavyTLAllocation) {
1027 auto fixture = CreateVideoQualityTestFixture();
1028 test::ScopedFieldTrials field_trial(
1029 AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"
1030 "WebRTC-UseBaseHeavyVP8TL3RateAllocation/Enabled/"));
1031 ParamsWithLogging conf_motion_hd;
1032 conf_motion_hd.call.send_side_bwe = true;
1033 conf_motion_hd.video[0] = {
1034 true, 1280,
1035 720, 50,
1036 30000, 3000000,
1037 3000000, false,
1038 "VP8", 3,
1039 -1, 0,
1040 false, false,
1041 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1042 conf_motion_hd.analyzer = {
1043 "conference_motion_hd_3tl_alt_heavy_moderate_limits", 0.0, 0.0,
1044 kTestDurationSec};
1045 conf_motion_hd.config->queue_length_packets = 50;
1046 conf_motion_hd.config->loss_percent = 3;
1047 conf_motion_hd.config->queue_delay_ms = 100;
1048 conf_motion_hd.config->link_capacity_kbps = 2000;
1049 fixture->RunWithAnalyzer(conf_motion_hd);
1050}
1051*/
1052
1053#if defined(RTC_ENABLE_VP9)
1054TEST(PCFullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) {
1055 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1056 CreateNetworkEmulationManager();
1057 BuiltInNetworkBehaviorConfig config;
1058 config.queue_length_packets = 32;
1059 config.queue_delay_ms = 100;
1060 config.link_capacity_kbps = 2000;
1061 auto fixture = CreateTestFixture(
1062 "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9",
1063 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
1064 [](PeerConfigurer* alice) {
1065 VideoConfig video(1280, 720, 50);
1066 video.input_file_name =
1067 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1068 video.stream_label = "alice-video";
1069 alice->AddVideoConfig(std::move(video));
1070 },
1071 [](PeerConfigurer* bob) {});
1072 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1073 run_params.video_codec_name = cricket::kVp9CodecName;
1074 run_params.video_codec_required_params = {
1075 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1076 run_params.use_flex_fec = false;
1077 run_params.use_ulp_fec = false;
1078 fixture->Run(std::move(run_params));
1079}
1080#endif
1081
Artem Titov39483c62019-07-19 17:03:52 +02001082TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_NoConferenceMode) {
1083 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1084 CreateNetworkEmulationManager();
1085 auto fixture = CreateTestFixture(
1086 "pc_screenshare_slides_no_conference_mode",
1087 CreateTwoNetworkLinks(network_emulation_manager.get(),
1088 BuiltInNetworkBehaviorConfig()),
1089 [](PeerConfigurer* alice) {
1090 VideoConfig video(1850, 1110, 5);
1091 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
1092 video.stream_label = "alice-video";
1093 alice->AddVideoConfig(std::move(video));
1094 },
1095 [](PeerConfigurer* bob) {});
1096 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1097 run_params.video_codec_name = cricket::kVp8CodecName;
1098 run_params.use_flex_fec = false;
1099 run_params.use_ulp_fec = false;
1100 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001101}
1102
Artem Titov39483c62019-07-19 17:03:52 +02001103TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL) {
1104 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1105 CreateNetworkEmulationManager();
1106 auto fixture = CreateTestFixture(
1107 "pc_screenshare_slides",
1108 CreateTwoNetworkLinks(network_emulation_manager.get(),
1109 BuiltInNetworkBehaviorConfig()),
1110 [](PeerConfigurer* alice) {
1111 VideoConfig video(1850, 1110, 5);
1112 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
1113 video.stream_label = "alice-video";
1114 alice->AddVideoConfig(std::move(video));
1115 },
1116 [](PeerConfigurer* bob) {});
1117 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1118 run_params.video_codec_name = cricket::kVp8CodecName;
1119 run_params.use_flex_fec = false;
1120 run_params.use_ulp_fec = false;
1121 run_params.use_conference_mode = true;
1122 fixture->Run(std::move(run_params));
1123}
1124
1125// TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1126#if !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
1127TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_NoConferenceMode) {
1128 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1129 CreateNetworkEmulationManager();
1130 auto fixture = CreateTestFixture(
1131 "pc_screenshare_slides_simulcast_no_conference_mode",
1132 CreateTwoNetworkLinks(network_emulation_manager.get(),
1133 BuiltInNetworkBehaviorConfig()),
1134 [](PeerConfigurer* alice) {
Artem Titov4b9701e2019-08-28 13:48:02 +02001135 VideoConfig video(1850, 1110, 30);
Artem Titov39483c62019-07-19 17:03:52 +02001136 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
Artem Titov4b9701e2019-08-28 13:48:02 +02001137 video.simulcast_config = VideoSimulcastConfig(2, 1);
1138 video.temporal_layers_count = 2;
Artem Titov39483c62019-07-19 17:03:52 +02001139 video.stream_label = "alice-video";
1140 alice->AddVideoConfig(std::move(video));
1141 },
1142 [](PeerConfigurer* bob) {});
1143 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1144 run_params.video_codec_name = cricket::kVp8CodecName;
1145 run_params.use_flex_fec = false;
1146 run_params.use_ulp_fec = false;
1147 fixture->Run(std::move(run_params));
1148}
1149
1150TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast) {
1151 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1152 CreateNetworkEmulationManager();
1153 auto fixture = CreateTestFixture(
1154 "pc_screenshare_slides_simulcast",
1155 CreateTwoNetworkLinks(network_emulation_manager.get(),
1156 BuiltInNetworkBehaviorConfig()),
1157 [](PeerConfigurer* alice) {
Artem Titov4b9701e2019-08-28 13:48:02 +02001158 VideoConfig video(1850, 1110, 30);
Artem Titov39483c62019-07-19 17:03:52 +02001159 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
Artem Titov4b9701e2019-08-28 13:48:02 +02001160 video.simulcast_config = VideoSimulcastConfig(2, 1);
1161 video.temporal_layers_count = 2;
Artem Titov39483c62019-07-19 17:03:52 +02001162 video.stream_label = "alice-video";
1163 alice->AddVideoConfig(std::move(video));
1164 },
1165 [](PeerConfigurer* bob) {});
1166 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1167 run_params.video_codec_name = cricket::kVp8CodecName;
1168 run_params.use_flex_fec = false;
1169 run_params.use_ulp_fec = false;
1170 run_params.use_conference_mode = true;
1171 fixture->Run(std::move(run_params));
1172}
1173#endif // !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
1174
1175/*
Artem Titov137f6c82019-05-17 10:51:15 +02001176#if !defined(WEBRTC_MAC)
Artem Titov137f6c82019-05-17 10:51:15 +02001177// TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1178#if !defined(WEBRTC_WIN)
1179const char kScreenshareSimulcastVariableFramerateExperiment[] =
Artem Titov137f6c82019-05-17 10:51:15 +02001180 "WebRTC-VP8VariableFramerateScreenshare/"
1181 "Enabled,min_fps:5.0,min_qp:15,undershoot:30/";
1182// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
Artem Titov137f6c82019-05-17 10:51:15 +02001183TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_Variable_Framerate) {
1184 test::ScopedFieldTrials field_trial(
1185 AppendFieldTrials(kScreenshareSimulcastVariableFramerateExperiment));
1186 auto fixture = CreateVideoQualityTestFixture();
1187 ParamsWithLogging screenshare;
1188 screenshare.call.send_side_bwe = true;
1189 screenshare.screenshare[0] = {true, false, 10};
1190 screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
1191 2500000, false, "VP8", 2, 1, 400000,
1192 false, false, false, ""};
1193 screenshare.analyzer = {"screenshare_slides_simulcast_variable_framerate",
1194 0.0, 0.0, kTestDurationSec};
1195 ParamsWithLogging screenshare_params_high;
1196 screenshare_params_high.video[0] = {
1197 true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
1198 "VP8", 2, 0, 400000, false, false, false, ""};
1199 VideoQualityTest::Params screenshare_params_low;
1200 screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
1201 1000000, false, "VP8", 2, 0, 400000,
1202 false, false, false, ""};
1203
1204 std::vector<VideoStream> streams = {
1205 VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1206 VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1207 screenshare.ss[0] = {
1208 streams, 1, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1209 false};
1210 fixture->RunWithAnalyzer(screenshare);
1211}
1212
1213// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1214TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_low) {
Artem Titov137f6c82019-05-17 10:51:15 +02001215 auto fixture = CreateVideoQualityTestFixture();
1216 ParamsWithLogging screenshare;
1217 screenshare.call.send_side_bwe = true;
1218 screenshare.screenshare[0] = {true, false, 10};
1219 screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
1220 2500000, false, "VP8", 2, 1, 400000,
1221 false, false, false, ""};
1222 screenshare.analyzer = {"screenshare_slides_simulcast_low", 0.0, 0.0,
1223 kTestDurationSec};
1224 VideoQualityTest::Params screenshare_params_high;
1225 screenshare_params_high.video[0] = {
1226 true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
1227 "VP8", 2, 0, 400000, false, false, false, ""};
1228 VideoQualityTest::Params screenshare_params_low;
1229 screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
1230 1000000, false, "VP8", 2, 0, 400000,
1231 false, false, false, ""};
1232
1233 std::vector<VideoStream> streams = {
1234 VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1235 VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1236 screenshare.ss[0] = {
1237 streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1238 false};
1239 fixture->RunWithAnalyzer(screenshare);
1240}
1241
1242#endif // !defined(WEBRTC_WIN)
1243#endif // !defined(WEBRTC_MAC)
1244
1245// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1246TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
1247 auto fixture = CreateVideoQualityTestFixture();
1248 ParamsWithLogging config;
1249 config.call.send_side_bwe = true;
1250 config.video[0] = {true, 1850, 1110 / 2, 5, 50000, 200000,
1251 1000000, false, "VP8", 2, 1, 400000,
1252 false, false, false, ""};
1253 config.screenshare[0] = {true, false, 10, 2};
1254 config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
1255 kTestDurationSec};
1256 fixture->RunWithAnalyzer(config);
1257}
1258
1259// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1260TEST_P(PCGenericDescriptorTest, ScreenshareSlidesVP8_2TL_LossyNet) {
1261 auto fixture = CreateVideoQualityTestFixture();
1262 ParamsWithLogging screenshare;
1263 screenshare.call.send_side_bwe = true;
1264 screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1265 1000000, false, "VP8", 2, 1, 400000,
1266 false, false, false, ""};
1267 screenshare.screenshare[0] = {true, false, 10};
1268 screenshare.analyzer = {GetTestName("screenshare_slides_lossy_net"), 0.0, 0.0,
1269 kTestDurationSec};
1270 screenshare.config->loss_percent = 5;
1271 screenshare.config->queue_delay_ms = 200;
1272 screenshare.config->link_capacity_kbps = 500;
1273 screenshare.call.generic_descriptor = GenericDescriptorEnabled();
1274 fixture->RunWithAnalyzer(screenshare);
1275}
1276
1277// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1278TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
1279 auto fixture = CreateVideoQualityTestFixture();
1280 ParamsWithLogging screenshare;
1281 screenshare.call.send_side_bwe = true;
1282 screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1283 1000000, false, "VP8", 2, 1, 400000,
1284 false, false, false, ""};
1285 screenshare.screenshare[0] = {true, false, 10};
1286 screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
1287 kTestDurationSec};
1288 screenshare.config->loss_percent = 10;
1289 screenshare.config->queue_delay_ms = 200;
1290 screenshare.config->link_capacity_kbps = 500;
1291 fixture->RunWithAnalyzer(screenshare);
1292}
1293
1294// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1295TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) {
1296 auto fixture = CreateVideoQualityTestFixture();
1297 ParamsWithLogging screenshare;
1298 screenshare.call.send_side_bwe = true;
1299 screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1300 1000000, false, "VP8", 2, 1, 400000,
1301 false, false, false, ""};
1302 screenshare.screenshare[0] = {true, false, 10};
1303 screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0,
1304 kTestDurationSec};
1305 screenshare.config->loss_percent = 5;
1306 screenshare.config->link_capacity_kbps = 200;
1307 screenshare.config->queue_length_packets = 30;
1308
1309 fixture->RunWithAnalyzer(screenshare);
1310}
1311
1312// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1313TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted) {
1314 auto fixture = CreateVideoQualityTestFixture();
1315 ParamsWithLogging screenshare;
1316 screenshare.call.send_side_bwe = true;
1317 screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1318 1000000, false, "VP8", 2, 1, 400000,
1319 false, false, false, ""};
1320 screenshare.screenshare[0] = {true, false, 10};
1321 screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0,
1322 kTestDurationSec};
1323 screenshare.config->loss_percent = 1;
1324 screenshare.config->link_capacity_kbps = 1200;
1325 screenshare.config->queue_length_packets = 30;
1326
1327 fixture->RunWithAnalyzer(screenshare);
1328}
1329
1330namespace {
1331// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1332// Since ParamsWithLogging::Video is not trivially destructible, we can't
1333// store these structs as const globals.
1334ParamsWithLogging::Video SvcVp9Video() {
1335 return ParamsWithLogging::Video{
1336 true, 1280,
1337 720, 30,
1338 800000, 2500000,
1339 2500000, false,
1340 "VP9", 3,
1341 2, 400000,
1342 false, false,
1343 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1344}
1345
1346ParamsWithLogging::Video SimulcastVp8VideoHigh() {
1347 return ParamsWithLogging::Video{
1348 true, 1280,
1349 720, 30,
1350 800000, 2500000,
1351 2500000, false,
1352 "VP8", 3,
1353 2, 400000,
1354 false, false,
1355 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1356}
1357
1358ParamsWithLogging::Video SimulcastVp8VideoMedium() {
1359 return ParamsWithLogging::Video{
1360 true, 640,
1361 360, 30,
1362 150000, 500000,
1363 700000, false,
1364 "VP8", 3,
1365 2, 400000,
1366 false, false,
1367 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1368}
1369
1370ParamsWithLogging::Video SimulcastVp8VideoLow() {
1371 return ParamsWithLogging::Video{
1372 true, 320,
1373 180, 30,
1374 30000, 150000,
1375 200000, false,
1376 "VP8", 3,
1377 2, 400000,
1378 false, false,
1379 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1380}
1381} // namespace
Artem Titov733a7812019-07-24 14:53:15 +02001382*/
Artem Titov137f6c82019-05-17 10:51:15 +02001383
1384#if defined(RTC_ENABLE_VP9)
1385
Artem Titov137f6c82019-05-17 10:51:15 +02001386TEST(PCFullStackTest, ScreenshareSlidesVP9_3SL_High_Fps) {
Artem Titov1e49ab22019-07-30 13:17:25 +02001387 webrtc::test::ScopedFieldTrials override_trials(
1388 AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1389 "Enabled,inter_layer_pred_mode:on/"));
Artem Titov733a7812019-07-24 14:53:15 +02001390 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1391 CreateNetworkEmulationManager();
1392 auto fixture = CreateTestFixture(
1393 "pc_screenshare_slides_vp9_3sl_high_fps",
1394 CreateTwoNetworkLinks(network_emulation_manager.get(),
1395 BuiltInNetworkBehaviorConfig()),
1396 [](PeerConfigurer* alice) {
1397 VideoConfig video(1850, 1110, 30);
1398 video.stream_label = "alice-video";
1399 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
1400 video.simulcast_config = VideoSimulcastConfig(3, 2);
1401 alice->AddVideoConfig(std::move(video));
1402 },
1403 [](PeerConfigurer* bob) {});
1404 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1405 run_params.video_codec_name = cricket::kVp9CodecName;
1406 run_params.video_codec_required_params = {
1407 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1408 run_params.use_flex_fec = false;
1409 run_params.use_ulp_fec = false;
1410 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001411}
1412
Artem Titov137f6c82019-05-17 10:51:15 +02001413TEST(PCFullStackTest, ScreenshareSlidesVP9_3SL_Variable_Fps) {
1414 webrtc::test::ScopedFieldTrials override_trials(
1415 AppendFieldTrials("WebRTC-VP9VariableFramerateScreenshare/"
1416 "Enabled,min_qp:32,min_fps:5.0,undershoot:30,frames_"
Artem Titov1e49ab22019-07-30 13:17:25 +02001417 "before_steady_state:5/"
1418 "WebRTC-Vp9InterLayerPred/"
1419 "Enabled,inter_layer_pred_mode:on/"));
Artem Titov733a7812019-07-24 14:53:15 +02001420 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1421 CreateNetworkEmulationManager();
1422 auto fixture = CreateTestFixture(
1423 "pc_screenshare_slides_vp9_3sl_variable_fps",
1424 CreateTwoNetworkLinks(network_emulation_manager.get(),
1425 BuiltInNetworkBehaviorConfig()),
1426 [](PeerConfigurer* alice) {
1427 VideoConfig video(1850, 1110, 30);
1428 video.stream_label = "alice-video";
1429 video.screen_share_config = ScreenShareConfig(TimeDelta::seconds(10));
1430 video.simulcast_config = VideoSimulcastConfig(3, 2);
1431 alice->AddVideoConfig(std::move(video));
1432 },
1433 [](PeerConfigurer* bob) {});
1434 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1435 run_params.video_codec_name = cricket::kVp9CodecName;
1436 run_params.video_codec_required_params = {
1437 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1438 run_params.use_flex_fec = false;
1439 run_params.use_ulp_fec = false;
1440 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001441}
1442
Artem Titov1e49ab22019-07-30 13:17:25 +02001443TEST(PCFullStackTest, VP9SVC_3SL_High) {
1444 webrtc::test::ScopedFieldTrials override_trials(
1445 AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1446 "Enabled,inter_layer_pred_mode:on/"));
1447 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1448 CreateNetworkEmulationManager();
1449 auto fixture = CreateTestFixture(
1450 "pc_vp9svc_3sl_high",
1451 CreateTwoNetworkLinks(network_emulation_manager.get(),
1452 BuiltInNetworkBehaviorConfig()),
1453 [](PeerConfigurer* alice) {
1454 VideoConfig video(1280, 720, 30);
1455 video.stream_label = "alice-video";
1456 video.input_file_name =
1457 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1458 video.simulcast_config = VideoSimulcastConfig(3, 2);
1459 video.temporal_layers_count = 3;
1460 alice->AddVideoConfig(std::move(video));
1461 },
1462 [](PeerConfigurer* bob) {});
1463 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1464 run_params.video_codec_name = cricket::kVp9CodecName;
1465 run_params.video_codec_required_params = {
1466 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1467 run_params.use_flex_fec = false;
1468 run_params.use_ulp_fec = false;
1469 fixture->Run(std::move(run_params));
1470}
1471
1472TEST(PCFullStackTest, VP9SVC_3SL_Medium) {
1473 webrtc::test::ScopedFieldTrials override_trials(
1474 AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1475 "Enabled,inter_layer_pred_mode:on/"));
1476 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1477 CreateNetworkEmulationManager();
1478 auto fixture = CreateTestFixture(
1479 "pc_vp9svc_3sl_medium",
1480 CreateTwoNetworkLinks(network_emulation_manager.get(),
1481 BuiltInNetworkBehaviorConfig()),
1482 [](PeerConfigurer* alice) {
1483 VideoConfig video(1280, 720, 30);
1484 video.stream_label = "alice-video";
1485 video.input_file_name =
1486 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1487 video.simulcast_config = VideoSimulcastConfig(3, 1);
1488 video.temporal_layers_count = 3;
1489 alice->AddVideoConfig(std::move(video));
1490 },
1491 [](PeerConfigurer* bob) {});
1492 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1493 run_params.video_codec_name = cricket::kVp9CodecName;
1494 run_params.video_codec_required_params = {
1495 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1496 run_params.use_flex_fec = false;
1497 run_params.use_ulp_fec = false;
1498 fixture->Run(std::move(run_params));
1499}
1500
1501TEST(PCFullStackTest, VP9SVC_3SL_Low) {
1502 webrtc::test::ScopedFieldTrials override_trials(
1503 AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1504 "Enabled,inter_layer_pred_mode:on/"));
1505 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1506 CreateNetworkEmulationManager();
1507 auto fixture = CreateTestFixture(
1508 "pc_vp9svc_3sl_low",
1509 CreateTwoNetworkLinks(network_emulation_manager.get(),
1510 BuiltInNetworkBehaviorConfig()),
1511 [](PeerConfigurer* alice) {
1512 VideoConfig video(1280, 720, 30);
1513 video.stream_label = "alice-video";
1514 video.input_file_name =
1515 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1516 video.simulcast_config = VideoSimulcastConfig(3, 0);
1517 video.temporal_layers_count = 3;
1518 alice->AddVideoConfig(std::move(video));
1519 },
1520 [](PeerConfigurer* bob) {});
1521 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1522 run_params.video_codec_name = cricket::kVp9CodecName;
1523 run_params.video_codec_required_params = {
1524 {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}};
1525 run_params.use_flex_fec = false;
1526 run_params.use_ulp_fec = false;
1527 fixture->Run(std::move(run_params));
1528}
1529
Artem Titov733a7812019-07-24 14:53:15 +02001530#endif // defined(RTC_ENABLE_VP9)
1531
1532/*
Artem Titov137f6c82019-05-17 10:51:15 +02001533// bugs.webrtc.org/9506
1534#if !defined(WEBRTC_MAC)
1535
1536// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1537TEST(PCFullStackTest, VP9KSVC_3SL_High) {
1538 webrtc::test::ScopedFieldTrials override_trials(
1539 AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1540 auto fixture = CreateVideoQualityTestFixture();
1541 ParamsWithLogging simulcast;
1542 simulcast.call.send_side_bwe = true;
1543 simulcast.video[0] = SvcVp9Video();
1544 simulcast.analyzer = {"vp9ksvc_3sl_high", 0.0, 0.0, kTestDurationSec};
1545 simulcast.ss[0] = {
1546 std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOnKeyPic,
1547 std::vector<SpatialLayer>(), false};
1548 fixture->RunWithAnalyzer(simulcast);
1549}
1550
1551// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1552TEST(PCFullStackTest, VP9KSVC_3SL_Medium) {
1553 webrtc::test::ScopedFieldTrials override_trials(
1554 AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1555 auto fixture = CreateVideoQualityTestFixture();
1556 ParamsWithLogging simulcast;
1557 simulcast.call.send_side_bwe = true;
1558 simulcast.video[0] = SvcVp9Video();
1559 simulcast.analyzer = {"vp9ksvc_3sl_medium", 0.0, 0.0, kTestDurationSec};
1560 simulcast.ss[0] = {
1561 std::vector<VideoStream>(), 0, 3, 1, InterLayerPredMode::kOnKeyPic,
1562 std::vector<SpatialLayer>(), false};
1563 fixture->RunWithAnalyzer(simulcast);
1564}
1565
1566// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1567TEST(PCFullStackTest, VP9KSVC_3SL_Low) {
1568 webrtc::test::ScopedFieldTrials override_trials(
1569 AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1570 auto fixture = CreateVideoQualityTestFixture();
1571 ParamsWithLogging simulcast;
1572 simulcast.call.send_side_bwe = true;
1573 simulcast.video[0] = SvcVp9Video();
1574 simulcast.analyzer = {"vp9ksvc_3sl_low", 0.0, 0.0, kTestDurationSec};
1575 simulcast.ss[0] = {
1576 std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOnKeyPic,
1577 std::vector<SpatialLayer>(), false};
1578 fixture->RunWithAnalyzer(simulcast);
1579}
1580
1581// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1582TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted) {
1583 webrtc::test::ScopedFieldTrials override_trials(
1584 AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1585 auto fixture = CreateVideoQualityTestFixture();
1586 ParamsWithLogging simulcast;
1587 simulcast.call.send_side_bwe = true;
1588 simulcast.video[0] = SvcVp9Video();
1589 simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted", 0.0, 0.0,
1590 kTestDurationSec};
1591 simulcast.ss[0] = {
1592 std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
1593 std::vector<SpatialLayer>(), false};
1594 simulcast.config->link_capacity_kbps = 1000;
1595 simulcast.config->queue_delay_ms = 100;
1596 fixture->RunWithAnalyzer(simulcast);
1597}
1598
1599// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1600// TODO(webrtc:9722): Remove when experiment is cleaned up.
1601TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted_Trusted_Rate) {
1602 webrtc::test::ScopedFieldTrials override_trials(
1603 AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"
1604 "WebRTC-LibvpxVp9TrustedRateController/Enabled/"));
1605 auto fixture = CreateVideoQualityTestFixture();
1606 ParamsWithLogging simulcast;
1607 simulcast.call.send_side_bwe = true;
1608 simulcast.video[0] = SvcVp9Video();
1609 simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted_trusted_rate",
1610 0.0, 0.0, kTestDurationSec};
1611 simulcast.ss[0] = {
1612 std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
1613 std::vector<SpatialLayer>(), false};
1614 simulcast.config->link_capacity_kbps = 1000;
1615 simulcast.config->queue_delay_ms = 100;
1616 fixture->RunWithAnalyzer(simulcast);
1617}
1618#endif // !defined(WEBRTC_MAC)
1619
1620#endif // defined(RTC_ENABLE_VP9)
Artem Titov39483c62019-07-19 17:03:52 +02001621*/
Artem Titov137f6c82019-05-17 10:51:15 +02001622
1623// Android bots can't handle FullHD, so disable the test.
1624// TODO(bugs.webrtc.org/9220): Investigate source of flakiness on Mac.
1625#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
1626#define MAYBE_SimulcastFullHdOveruse DISABLED_SimulcastFullHdOveruse
1627#else
1628#define MAYBE_SimulcastFullHdOveruse SimulcastFullHdOveruse
1629#endif
Artem Titov137f6c82019-05-17 10:51:15 +02001630TEST(PCFullStackTest, MAYBE_SimulcastFullHdOveruse) {
Artem Titov137f6c82019-05-17 10:51:15 +02001631 webrtc::test::ScopedFieldTrials override_trials(AppendFieldTrials(
1632 "WebRTC-ForceSimulatedOveruseIntervalMs/1000-50000-300/"));
Artem Titov39483c62019-07-19 17:03:52 +02001633 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1634 CreateNetworkEmulationManager();
1635 BuiltInNetworkBehaviorConfig config;
1636 config.loss_percent = 0;
1637 config.queue_delay_ms = 100;
1638 auto fixture = CreateTestFixture(
1639 "pc_simulcast_HD_high",
1640 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
1641 [](PeerConfigurer* alice) {
1642 VideoConfig video(1920, 1080, 30);
1643 video.generator = VideoGeneratorType::kDefault;
1644 video.simulcast_config = VideoSimulcastConfig(3, 2);
Artem Titov4b9701e2019-08-28 13:48:02 +02001645 video.temporal_layers_count = 3;
Artem Titov39483c62019-07-19 17:03:52 +02001646 video.stream_label = "alice-video";
1647 alice->AddVideoConfig(std::move(video));
1648 },
1649 [](PeerConfigurer* bob) {});
1650 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1651 run_params.video_codec_name = cricket::kVp8CodecName;
1652 run_params.use_flex_fec = false;
1653 run_params.use_ulp_fec = false;
1654 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001655}
1656
Artem Titov137f6c82019-05-17 10:51:15 +02001657TEST(PCFullStackTest, SimulcastVP8_3SL_High) {
Artem Titov39483c62019-07-19 17:03:52 +02001658 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1659 CreateNetworkEmulationManager();
1660 BuiltInNetworkBehaviorConfig config;
1661 config.loss_percent = 0;
1662 config.queue_delay_ms = 100;
1663 auto fixture = CreateTestFixture(
1664 "pc_simulcast_vp8_3sl_high",
1665 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
1666 [](PeerConfigurer* alice) {
1667 VideoConfig video(1280, 720, 30);
1668 video.input_file_name =
1669 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1670 video.simulcast_config = VideoSimulcastConfig(3, 2);
1671 video.stream_label = "alice-video";
1672 alice->AddVideoConfig(std::move(video));
1673 },
1674 [](PeerConfigurer* bob) {});
1675 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1676 run_params.video_codec_name = cricket::kVp8CodecName;
1677 run_params.use_flex_fec = false;
1678 run_params.use_ulp_fec = false;
1679 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001680}
1681
Artem Titov137f6c82019-05-17 10:51:15 +02001682TEST(PCFullStackTest, SimulcastVP8_3SL_Medium) {
Artem Titov39483c62019-07-19 17:03:52 +02001683 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1684 CreateNetworkEmulationManager();
1685 BuiltInNetworkBehaviorConfig config;
1686 config.loss_percent = 0;
1687 config.queue_delay_ms = 100;
1688 auto fixture = CreateTestFixture(
1689 "pc_simulcast_vp8_3sl_medium",
1690 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
1691 [](PeerConfigurer* alice) {
1692 VideoConfig video(1280, 720, 30);
1693 video.input_file_name =
1694 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1695 video.simulcast_config = VideoSimulcastConfig(3, 1);
1696 video.stream_label = "alice-video";
1697 alice->AddVideoConfig(std::move(video));
1698 },
1699 [](PeerConfigurer* bob) {});
1700 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1701 run_params.video_codec_name = cricket::kVp8CodecName;
1702 run_params.use_flex_fec = false;
1703 run_params.use_ulp_fec = false;
1704 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001705}
1706
Artem Titov137f6c82019-05-17 10:51:15 +02001707TEST(PCFullStackTest, SimulcastVP8_3SL_Low) {
Artem Titov39483c62019-07-19 17:03:52 +02001708 std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1709 CreateNetworkEmulationManager();
1710 BuiltInNetworkBehaviorConfig config;
1711 config.loss_percent = 0;
1712 config.queue_delay_ms = 100;
1713 auto fixture = CreateTestFixture(
1714 "pc_simulcast_vp8_3sl_low",
1715 CreateTwoNetworkLinks(network_emulation_manager.get(), config),
1716 [](PeerConfigurer* alice) {
1717 VideoConfig video(1280, 720, 30);
1718 video.input_file_name =
1719 ClipNameToClipPath("ConferenceMotion_1280_720_50");
1720 video.simulcast_config = VideoSimulcastConfig(3, 0);
1721 video.stream_label = "alice-video";
1722 alice->AddVideoConfig(std::move(video));
1723 },
1724 [](PeerConfigurer* bob) {});
1725 RunParams run_params(TimeDelta::seconds(kTestDurationSec));
1726 run_params.video_codec_name = cricket::kVp8CodecName;
1727 run_params.use_flex_fec = false;
1728 run_params.use_ulp_fec = false;
1729 fixture->Run(std::move(run_params));
Artem Titov137f6c82019-05-17 10:51:15 +02001730}
1731
Artem Titov39483c62019-07-19 17:03:52 +02001732/*
Artem Titov137f6c82019-05-17 10:51:15 +02001733// This test assumes ideal network conditions with target bandwidth being
1734// available and exercises WebRTC calls with a high target bitrate(100 Mbps).
1735// Android32 bots can't handle this high bitrate, so disable test for those.
1736#if defined(WEBRTC_ANDROID)
1737#define MAYBE_HighBitrateWithFakeCodec DISABLED_HighBitrateWithFakeCodec
1738#else
1739#define MAYBE_HighBitrateWithFakeCodec HighBitrateWithFakeCodec
1740#endif // defined(WEBRTC_ANDROID)
1741// TODO(bugs.webrtc.org/10639) Disabled because target bitrate can't be
1742configured yet. TEST(PCFullStackTest, MAYBE_HighBitrateWithFakeCodec) { auto
1743fixture = CreateVideoQualityTestFixture(); const int target_bitrate = 100000000;
1744 ParamsWithLogging generator;
1745 generator.call.send_side_bwe = true;
1746 generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate;
1747 generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate;
1748 generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate;
1749 generator.video[0] = {true,
1750 360,
1751 240,
1752 30,
1753 target_bitrate / 2,
1754 target_bitrate,
1755 target_bitrate * 2,
1756 false,
1757 "FakeCodec",
1758 1,
1759 0,
1760 0,
1761 false,
1762 false,
1763 false,
1764 "Generator"};
1765 generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0,
1766 kTestDurationSec};
1767 fixture->RunWithAnalyzer(generator);
1768}
1769
1770// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1771TEST(PCFullStackTest, LargeRoomVP8_5thumb) {
1772 auto fixture = CreateVideoQualityTestFixture();
1773 ParamsWithLogging large_room;
1774 large_room.call.send_side_bwe = true;
1775 large_room.video[0] = SimulcastVp8VideoHigh();
1776 large_room.analyzer = {"largeroom_5thumb", 0.0, 0.0, kTestDurationSec};
1777 large_room.config->loss_percent = 0;
1778 large_room.config->queue_delay_ms = 100;
1779 ParamsWithLogging video_params_high;
1780 video_params_high.video[0] = SimulcastVp8VideoHigh();
1781 ParamsWithLogging video_params_medium;
1782 video_params_medium.video[0] = SimulcastVp8VideoMedium();
1783 ParamsWithLogging video_params_low;
1784 video_params_low.video[0] = SimulcastVp8VideoLow();
1785
1786 std::vector<VideoStream> streams = {
1787 VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1788 VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1789 VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1790 large_room.call.num_thumbnails = 5;
1791 large_room.ss[0] = {
1792 streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1793 false};
1794 fixture->RunWithAnalyzer(large_room);
1795}
1796
1797#if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
1798// Fails on mobile devices:
1799// https://bugs.chromium.org/p/webrtc/issues/detail?id=7301
1800#define MAYBE_LargeRoomVP8_50thumb DISABLED_LargeRoomVP8_50thumb
1801#define MAYBE_LargeRoomVP8_15thumb DISABLED_LargeRoomVP8_15thumb
1802#else
1803#define MAYBE_LargeRoomVP8_50thumb LargeRoomVP8_50thumb
1804#define MAYBE_LargeRoomVP8_15thumb LargeRoomVP8_15thumb
1805#endif
1806// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1807TEST(PCFullStackTest, MAYBE_LargeRoomVP8_15thumb) {
1808 auto fixture = CreateVideoQualityTestFixture();
1809 ParamsWithLogging large_room;
1810 large_room.call.send_side_bwe = true;
1811 large_room.video[0] = SimulcastVp8VideoHigh();
1812 large_room.analyzer = {"largeroom_15thumb", 0.0, 0.0, kTestDurationSec};
1813 large_room.config->loss_percent = 0;
1814 large_room.config->queue_delay_ms = 100;
1815 ParamsWithLogging video_params_high;
1816 video_params_high.video[0] = SimulcastVp8VideoHigh();
1817 ParamsWithLogging video_params_medium;
1818 video_params_medium.video[0] = SimulcastVp8VideoMedium();
1819 ParamsWithLogging video_params_low;
1820 video_params_low.video[0] = SimulcastVp8VideoLow();
1821
1822 std::vector<VideoStream> streams = {
1823 VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1824 VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1825 VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1826 large_room.call.num_thumbnails = 15;
1827 large_room.ss[0] = {
1828 streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1829 false};
1830 fixture->RunWithAnalyzer(large_room);
1831}
1832
1833// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1834TEST(PCFullStackTest, MAYBE_LargeRoomVP8_50thumb) {
1835 auto fixture = CreateVideoQualityTestFixture();
1836 ParamsWithLogging large_room;
1837 large_room.call.send_side_bwe = true;
1838 large_room.video[0] = SimulcastVp8VideoHigh();
1839 large_room.analyzer = {"largeroom_50thumb", 0.0, 0.0, kTestDurationSec};
1840 large_room.config->loss_percent = 0;
1841 large_room.config->queue_delay_ms = 100;
1842 ParamsWithLogging video_params_high;
1843 video_params_high.video[0] = SimulcastVp8VideoHigh();
1844 ParamsWithLogging video_params_medium;
1845 video_params_medium.video[0] = SimulcastVp8VideoMedium();
1846 ParamsWithLogging video_params_low;
1847 video_params_low.video[0] = SimulcastVp8VideoLow();
1848
1849 std::vector<VideoStream> streams = {
1850 VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1851 VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1852 VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1853 large_room.call.num_thumbnails = 50;
1854 large_room.ss[0] = {
1855 streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1856 false};
1857 fixture->RunWithAnalyzer(large_room);
1858}
1859*/
1860
1861INSTANTIATE_TEST_SUITE_P(
1862 PCFullStackTest,
1863 PCGenericDescriptorTest,
1864 ::testing::Values("WebRTC-GenericDescriptor/Disabled/",
1865 "WebRTC-GenericDescriptor/Enabled/"));
1866
1867class PCDualStreamsTest : public ::testing::TestWithParam<int> {};
1868
1869/*
1870// Disable dual video test on mobile device becuase it's too heavy.
1871// TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on MAC.
1872#if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC)
1873// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1874TEST_P(PCDualStreamsTest,
1875 ModeratelyRestricted_SlidesVp8_2TL_Simulcast_Video_Simulcast_High) {
Artem Titov137f6c82019-05-17 10:51:15 +02001876 const int first_stream = GetParam();
1877 ParamsWithLogging dual_streams;
1878
1879 // Screenshare Settings.
1880 dual_streams.screenshare[first_stream] = {true, false, 10};
1881 dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
1882 2500000, false, "VP8", 2, 1, 400000,
1883 false, false, false, ""};
1884
1885 ParamsWithLogging screenshare_params_high;
1886 screenshare_params_high.video[0] = {
1887 true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
1888 "VP8", 2, 0, 400000, false, false, false, ""};
1889 VideoQualityTest::Params screenshare_params_low;
1890 screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
1891 1000000, false, "VP8", 2, 0, 400000,
1892 false, false, false, ""};
1893 std::vector<VideoStream> screenhsare_streams = {
1894 VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1895 VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1896
1897 dual_streams.ss[first_stream] = {
1898 screenhsare_streams, 1, 1, 0, InterLayerPredMode::kOn,
1899 std::vector<SpatialLayer>(), false};
1900
1901 // Video settings.
1902 dual_streams.video[1 - first_stream] = SimulcastVp8VideoHigh();
1903
1904 ParamsWithLogging video_params_high;
1905 video_params_high.video[0] = SimulcastVp8VideoHigh();
1906 ParamsWithLogging video_params_medium;
1907 video_params_medium.video[0] = SimulcastVp8VideoMedium();
1908 ParamsWithLogging video_params_low;
1909 video_params_low.video[0] = SimulcastVp8VideoLow();
1910 std::vector<VideoStream> streams = {
1911 VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1912 VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1913 VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1914
1915 dual_streams.ss[1 - first_stream] = {
1916 streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1917 false};
1918
1919 // Call settings.
1920 dual_streams.call.send_side_bwe = true;
1921 dual_streams.call.dual_video = true;
1922 std::string test_label = "dualstreams_moderately_restricted_screenshare_" +
1923 std::to_string(first_stream);
1924 dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1925 dual_streams.config->loss_percent = 1;
1926 dual_streams.config->link_capacity_kbps = 7500;
1927 dual_streams.config->queue_length_packets = 30;
1928 dual_streams.config->queue_delay_ms = 100;
1929
1930 auto fixture = CreateVideoQualityTestFixture();
1931 fixture->RunWithAnalyzer(dual_streams);
1932}
1933#endif // !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) &&
1934 // !defined(WEBRTC_MAC)
1935
1936// TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1937TEST_P(PCDualStreamsTest, Conference_Restricted) {
1938 const int first_stream = GetParam();
1939 ParamsWithLogging dual_streams;
1940
1941 // Screenshare Settings.
1942 dual_streams.screenshare[first_stream] = {true, false, 10};
1943 dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
1944 2500000, false, "VP8", 3, 2, 400000,
1945 false, false, false, ""};
1946 // Video settings.
1947 dual_streams.video[1 - first_stream] = {
1948 true, 1280,
1949 720, 30,
1950 150000, 500000,
1951 700000, false,
1952 "VP8", 3,
1953 2, 400000,
1954 false, false,
1955 false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1956
1957 // Call settings.
1958 dual_streams.call.send_side_bwe = true;
1959 dual_streams.call.dual_video = true;
1960 std::string test_label = "dualstreams_conference_restricted_screenshare_" +
1961 std::to_string(first_stream);
1962 dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1963 dual_streams.config->loss_percent = 1;
1964 dual_streams.config->link_capacity_kbps = 5000;
1965 dual_streams.config->queue_length_packets = 30;
1966 dual_streams.config->queue_delay_ms = 100;
1967
1968 auto fixture = CreateVideoQualityTestFixture();
1969 fixture->RunWithAnalyzer(dual_streams);
1970}
1971*/
1972
1973INSTANTIATE_TEST_SUITE_P(PCFullStackTest,
1974 PCDualStreamsTest,
1975 ::testing::Values(0, 1));
1976
1977} // namespace webrtc