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