1*d9f75844SAndroid Build Coastguard Worker /*
2*d9f75844SAndroid Build Coastguard Worker * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3*d9f75844SAndroid Build Coastguard Worker *
4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license
5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source
6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found
7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may
8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree.
9*d9f75844SAndroid Build Coastguard Worker */
10*d9f75844SAndroid Build Coastguard Worker #include <memory>
11*d9f75844SAndroid Build Coastguard Worker #include <string>
12*d9f75844SAndroid Build Coastguard Worker #include <utility>
13*d9f75844SAndroid Build Coastguard Worker #include <vector>
14*d9f75844SAndroid Build Coastguard Worker
15*d9f75844SAndroid Build Coastguard Worker #include "api/media_stream_interface.h"
16*d9f75844SAndroid Build Coastguard Worker #include "api/test/create_network_emulation_manager.h"
17*d9f75844SAndroid Build Coastguard Worker #include "api/test/create_peer_connection_quality_test_frame_generator.h"
18*d9f75844SAndroid Build Coastguard Worker #include "api/test/create_peerconnection_quality_test_fixture.h"
19*d9f75844SAndroid Build Coastguard Worker #include "api/test/frame_generator_interface.h"
20*d9f75844SAndroid Build Coastguard Worker #include "api/test/metrics/global_metrics_logger_and_exporter.h"
21*d9f75844SAndroid Build Coastguard Worker #include "api/test/network_emulation_manager.h"
22*d9f75844SAndroid Build Coastguard Worker #include "api/test/pclf/media_configuration.h"
23*d9f75844SAndroid Build Coastguard Worker #include "api/test/pclf/media_quality_test_params.h"
24*d9f75844SAndroid Build Coastguard Worker #include "api/test/pclf/peer_configurer.h"
25*d9f75844SAndroid Build Coastguard Worker #include "api/test/peerconnection_quality_test_fixture.h"
26*d9f75844SAndroid Build Coastguard Worker #include "api/test/simulated_network.h"
27*d9f75844SAndroid Build Coastguard Worker #include "api/test/time_controller.h"
28*d9f75844SAndroid Build Coastguard Worker #include "api/video_codecs/vp9_profile.h"
29*d9f75844SAndroid Build Coastguard Worker #include "call/simulated_network.h"
30*d9f75844SAndroid Build Coastguard Worker #include "modules/video_coding/codecs/vp9/include/vp9.h"
31*d9f75844SAndroid Build Coastguard Worker #include "system_wrappers/include/field_trial.h"
32*d9f75844SAndroid Build Coastguard Worker #include "test/field_trial.h"
33*d9f75844SAndroid Build Coastguard Worker #include "test/gtest.h"
34*d9f75844SAndroid Build Coastguard Worker #include "test/pc/e2e/network_quality_metrics_reporter.h"
35*d9f75844SAndroid Build Coastguard Worker #include "test/testsupport/file_utils.h"
36*d9f75844SAndroid Build Coastguard Worker
37*d9f75844SAndroid Build Coastguard Worker namespace webrtc {
38*d9f75844SAndroid Build Coastguard Worker
39*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::AudioConfig;
40*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::EmulatedSFUConfig;
41*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::PeerConfigurer;
42*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::RunParams;
43*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::ScreenShareConfig;
44*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::VideoCodecConfig;
45*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::VideoConfig;
46*d9f75844SAndroid Build Coastguard Worker using ::webrtc::webrtc_pc_e2e::VideoSimulcastConfig;
47*d9f75844SAndroid Build Coastguard Worker
48*d9f75844SAndroid Build Coastguard Worker namespace {
49*d9f75844SAndroid Build Coastguard Worker
50*d9f75844SAndroid Build Coastguard Worker constexpr int kTestDurationSec = 45;
51*d9f75844SAndroid Build Coastguard Worker
52*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture>
CreateTestFixture(const std::string & test_case_name,TimeController & time_controller,std::pair<EmulatedNetworkManagerInterface *,EmulatedNetworkManagerInterface * > network_links,rtc::FunctionView<void (PeerConfigurer *)> alice_configurer,rtc::FunctionView<void (PeerConfigurer *)> bob_configurer)53*d9f75844SAndroid Build Coastguard Worker CreateTestFixture(const std::string& test_case_name,
54*d9f75844SAndroid Build Coastguard Worker TimeController& time_controller,
55*d9f75844SAndroid Build Coastguard Worker std::pair<EmulatedNetworkManagerInterface*,
56*d9f75844SAndroid Build Coastguard Worker EmulatedNetworkManagerInterface*> network_links,
57*d9f75844SAndroid Build Coastguard Worker rtc::FunctionView<void(PeerConfigurer*)> alice_configurer,
58*d9f75844SAndroid Build Coastguard Worker rtc::FunctionView<void(PeerConfigurer*)> bob_configurer) {
59*d9f75844SAndroid Build Coastguard Worker auto fixture = webrtc_pc_e2e::CreatePeerConnectionE2EQualityTestFixture(
60*d9f75844SAndroid Build Coastguard Worker test_case_name, time_controller, /*audio_quality_analyzer=*/nullptr,
61*d9f75844SAndroid Build Coastguard Worker /*video_quality_analyzer=*/nullptr);
62*d9f75844SAndroid Build Coastguard Worker auto alice = std::make_unique<PeerConfigurer>(
63*d9f75844SAndroid Build Coastguard Worker network_links.first->network_dependencies());
64*d9f75844SAndroid Build Coastguard Worker auto bob = std::make_unique<PeerConfigurer>(
65*d9f75844SAndroid Build Coastguard Worker network_links.second->network_dependencies());
66*d9f75844SAndroid Build Coastguard Worker alice_configurer(alice.get());
67*d9f75844SAndroid Build Coastguard Worker bob_configurer(bob.get());
68*d9f75844SAndroid Build Coastguard Worker fixture->AddPeer(std::move(alice));
69*d9f75844SAndroid Build Coastguard Worker fixture->AddPeer(std::move(bob));
70*d9f75844SAndroid Build Coastguard Worker fixture->AddQualityMetricsReporter(
71*d9f75844SAndroid Build Coastguard Worker std::make_unique<webrtc_pc_e2e::NetworkQualityMetricsReporter>(
72*d9f75844SAndroid Build Coastguard Worker network_links.first, network_links.second,
73*d9f75844SAndroid Build Coastguard Worker test::GetGlobalMetricsLogger()));
74*d9f75844SAndroid Build Coastguard Worker return fixture;
75*d9f75844SAndroid Build Coastguard Worker }
76*d9f75844SAndroid Build Coastguard Worker
77*d9f75844SAndroid Build Coastguard Worker // Takes the current active field trials set, and appends some new trials.
AppendFieldTrials(std::string new_trial_string)78*d9f75844SAndroid Build Coastguard Worker std::string AppendFieldTrials(std::string new_trial_string) {
79*d9f75844SAndroid Build Coastguard Worker return std::string(field_trial::GetFieldTrialString()) + new_trial_string;
80*d9f75844SAndroid Build Coastguard Worker }
81*d9f75844SAndroid Build Coastguard Worker
ClipNameToClipPath(const char * clip_name)82*d9f75844SAndroid Build Coastguard Worker std::string ClipNameToClipPath(const char* clip_name) {
83*d9f75844SAndroid Build Coastguard Worker return test::ResourcePath(clip_name, "yuv");
84*d9f75844SAndroid Build Coastguard Worker }
85*d9f75844SAndroid Build Coastguard Worker
86*d9f75844SAndroid Build Coastguard Worker } // namespace
87*d9f75844SAndroid Build Coastguard Worker
88*d9f75844SAndroid Build Coastguard Worker struct PCFullStackTestParams {
89*d9f75844SAndroid Build Coastguard Worker bool use_network_thread_as_worker_thread = false;
90*d9f75844SAndroid Build Coastguard Worker std::string field_trials;
91*d9f75844SAndroid Build Coastguard Worker std::string test_case_name_postfix;
92*d9f75844SAndroid Build Coastguard Worker };
93*d9f75844SAndroid Build Coastguard Worker
ParameterizedTestParams()94*d9f75844SAndroid Build Coastguard Worker std::vector<PCFullStackTestParams> ParameterizedTestParams() {
95*d9f75844SAndroid Build Coastguard Worker return {// Run with default parameters and field trials.
96*d9f75844SAndroid Build Coastguard Worker {},
97*d9f75844SAndroid Build Coastguard Worker // Use the network thread as worker thread.
98*d9f75844SAndroid Build Coastguard Worker // Use the worker thread for sending packets.
99*d9f75844SAndroid Build Coastguard Worker // https://bugs.chromium.org/p/webrtc/issues/detail?id=14502
100*d9f75844SAndroid Build Coastguard Worker {.use_network_thread_as_worker_thread = true,
101*d9f75844SAndroid Build Coastguard Worker .field_trials = "WebRTC-SendPacketsOnWorkerThread/Enabled/",
102*d9f75844SAndroid Build Coastguard Worker .test_case_name_postfix = "_ReducedThreads"}};
103*d9f75844SAndroid Build Coastguard Worker }
104*d9f75844SAndroid Build Coastguard Worker
105*d9f75844SAndroid Build Coastguard Worker class ParameterizedPCFullStackTest
106*d9f75844SAndroid Build Coastguard Worker : public ::testing::TestWithParam<PCFullStackTestParams> {
107*d9f75844SAndroid Build Coastguard Worker public:
ParameterizedPCFullStackTest()108*d9f75844SAndroid Build Coastguard Worker ParameterizedPCFullStackTest() : field_trials_(GetParam().field_trials) {}
109*d9f75844SAndroid Build Coastguard Worker
110*d9f75844SAndroid Build Coastguard Worker private:
111*d9f75844SAndroid Build Coastguard Worker test::ScopedFieldTrials field_trials_;
112*d9f75844SAndroid Build Coastguard Worker };
113*d9f75844SAndroid Build Coastguard Worker
114*d9f75844SAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(
115*d9f75844SAndroid Build Coastguard Worker ParameterizedPCFullStackTest,
116*d9f75844SAndroid Build Coastguard Worker ParameterizedPCFullStackTest,
117*d9f75844SAndroid Build Coastguard Worker testing::ValuesIn(ParameterizedTestParams()),
__anon1c6224a30202(const testing::TestParamInfo<PCFullStackTestParams>& info) 118*d9f75844SAndroid Build Coastguard Worker [](const testing::TestParamInfo<PCFullStackTestParams>& info) {
119*d9f75844SAndroid Build Coastguard Worker if (info.param.test_case_name_postfix.empty())
120*d9f75844SAndroid Build Coastguard Worker return std::string("Default");
121*d9f75844SAndroid Build Coastguard Worker return info.param.test_case_name_postfix;
122*d9f75844SAndroid Build Coastguard Worker });
123*d9f75844SAndroid Build Coastguard Worker
124*d9f75844SAndroid Build Coastguard Worker #if defined(RTC_ENABLE_VP9)
TEST(PCFullStackTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_VP9)125*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_VP9) {
126*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
127*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
128*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
129*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_net_delay_0_0_plr_0_VP9",
130*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
131*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
132*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
133*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
134*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
135*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
136*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
137*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
138*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
139*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
140*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
141*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
142*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
143*d9f75844SAndroid Build Coastguard Worker },
144*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
145*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
146*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
147*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
148*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
149*d9f75844SAndroid Build Coastguard Worker });
150*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
151*d9f75844SAndroid Build Coastguard Worker }
152*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_VP9_Generic_Descriptor)153*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
154*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Delay_50_0_Plr_5_VP9_Generic_Descriptor) {
155*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
156*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
157*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
158*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
159*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
160*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
161*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_VP9_generic_descriptor",
162*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
163*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
164*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
165*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
166*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
167*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
168*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
169*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
170*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
171*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
172*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
173*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
174*d9f75844SAndroid Build Coastguard Worker },
175*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
176*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
177*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
178*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
179*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
180*d9f75844SAndroid Build Coastguard Worker });
181*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
182*d9f75844SAndroid Build Coastguard Worker }
183*d9f75844SAndroid Build Coastguard Worker
184*d9f75844SAndroid Build Coastguard Worker // VP9 2nd profile isn't supported on android arm and arm 64.
185*d9f75844SAndroid Build Coastguard Worker #if (defined(WEBRTC_ANDROID) && \
186*d9f75844SAndroid Build Coastguard Worker (defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM))) || \
187*d9f75844SAndroid Build Coastguard Worker (defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64))
188*d9f75844SAndroid Build Coastguard Worker #define MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2 \
189*d9f75844SAndroid Build Coastguard Worker DISABLED_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2
190*d9f75844SAndroid Build Coastguard Worker #else
191*d9f75844SAndroid Build Coastguard Worker #define MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2 \
192*d9f75844SAndroid Build Coastguard Worker Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2
193*d9f75844SAndroid Build Coastguard Worker #endif
TEST(PCFullStackTest,MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2)194*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2) {
195*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
196*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
197*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
198*d9f75844SAndroid Build Coastguard Worker "pc_generator_net_delay_0_0_plr_0_VP9Profile2",
199*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
200*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
201*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
202*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
203*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
204*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
205*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateSquareFrameGenerator(
206*d9f75844SAndroid Build Coastguard Worker video, test::FrameGeneratorInterface::OutputType::kI010);
207*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
208*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
209*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
210*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
211*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile2)}})});
212*d9f75844SAndroid Build Coastguard Worker },
213*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
214*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
215*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
216*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
217*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile2)}})});
218*d9f75844SAndroid Build Coastguard Worker });
219*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
220*d9f75844SAndroid Build Coastguard Worker }
221*d9f75844SAndroid Build Coastguard Worker
222*d9f75844SAndroid Build Coastguard Worker /*
223*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) migrate commented out test, when required
224*d9f75844SAndroid Build Coastguard Worker // functionality will be supported in PeerConnection level framework.
225*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ForemanCifWithoutPacketLossMultiplexI420Frame) {
226*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
227*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging foreman_cif;
228*d9f75844SAndroid Build Coastguard Worker foreman_cif.call.send_side_bwe = true;
229*d9f75844SAndroid Build Coastguard Worker foreman_cif.video[0] = {
230*d9f75844SAndroid Build Coastguard Worker true, 352, 288, 30,
231*d9f75844SAndroid Build Coastguard Worker 700000, 700000, 700000, false,
232*d9f75844SAndroid Build Coastguard Worker "multiplex", 1, 0, 0,
233*d9f75844SAndroid Build Coastguard Worker false, false, false, ClipNameToClipPath("foreman_cif")};
234*d9f75844SAndroid Build Coastguard Worker foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
235*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
236*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(foreman_cif);
237*d9f75844SAndroid Build Coastguard Worker }
238*d9f75844SAndroid Build Coastguard Worker
239*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, GeneratorWithoutPacketLossMultiplexI420AFrame) {
240*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
241*d9f75844SAndroid Build Coastguard Worker
242*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging generator;
243*d9f75844SAndroid Build Coastguard Worker generator.call.send_side_bwe = true;
244*d9f75844SAndroid Build Coastguard Worker generator.video[0] = {
245*d9f75844SAndroid Build Coastguard Worker true, 352, 288, 30, 700000, 700000, 700000, false,
246*d9f75844SAndroid Build Coastguard Worker "multiplex", 1, 0, 0, false, false, false, "GeneratorI420A"};
247*d9f75844SAndroid Build Coastguard Worker generator.analyzer = {"generator_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
248*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
249*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(generator);
250*d9f75844SAndroid Build Coastguard Worker }
251*d9f75844SAndroid Build Coastguard Worker */
252*d9f75844SAndroid Build Coastguard Worker #endif // defined(RTC_ENABLE_VP9)
253*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Net_Delay_0_0_Plr_0)254*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Net_Delay_0_0_Plr_0) {
255*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
256*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
257*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
258*d9f75844SAndroid Build Coastguard Worker "pc_net_delay_0_0_plr_0", *network_emulation_manager->time_controller(),
259*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
260*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
261*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
262*d9f75844SAndroid Build Coastguard Worker VideoConfig video(176, 144, 30);
263*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
264*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
265*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("paris_qcif"));
266*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
267*d9f75844SAndroid Build Coastguard Worker },
268*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
269*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
270*d9f75844SAndroid Build Coastguard Worker }
271*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_Generic_Descriptor)272*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
273*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_Generic_Descriptor) {
274*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
275*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
276*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
277*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_net_delay_0_0_plr_0_generic_descriptor",
278*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
279*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
280*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
281*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
282*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
283*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
284*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
285*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
286*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
287*d9f75844SAndroid Build Coastguard Worker },
288*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
289*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
290*d9f75844SAndroid Build Coastguard Worker }
291*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_Generic_Descriptor)292*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
293*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_Generic_Descriptor) {
294*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
295*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
296*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
297*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
298*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_generic_descriptor",
299*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
300*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
301*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
302*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 10);
303*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
304*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
305*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
306*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
307*d9f75844SAndroid Build Coastguard Worker
308*d9f75844SAndroid Build Coastguard Worker BitrateSettings bitrate_settings;
309*d9f75844SAndroid Build Coastguard Worker bitrate_settings.min_bitrate_bps = 30000;
310*d9f75844SAndroid Build Coastguard Worker bitrate_settings.start_bitrate_bps = 30000;
311*d9f75844SAndroid Build Coastguard Worker bitrate_settings.max_bitrate_bps = 30000;
312*d9f75844SAndroid Build Coastguard Worker alice->SetBitrateSettings(bitrate_settings);
313*d9f75844SAndroid Build Coastguard Worker },
314*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
315*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
316*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
317*d9f75844SAndroid Build Coastguard Worker }
318*d9f75844SAndroid Build Coastguard Worker
319*d9f75844SAndroid Build Coastguard Worker // Link capacity below default start rate.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0)320*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0) {
321*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
322*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
323*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
324*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 150;
325*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
326*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_link_150kbps_net_delay_0_0_plr_0",
327*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
328*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
329*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
330*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
331*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
332*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
333*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
334*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
335*d9f75844SAndroid Build Coastguard Worker },
336*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
337*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
338*d9f75844SAndroid Build Coastguard Worker }
339*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_130kbps_Delay100ms_Loss1_Ulpfec)340*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Link_130kbps_Delay100ms_Loss1_Ulpfec) {
341*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
342*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
343*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
344*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 130;
345*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
346*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 1;
347*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
348*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_link_130kbps_delay100ms_loss1_ulpfec",
349*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
350*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
351*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
352*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
353*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
354*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
355*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
356*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
357*d9f75844SAndroid Build Coastguard Worker alice->SetUseUlpFEC(true);
358*d9f75844SAndroid Build Coastguard Worker },
359*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
360*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
361*d9f75844SAndroid Build Coastguard Worker }
362*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_50kbps_Delay100ms_Loss1_Ulpfec)363*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Link_50kbps_Delay100ms_Loss1_Ulpfec) {
364*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
365*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
366*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
367*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 50;
368*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
369*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 1;
370*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
371*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_link_50kbps_delay100ms_loss1_ulpfec",
372*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
373*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
374*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
375*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
376*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
377*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
378*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
379*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
380*d9f75844SAndroid Build Coastguard Worker alice->SetUseUlpFEC(true);
381*d9f75844SAndroid Build Coastguard Worker },
382*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
383*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
384*d9f75844SAndroid Build Coastguard Worker }
385*d9f75844SAndroid Build Coastguard Worker
386*d9f75844SAndroid Build Coastguard Worker // Restricted network and encoder overproducing by 30%.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_150kbps_Delay100ms_30pkts_Queue_Overshoot30)387*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest,
388*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Link_150kbps_Delay100ms_30pkts_Queue_Overshoot30) {
389*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
390*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
391*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
392*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 150;
393*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 30;
394*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
395*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
396*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30",
397*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
398*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
399*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
400*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
401*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
402*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
403*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
404*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
405*d9f75844SAndroid Build Coastguard Worker alice->SetVideoEncoderBitrateMultiplier(1.30);
406*d9f75844SAndroid Build Coastguard Worker },
407*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetVideoEncoderBitrateMultiplier(1.30); });
408*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
409*d9f75844SAndroid Build Coastguard Worker }
410*d9f75844SAndroid Build Coastguard Worker
411*d9f75844SAndroid Build Coastguard Worker // Weak 3G-style link: 250kbps, 1% loss, 100ms delay, 15 packets queue.
412*d9f75844SAndroid Build Coastguard Worker // Packet rate and loss are low enough that loss will happen with ~3s interval.
413*d9f75844SAndroid Build Coastguard Worker // This triggers protection overhead to toggle between zero and non-zero.
414*d9f75844SAndroid Build Coastguard Worker // Link queue is restrictive enough to trigger loss on probes.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1)415*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1) {
416*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
417*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
418*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
419*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 250;
420*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 10;
421*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
422*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 1;
423*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
424*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_link_250kbps_delay100ms_10pkts_loss1",
425*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
426*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
427*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
428*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
429*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
430*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
431*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
432*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
433*d9f75844SAndroid Build Coastguard Worker alice->SetVideoEncoderBitrateMultiplier(1.30);
434*d9f75844SAndroid Build Coastguard Worker },
435*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetVideoEncoderBitrateMultiplier(1.30); });
436*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
437*d9f75844SAndroid Build Coastguard Worker }
438*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Generic_Descriptor)439*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
440*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Delay_50_0_Plr_5_Generic_Descriptor) {
441*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
442*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
443*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
444*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
445*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
446*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
447*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_generic_descriptor",
448*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
449*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
450*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
451*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
452*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
453*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
454*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
455*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
456*d9f75844SAndroid Build Coastguard Worker },
457*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
458*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
459*d9f75844SAndroid Build Coastguard Worker }
460*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Ulpfec_Generic_Descriptor)461*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
462*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Delay_50_0_Plr_5_Ulpfec_Generic_Descriptor) {
463*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
464*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
465*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
466*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
467*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
468*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
469*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_ulpfec_generic_descriptor",
470*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
471*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
472*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
473*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
474*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
475*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
476*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
477*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
478*d9f75844SAndroid Build Coastguard Worker alice->SetUseUlpFEC(true);
479*d9f75844SAndroid Build Coastguard Worker },
480*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
481*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
482*d9f75844SAndroid Build Coastguard Worker }
483*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Flexfec)484*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_Flexfec) {
485*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
486*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
487*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
488*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
489*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
490*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
491*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_flexfec",
492*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
493*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
494*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
495*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
496*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
497*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
498*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
499*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
500*d9f75844SAndroid Build Coastguard Worker alice->SetUseFlexFEC(true);
501*d9f75844SAndroid Build Coastguard Worker },
502*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseFlexFEC(true); });
503*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
504*d9f75844SAndroid Build Coastguard Worker run_params.enable_flex_fec_support = true;
505*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
506*d9f75844SAndroid Build Coastguard Worker }
507*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec)508*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec) {
509*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
510*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
511*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
512*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 3;
513*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
514*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
515*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
516*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps_delay_50_0_plr_3_flexfec",
517*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
518*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
519*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
520*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
521*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
522*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
523*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
524*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
525*d9f75844SAndroid Build Coastguard Worker alice->SetUseFlexFEC(true);
526*d9f75844SAndroid Build Coastguard Worker },
527*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseFlexFEC(true); });
528*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
529*d9f75844SAndroid Build Coastguard Worker run_params.enable_flex_fec_support = true;
530*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
531*d9f75844SAndroid Build Coastguard Worker }
532*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec)533*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec) {
534*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
535*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
536*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
537*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 3;
538*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
539*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
540*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
541*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps_delay_50_0_plr_3_ulpfec",
542*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
543*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
544*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
545*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
546*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
547*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
548*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
549*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
550*d9f75844SAndroid Build Coastguard Worker alice->SetUseUlpFEC(true);
551*d9f75844SAndroid Build Coastguard Worker },
552*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
553*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
554*d9f75844SAndroid Build Coastguard Worker }
555*d9f75844SAndroid Build Coastguard Worker
556*d9f75844SAndroid Build Coastguard Worker #if defined(WEBRTC_USE_H264)
TEST(PCFullStackTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_H264)557*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_H264) {
558*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
559*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
560*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
561*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_net_delay_0_0_plr_0_H264",
562*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
563*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
564*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
565*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
566*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
567*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
568*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
569*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
570*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
571*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
572*d9f75844SAndroid Build Coastguard Worker },
573*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
574*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
575*d9f75844SAndroid Build Coastguard Worker });
576*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
577*d9f75844SAndroid Build Coastguard Worker }
578*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264)579*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264) {
580*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
581*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
582*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
583*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
584*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_H264",
585*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
586*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
587*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
588*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 10);
589*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
590*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
591*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
592*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
593*d9f75844SAndroid Build Coastguard Worker
594*d9f75844SAndroid Build Coastguard Worker BitrateSettings bitrate_settings;
595*d9f75844SAndroid Build Coastguard Worker bitrate_settings.min_bitrate_bps = 30000;
596*d9f75844SAndroid Build Coastguard Worker bitrate_settings.start_bitrate_bps = 30000;
597*d9f75844SAndroid Build Coastguard Worker bitrate_settings.max_bitrate_bps = 30000;
598*d9f75844SAndroid Build Coastguard Worker alice->SetBitrateSettings(bitrate_settings);
599*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
600*d9f75844SAndroid Build Coastguard Worker },
601*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
602*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
603*d9f75844SAndroid Build Coastguard Worker });
604*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
605*d9f75844SAndroid Build Coastguard Worker }
606*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Generic_Descriptor)607*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
608*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Generic_Descriptor) {
609*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
610*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
611*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
612*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
613*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
614*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
615*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_H264_generic_descriptor",
616*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
617*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
618*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
619*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
620*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
621*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
622*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
623*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
624*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
625*d9f75844SAndroid Build Coastguard Worker },
626*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
627*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
628*d9f75844SAndroid Build Coastguard Worker });
629*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
630*d9f75844SAndroid Build Coastguard Worker }
631*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr)632*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr) {
633*d9f75844SAndroid Build Coastguard Worker test::ScopedFieldTrials override_field_trials(
634*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-SpsPpsIdrIsH264Keyframe/Enabled/"));
635*d9f75844SAndroid Build Coastguard Worker
636*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
637*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
638*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
639*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
640*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
641*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
642*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr",
643*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
644*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
645*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
646*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
647*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
648*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
649*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
650*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
651*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
652*d9f75844SAndroid Build Coastguard Worker },
653*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
654*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
655*d9f75844SAndroid Build Coastguard Worker });
656*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
657*d9f75844SAndroid Build Coastguard Worker }
658*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec)659*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec) {
660*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
661*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
662*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
663*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
664*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
665*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
666*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_H264_flexfec",
667*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
668*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
669*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
670*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
671*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
672*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
673*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
674*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
675*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
676*d9f75844SAndroid Build Coastguard Worker alice->SetUseFlexFEC(true);
677*d9f75844SAndroid Build Coastguard Worker },
678*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
679*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
680*d9f75844SAndroid Build Coastguard Worker bob->SetUseFlexFEC(true);
681*d9f75844SAndroid Build Coastguard Worker });
682*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
683*d9f75844SAndroid Build Coastguard Worker run_params.enable_flex_fec_support = true;
684*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
685*d9f75844SAndroid Build Coastguard Worker }
686*d9f75844SAndroid Build Coastguard Worker
687*d9f75844SAndroid Build Coastguard Worker // Ulpfec with H264 is an unsupported combination, so this test is only useful
688*d9f75844SAndroid Build Coastguard Worker // for debugging. It is therefore disabled by default.
TEST(PCFullStackTest,DISABLED_Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec)689*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, DISABLED_Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec) {
690*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
691*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
692*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
693*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 5;
694*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 50;
695*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
696*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_delay_50_0_plr_5_H264_ulpfec",
697*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
698*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
699*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
700*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
701*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
702*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
703*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
704*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
705*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
706*d9f75844SAndroid Build Coastguard Worker alice->SetUseUlpFEC(true);
707*d9f75844SAndroid Build Coastguard Worker },
708*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
709*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
710*d9f75844SAndroid Build Coastguard Worker bob->SetUseUlpFEC(true);
711*d9f75844SAndroid Build Coastguard Worker });
712*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
713*d9f75844SAndroid Build Coastguard Worker }
714*d9f75844SAndroid Build Coastguard Worker #endif // defined(WEBRTC_USE_H264)
715*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps)716*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps) {
717*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
718*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
719*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
720*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 0;
721*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 0;
722*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
723*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
724*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps", *network_emulation_manager->time_controller(),
725*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
726*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
727*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
728*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
729*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
730*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
731*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
732*d9f75844SAndroid Build Coastguard Worker },
733*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
734*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
735*d9f75844SAndroid Build Coastguard Worker }
736*d9f75844SAndroid Build Coastguard Worker
TEST_P(ParameterizedPCFullStackTest,Pc_Foreman_Cif_500kbps_32pkts_Queue)737*d9f75844SAndroid Build Coastguard Worker TEST_P(ParameterizedPCFullStackTest, Pc_Foreman_Cif_500kbps_32pkts_Queue) {
738*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
739*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
740*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
741*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 32;
742*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 0;
743*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
744*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
745*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps_32pkts_queue" + GetParam().test_case_name_postfix,
746*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
747*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
748*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
749*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
750*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
751*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
752*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
753*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
754*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
755*d9f75844SAndroid Build Coastguard Worker alice->SetUseNetworkThreadAsWorkerThread();
756*d9f75844SAndroid Build Coastguard Worker }
757*d9f75844SAndroid Build Coastguard Worker },
758*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
759*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
760*d9f75844SAndroid Build Coastguard Worker bob->SetUseNetworkThreadAsWorkerThread();
761*d9f75844SAndroid Build Coastguard Worker }
762*d9f75844SAndroid Build Coastguard Worker });
763*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
764*d9f75844SAndroid Build Coastguard Worker }
765*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_100ms)766*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_100ms) {
767*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
768*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
769*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
770*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 0;
771*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
772*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
773*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
774*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps_100ms",
775*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
776*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
777*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
778*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
779*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
780*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
781*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
782*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
783*d9f75844SAndroid Build Coastguard Worker },
784*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
785*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
786*d9f75844SAndroid Build Coastguard Worker }
787*d9f75844SAndroid Build Coastguard Worker
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_500kbps_100ms_32pkts_Queue_Generic_Descriptor)788*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest,
789*d9f75844SAndroid Build Coastguard Worker Pc_Foreman_Cif_500kbps_100ms_32pkts_Queue_Generic_Descriptor) {
790*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
791*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
792*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
793*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 32;
794*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
795*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 500;
796*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
797*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_500kbps_100ms_32pkts_queue_generic_descriptor",
798*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
799*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
800*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
801*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
802*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
803*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
804*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
805*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
806*d9f75844SAndroid Build Coastguard Worker },
807*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
808*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
809*d9f75844SAndroid Build Coastguard Worker }
810*d9f75844SAndroid Build Coastguard Worker
811*d9f75844SAndroid Build Coastguard Worker /*
812*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) we need to disable send side bwe, but it isn't
813*d9f75844SAndroid Build Coastguard Worker // supported in PC level framework.
814*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
815*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
816*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging foreman_cif;
817*d9f75844SAndroid Build Coastguard Worker foreman_cif.call.send_side_bwe = false;
818*d9f75844SAndroid Build Coastguard Worker foreman_cif.video[0] = {
819*d9f75844SAndroid Build Coastguard Worker true, 352, 288, 30,
820*d9f75844SAndroid Build Coastguard Worker 30000, 500000, 2000000, false,
821*d9f75844SAndroid Build Coastguard Worker "VP8", 1, 0, 0,
822*d9f75844SAndroid Build Coastguard Worker false, false, true, ClipNameToClipPath("foreman_cif")};
823*d9f75844SAndroid Build Coastguard Worker foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe",
824*d9f75844SAndroid Build Coastguard Worker 0.0, 0.0, kTestDurationSec};
825*d9f75844SAndroid Build Coastguard Worker foreman_cif.config->queue_length_packets = 32;
826*d9f75844SAndroid Build Coastguard Worker foreman_cif.config->queue_delay_ms = 100;
827*d9f75844SAndroid Build Coastguard Worker foreman_cif.config->link_capacity_kbps = 500;
828*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(foreman_cif);
829*d9f75844SAndroid Build Coastguard Worker }
830*d9f75844SAndroid Build Coastguard Worker */
831*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Foreman_Cif_1000kbps_100ms_32pkts_Queue)832*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Foreman_Cif_1000kbps_100ms_32pkts_Queue) {
833*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
834*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
835*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
836*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 32;
837*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
838*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 1000;
839*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
840*d9f75844SAndroid Build Coastguard Worker "pc_foreman_cif_1000kbps_100ms_32pkts_queue",
841*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
842*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
843*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
844*d9f75844SAndroid Build Coastguard Worker VideoConfig video(352, 288, 30);
845*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
846*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
847*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("foreman_cif"));
848*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
849*d9f75844SAndroid Build Coastguard Worker },
850*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
851*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
852*d9f75844SAndroid Build Coastguard Worker }
853*d9f75844SAndroid Build Coastguard Worker
854*d9f75844SAndroid Build Coastguard Worker // TODO(sprang): Remove this if we have the similar ModerateLimits below?
TEST(PCFullStackTest,Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue)855*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue) {
856*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
857*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
858*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
859*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 32;
860*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
861*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 2000;
862*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
863*d9f75844SAndroid Build Coastguard Worker "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue",
864*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
865*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
866*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
867*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 50);
868*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
869*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
870*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
871*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
872*d9f75844SAndroid Build Coastguard Worker },
873*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
874*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
875*d9f75844SAndroid Build Coastguard Worker }
876*d9f75844SAndroid Build Coastguard Worker
877*d9f75844SAndroid Build Coastguard Worker /*
878*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
879*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest, ConferenceMotionHd2TLModerateLimits) {
880*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
881*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging conf_motion_hd;
882*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.send_side_bwe = true;
883*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.video[0] = {
884*d9f75844SAndroid Build Coastguard Worker true, 1280,
885*d9f75844SAndroid Build Coastguard Worker 720, 50,
886*d9f75844SAndroid Build Coastguard Worker 30000, 3000000,
887*d9f75844SAndroid Build Coastguard Worker 3000000, false,
888*d9f75844SAndroid Build Coastguard Worker "VP8", 2,
889*d9f75844SAndroid Build Coastguard Worker -1, 0,
890*d9f75844SAndroid Build Coastguard Worker false, false,
891*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
892*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.analyzer = {
893*d9f75844SAndroid Build Coastguard Worker "conference_motion_hd_2tl_moderate_limits_generic_descriptor", 0.0, 0.0,
894*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
895*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_length_packets = 50;
896*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->loss_percent = 3;
897*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_delay_ms = 100;
898*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->link_capacity_kbps = 2000;
899*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.generic_descriptor = GenericDescriptorEnabled();
900*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(conf_motion_hd);
901*d9f75844SAndroid Build Coastguard Worker }
902*d9f75844SAndroid Build Coastguard Worker
903*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
904*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimits) {
905*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
906*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging conf_motion_hd;
907*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.send_side_bwe = true;
908*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.video[0] = {
909*d9f75844SAndroid Build Coastguard Worker true, 1280,
910*d9f75844SAndroid Build Coastguard Worker 720, 50,
911*d9f75844SAndroid Build Coastguard Worker 30000, 3000000,
912*d9f75844SAndroid Build Coastguard Worker 3000000, false,
913*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
914*d9f75844SAndroid Build Coastguard Worker -1, 0,
915*d9f75844SAndroid Build Coastguard Worker false, false,
916*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
917*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0,
918*d9f75844SAndroid Build Coastguard Worker 0.0, kTestDurationSec};
919*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_length_packets = 50;
920*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->loss_percent = 3;
921*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_delay_ms = 100;
922*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->link_capacity_kbps = 2000;
923*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(conf_motion_hd);
924*d9f75844SAndroid Build Coastguard Worker }
925*d9f75844SAndroid Build Coastguard Worker
926*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
927*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ConferenceMotionHd4TLModerateLimits) {
928*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
929*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging conf_motion_hd;
930*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.send_side_bwe = true;
931*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.video[0] = {
932*d9f75844SAndroid Build Coastguard Worker true, 1280,
933*d9f75844SAndroid Build Coastguard Worker 720, 50,
934*d9f75844SAndroid Build Coastguard Worker 30000, 3000000,
935*d9f75844SAndroid Build Coastguard Worker 3000000, false,
936*d9f75844SAndroid Build Coastguard Worker "VP8", 4,
937*d9f75844SAndroid Build Coastguard Worker -1, 0,
938*d9f75844SAndroid Build Coastguard Worker false, false,
939*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
940*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0,
941*d9f75844SAndroid Build Coastguard Worker 0.0, kTestDurationSec};
942*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_length_packets = 50;
943*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->loss_percent = 3;
944*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_delay_ms = 100;
945*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->link_capacity_kbps = 2000;
946*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(conf_motion_hd);
947*d9f75844SAndroid Build Coastguard Worker }
948*d9f75844SAndroid Build Coastguard Worker
949*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
950*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) {
951*d9f75844SAndroid Build Coastguard Worker test::ScopedFieldTrials field_trial(
952*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"));
953*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
954*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging conf_motion_hd;
955*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.send_side_bwe = true;
956*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.video[0] = {
957*d9f75844SAndroid Build Coastguard Worker true, 1280,
958*d9f75844SAndroid Build Coastguard Worker 720, 50,
959*d9f75844SAndroid Build Coastguard Worker 30000, 3000000,
960*d9f75844SAndroid Build Coastguard Worker 3000000, false,
961*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
962*d9f75844SAndroid Build Coastguard Worker -1, 0,
963*d9f75844SAndroid Build Coastguard Worker false, false,
964*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
965*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.analyzer = {"conference_motion_hd_3tl_alt_moderate_limits",
966*d9f75844SAndroid Build Coastguard Worker 0.0, 0.0, kTestDurationSec};
967*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_length_packets = 50;
968*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->loss_percent = 3;
969*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_delay_ms = 100;
970*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->link_capacity_kbps = 2000;
971*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(conf_motion_hd);
972*d9f75844SAndroid Build Coastguard Worker }
973*d9f75844SAndroid Build Coastguard Worker
974*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
975*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest,
976*d9f75844SAndroid Build Coastguard Worker ConferenceMotionHd3TLModerateLimitsAltTLPatternAndBaseHeavyTLAllocation) {
977*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
978*d9f75844SAndroid Build Coastguard Worker test::ScopedFieldTrials field_trial(
979*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"
980*d9f75844SAndroid Build Coastguard Worker "WebRTC-UseBaseHeavyVP8TL3RateAllocation/Enabled/"));
981*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging conf_motion_hd;
982*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.call.send_side_bwe = true;
983*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.video[0] = {
984*d9f75844SAndroid Build Coastguard Worker true, 1280,
985*d9f75844SAndroid Build Coastguard Worker 720, 50,
986*d9f75844SAndroid Build Coastguard Worker 30000, 3000000,
987*d9f75844SAndroid Build Coastguard Worker 3000000, false,
988*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
989*d9f75844SAndroid Build Coastguard Worker -1, 0,
990*d9f75844SAndroid Build Coastguard Worker false, false,
991*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
992*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.analyzer = {
993*d9f75844SAndroid Build Coastguard Worker "conference_motion_hd_3tl_alt_heavy_moderate_limits", 0.0, 0.0,
994*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
995*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_length_packets = 50;
996*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->loss_percent = 3;
997*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->queue_delay_ms = 100;
998*d9f75844SAndroid Build Coastguard Worker conf_motion_hd.config->link_capacity_kbps = 2000;
999*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(conf_motion_hd);
1000*d9f75844SAndroid Build Coastguard Worker }
1001*d9f75844SAndroid Build Coastguard Worker */
1002*d9f75844SAndroid Build Coastguard Worker
1003*d9f75844SAndroid Build Coastguard Worker #if defined(RTC_ENABLE_VP9)
TEST_P(ParameterizedPCFullStackTest,Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9)1004*d9f75844SAndroid Build Coastguard Worker TEST_P(ParameterizedPCFullStackTest,
1005*d9f75844SAndroid Build Coastguard Worker Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9) {
1006*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1007*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1008*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
1009*d9f75844SAndroid Build Coastguard Worker config.queue_length_packets = 32;
1010*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
1011*d9f75844SAndroid Build Coastguard Worker config.link_capacity_kbps = 2000;
1012*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1013*d9f75844SAndroid Build Coastguard Worker "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9" +
1014*d9f75844SAndroid Build Coastguard Worker GetParam().test_case_name_postfix,
1015*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1016*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1017*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1018*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 50);
1019*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1020*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
1021*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1022*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1023*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
1024*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1025*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1026*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1027*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1028*d9f75844SAndroid Build Coastguard Worker alice->SetUseNetworkThreadAsWorkerThread();
1029*d9f75844SAndroid Build Coastguard Worker }
1030*d9f75844SAndroid Build Coastguard Worker },
1031*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1032*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
1033*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1034*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1035*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1036*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1037*d9f75844SAndroid Build Coastguard Worker bob->SetUseNetworkThreadAsWorkerThread();
1038*d9f75844SAndroid Build Coastguard Worker }
1039*d9f75844SAndroid Build Coastguard Worker });
1040*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1041*d9f75844SAndroid Build Coastguard Worker }
1042*d9f75844SAndroid Build Coastguard Worker #endif
1043*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Screenshare_Slides_No_Conference_Mode)1044*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Screenshare_Slides_No_Conference_Mode) {
1045*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1046*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1047*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1048*d9f75844SAndroid Build Coastguard Worker "pc_screenshare_slides_no_conference_mode",
1049*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1050*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1051*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1052*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1053*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1850, 1110, 5);
1054*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1055*d9f75844SAndroid Build Coastguard Worker video.content_hint = VideoTrackInterface::ContentHint::kText;
1056*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateScreenShareFrameGenerator(
1057*d9f75844SAndroid Build Coastguard Worker video, ScreenShareConfig(TimeDelta::Seconds(10)));
1058*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1059*d9f75844SAndroid Build Coastguard Worker },
1060*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
1061*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1062*d9f75844SAndroid Build Coastguard Worker }
1063*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Screenshare_Slides)1064*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Screenshare_Slides) {
1065*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1066*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1067*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1068*d9f75844SAndroid Build Coastguard Worker "pc_screenshare_slides", *network_emulation_manager->time_controller(),
1069*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1070*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1071*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1072*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1850, 1110, 5);
1073*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1074*d9f75844SAndroid Build Coastguard Worker video.content_hint = VideoTrackInterface::ContentHint::kText;
1075*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateScreenShareFrameGenerator(
1076*d9f75844SAndroid Build Coastguard Worker video, ScreenShareConfig(TimeDelta::Seconds(10)));
1077*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1078*d9f75844SAndroid Build Coastguard Worker },
1079*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
1080*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
1081*d9f75844SAndroid Build Coastguard Worker run_params.use_conference_mode = true;
1082*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
1083*d9f75844SAndroid Build Coastguard Worker }
1084*d9f75844SAndroid Build Coastguard Worker
1085*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1086*d9f75844SAndroid Build Coastguard Worker #if !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
TEST(PCFullStackTest,Pc_Screenshare_Slides_Simulcast_No_Conference_Mode)1087*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Screenshare_Slides_Simulcast_No_Conference_Mode) {
1088*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1089*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1090*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1091*d9f75844SAndroid Build Coastguard Worker "pc_screenshare_slides_simulcast_no_conference_mode",
1092*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1093*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1094*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1095*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1096*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1850, 1110, 30);
1097*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(2);
1098*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(1);
1099*d9f75844SAndroid Build Coastguard Worker video.temporal_layers_count = 2;
1100*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1101*d9f75844SAndroid Build Coastguard Worker video.content_hint = VideoTrackInterface::ContentHint::kText;
1102*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateScreenShareFrameGenerator(
1103*d9f75844SAndroid Build Coastguard Worker video, ScreenShareConfig(TimeDelta::Seconds(10)));
1104*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1105*d9f75844SAndroid Build Coastguard Worker },
1106*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
1107*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1108*d9f75844SAndroid Build Coastguard Worker }
1109*d9f75844SAndroid Build Coastguard Worker
TEST_P(ParameterizedPCFullStackTest,Pc_Screenshare_Slides_Simulcast)1110*d9f75844SAndroid Build Coastguard Worker TEST_P(ParameterizedPCFullStackTest, Pc_Screenshare_Slides_Simulcast) {
1111*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1112*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1113*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1114*d9f75844SAndroid Build Coastguard Worker "pc_screenshare_slides_simulcast" + GetParam().test_case_name_postfix,
1115*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1116*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1117*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1118*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1119*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1850, 1110, 30);
1120*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(2);
1121*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(1);
1122*d9f75844SAndroid Build Coastguard Worker video.temporal_layers_count = 2;
1123*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1124*d9f75844SAndroid Build Coastguard Worker video.content_hint = VideoTrackInterface::ContentHint::kText;
1125*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateScreenShareFrameGenerator(
1126*d9f75844SAndroid Build Coastguard Worker video, ScreenShareConfig(TimeDelta::Seconds(10)));
1127*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1128*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1129*d9f75844SAndroid Build Coastguard Worker alice->SetUseNetworkThreadAsWorkerThread();
1130*d9f75844SAndroid Build Coastguard Worker }
1131*d9f75844SAndroid Build Coastguard Worker },
1132*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1133*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1134*d9f75844SAndroid Build Coastguard Worker bob->SetUseNetworkThreadAsWorkerThread();
1135*d9f75844SAndroid Build Coastguard Worker }
1136*d9f75844SAndroid Build Coastguard Worker });
1137*d9f75844SAndroid Build Coastguard Worker RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
1138*d9f75844SAndroid Build Coastguard Worker run_params.use_conference_mode = true;
1139*d9f75844SAndroid Build Coastguard Worker fixture->Run(std::move(run_params));
1140*d9f75844SAndroid Build Coastguard Worker }
1141*d9f75844SAndroid Build Coastguard Worker #endif // !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
1142*d9f75844SAndroid Build Coastguard Worker
1143*d9f75844SAndroid Build Coastguard Worker /*
1144*d9f75844SAndroid Build Coastguard Worker #if !defined(WEBRTC_MAC)
1145*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1146*d9f75844SAndroid Build Coastguard Worker #if !defined(WEBRTC_WIN)
1147*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1148*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_low) {
1149*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1150*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare;
1151*d9f75844SAndroid Build Coastguard Worker screenshare.call.send_side_bwe = true;
1152*d9f75844SAndroid Build Coastguard Worker screenshare.screenshare[0] = {true, false, 10};
1153*d9f75844SAndroid Build Coastguard Worker screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
1154*d9f75844SAndroid Build Coastguard Worker 2500000, false, "VP8", 2, 1, 400000,
1155*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1156*d9f75844SAndroid Build Coastguard Worker screenshare.analyzer = {"screenshare_slides_simulcast_low", 0.0, 0.0,
1157*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1158*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::Params screenshare_params_high;
1159*d9f75844SAndroid Build Coastguard Worker screenshare_params_high.video[0] = {
1160*d9f75844SAndroid Build Coastguard Worker true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
1161*d9f75844SAndroid Build Coastguard Worker "VP8", 2, 0, 400000, false, false, false, ""};
1162*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::Params screenshare_params_low;
1163*d9f75844SAndroid Build Coastguard Worker screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
1164*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 0, 400000,
1165*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1166*d9f75844SAndroid Build Coastguard Worker
1167*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> streams = {
1168*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1169*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1170*d9f75844SAndroid Build Coastguard Worker screenshare.ss[0] = {
1171*d9f75844SAndroid Build Coastguard Worker streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1172*d9f75844SAndroid Build Coastguard Worker false};
1173*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(screenshare);
1174*d9f75844SAndroid Build Coastguard Worker }
1175*d9f75844SAndroid Build Coastguard Worker
1176*d9f75844SAndroid Build Coastguard Worker #endif // !defined(WEBRTC_WIN)
1177*d9f75844SAndroid Build Coastguard Worker #endif // !defined(WEBRTC_MAC)
1178*d9f75844SAndroid Build Coastguard Worker
1179*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1180*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
1181*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1182*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging config;
1183*d9f75844SAndroid Build Coastguard Worker config.call.send_side_bwe = true;
1184*d9f75844SAndroid Build Coastguard Worker config.video[0] = {true, 1850, 1110 / 2, 5, 50000, 200000,
1185*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 1, 400000,
1186*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1187*d9f75844SAndroid Build Coastguard Worker config.screenshare[0] = {true, false, 10, 2};
1188*d9f75844SAndroid Build Coastguard Worker config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
1189*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1190*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(config);
1191*d9f75844SAndroid Build Coastguard Worker }
1192*d9f75844SAndroid Build Coastguard Worker
1193*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1194*d9f75844SAndroid Build Coastguard Worker TEST(PCGenericDescriptorTest, Screenshare_Slides_Lossy_Net_Generic_Descriptor) {
1195*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1196*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare;
1197*d9f75844SAndroid Build Coastguard Worker screenshare.call.send_side_bwe = true;
1198*d9f75844SAndroid Build Coastguard Worker screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1199*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 1, 400000,
1200*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1201*d9f75844SAndroid Build Coastguard Worker screenshare.screenshare[0] = {true, false, 10};
1202*d9f75844SAndroid Build Coastguard Worker screenshare.analyzer = {"screenshare_slides_lossy_net_generic_descriptor",
1203*d9f75844SAndroid Build Coastguard Worker 0.0, 0.0, kTestDurationSec};
1204*d9f75844SAndroid Build Coastguard Worker screenshare.config->loss_percent = 5;
1205*d9f75844SAndroid Build Coastguard Worker screenshare.config->queue_delay_ms = 200;
1206*d9f75844SAndroid Build Coastguard Worker screenshare.config->link_capacity_kbps = 500;
1207*d9f75844SAndroid Build Coastguard Worker screenshare.call.generic_descriptor = true;
1208*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(screenshare);
1209*d9f75844SAndroid Build Coastguard Worker }
1210*d9f75844SAndroid Build Coastguard Worker
1211*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1212*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
1213*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1214*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare;
1215*d9f75844SAndroid Build Coastguard Worker screenshare.call.send_side_bwe = true;
1216*d9f75844SAndroid Build Coastguard Worker screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1217*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 1, 400000,
1218*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1219*d9f75844SAndroid Build Coastguard Worker screenshare.screenshare[0] = {true, false, 10};
1220*d9f75844SAndroid Build Coastguard Worker screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
1221*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1222*d9f75844SAndroid Build Coastguard Worker screenshare.config->loss_percent = 10;
1223*d9f75844SAndroid Build Coastguard Worker screenshare.config->queue_delay_ms = 200;
1224*d9f75844SAndroid Build Coastguard Worker screenshare.config->link_capacity_kbps = 500;
1225*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(screenshare);
1226*d9f75844SAndroid Build Coastguard Worker }
1227*d9f75844SAndroid Build Coastguard Worker
1228*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1229*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) {
1230*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1231*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare;
1232*d9f75844SAndroid Build Coastguard Worker screenshare.call.send_side_bwe = true;
1233*d9f75844SAndroid Build Coastguard Worker screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1234*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 1, 400000,
1235*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1236*d9f75844SAndroid Build Coastguard Worker screenshare.screenshare[0] = {true, false, 10};
1237*d9f75844SAndroid Build Coastguard Worker screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0,
1238*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1239*d9f75844SAndroid Build Coastguard Worker screenshare.config->loss_percent = 5;
1240*d9f75844SAndroid Build Coastguard Worker screenshare.config->link_capacity_kbps = 200;
1241*d9f75844SAndroid Build Coastguard Worker screenshare.config->queue_length_packets = 30;
1242*d9f75844SAndroid Build Coastguard Worker
1243*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(screenshare);
1244*d9f75844SAndroid Build Coastguard Worker }
1245*d9f75844SAndroid Build Coastguard Worker
1246*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1247*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted) {
1248*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1249*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare;
1250*d9f75844SAndroid Build Coastguard Worker screenshare.call.send_side_bwe = true;
1251*d9f75844SAndroid Build Coastguard Worker screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
1252*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 1, 400000,
1253*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1254*d9f75844SAndroid Build Coastguard Worker screenshare.screenshare[0] = {true, false, 10};
1255*d9f75844SAndroid Build Coastguard Worker screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0,
1256*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1257*d9f75844SAndroid Build Coastguard Worker screenshare.config->loss_percent = 1;
1258*d9f75844SAndroid Build Coastguard Worker screenshare.config->link_capacity_kbps = 1200;
1259*d9f75844SAndroid Build Coastguard Worker screenshare.config->queue_length_packets = 30;
1260*d9f75844SAndroid Build Coastguard Worker
1261*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(screenshare);
1262*d9f75844SAndroid Build Coastguard Worker }
1263*d9f75844SAndroid Build Coastguard Worker
1264*d9f75844SAndroid Build Coastguard Worker namespace {
1265*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1266*d9f75844SAndroid Build Coastguard Worker // Since ParamsWithLogging::Video is not trivially destructible, we can't
1267*d9f75844SAndroid Build Coastguard Worker // store these structs as const globals.
1268*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging::Video SvcVp9Video() {
1269*d9f75844SAndroid Build Coastguard Worker return ParamsWithLogging::Video{
1270*d9f75844SAndroid Build Coastguard Worker true, 1280,
1271*d9f75844SAndroid Build Coastguard Worker 720, 30,
1272*d9f75844SAndroid Build Coastguard Worker 800000, 2500000,
1273*d9f75844SAndroid Build Coastguard Worker 2500000, false,
1274*d9f75844SAndroid Build Coastguard Worker "VP9", 3,
1275*d9f75844SAndroid Build Coastguard Worker 2, 400000,
1276*d9f75844SAndroid Build Coastguard Worker false, false,
1277*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1278*d9f75844SAndroid Build Coastguard Worker }
1279*d9f75844SAndroid Build Coastguard Worker
1280*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging::Video SimulcastVp8VideoHigh() {
1281*d9f75844SAndroid Build Coastguard Worker return ParamsWithLogging::Video{
1282*d9f75844SAndroid Build Coastguard Worker true, 1280,
1283*d9f75844SAndroid Build Coastguard Worker 720, 30,
1284*d9f75844SAndroid Build Coastguard Worker 800000, 2500000,
1285*d9f75844SAndroid Build Coastguard Worker 2500000, false,
1286*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
1287*d9f75844SAndroid Build Coastguard Worker 2, 400000,
1288*d9f75844SAndroid Build Coastguard Worker false, false,
1289*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1290*d9f75844SAndroid Build Coastguard Worker }
1291*d9f75844SAndroid Build Coastguard Worker
1292*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging::Video SimulcastVp8VideoMedium() {
1293*d9f75844SAndroid Build Coastguard Worker return ParamsWithLogging::Video{
1294*d9f75844SAndroid Build Coastguard Worker true, 640,
1295*d9f75844SAndroid Build Coastguard Worker 360, 30,
1296*d9f75844SAndroid Build Coastguard Worker 150000, 500000,
1297*d9f75844SAndroid Build Coastguard Worker 700000, false,
1298*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
1299*d9f75844SAndroid Build Coastguard Worker 2, 400000,
1300*d9f75844SAndroid Build Coastguard Worker false, false,
1301*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1302*d9f75844SAndroid Build Coastguard Worker }
1303*d9f75844SAndroid Build Coastguard Worker
1304*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging::Video SimulcastVp8VideoLow() {
1305*d9f75844SAndroid Build Coastguard Worker return ParamsWithLogging::Video{
1306*d9f75844SAndroid Build Coastguard Worker true, 320,
1307*d9f75844SAndroid Build Coastguard Worker 180, 30,
1308*d9f75844SAndroid Build Coastguard Worker 30000, 150000,
1309*d9f75844SAndroid Build Coastguard Worker 200000, false,
1310*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
1311*d9f75844SAndroid Build Coastguard Worker 2, 400000,
1312*d9f75844SAndroid Build Coastguard Worker false, false,
1313*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1314*d9f75844SAndroid Build Coastguard Worker }
1315*d9f75844SAndroid Build Coastguard Worker } // namespace
1316*d9f75844SAndroid Build Coastguard Worker */
1317*d9f75844SAndroid Build Coastguard Worker
1318*d9f75844SAndroid Build Coastguard Worker #if defined(RTC_ENABLE_VP9)
1319*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Screenshare_Slides_Vp9_3sl_High_Fps)1320*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Screenshare_Slides_Vp9_3sl_High_Fps) {
1321*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1322*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1323*d9f75844SAndroid Build Coastguard Worker "Enabled,inter_layer_pred_mode:on/"));
1324*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1325*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1326*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1327*d9f75844SAndroid Build Coastguard Worker "pc_screenshare_slides_vp9_3sl_high_fps",
1328*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1329*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1330*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1331*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1332*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1850, 1110, 30);
1333*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1334*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1335*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(2);
1336*d9f75844SAndroid Build Coastguard Worker video.content_hint = VideoTrackInterface::ContentHint::kText;
1337*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateScreenShareFrameGenerator(
1338*d9f75844SAndroid Build Coastguard Worker video, ScreenShareConfig(TimeDelta::Seconds(10)));
1339*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1340*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
1341*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1342*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1343*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1344*d9f75844SAndroid Build Coastguard Worker },
1345*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1346*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
1347*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1348*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1349*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1350*d9f75844SAndroid Build Coastguard Worker });
1351*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1352*d9f75844SAndroid Build Coastguard Worker }
1353*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Vp9svc_3sl_High)1354*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Vp9svc_3sl_High) {
1355*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1356*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1357*d9f75844SAndroid Build Coastguard Worker "Enabled,inter_layer_pred_mode:on/"));
1358*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1359*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1360*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1361*d9f75844SAndroid Build Coastguard Worker "pc_vp9svc_3sl_high", *network_emulation_manager->time_controller(),
1362*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1363*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1364*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1365*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 30);
1366*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1367*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1368*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(2);
1369*d9f75844SAndroid Build Coastguard Worker video.temporal_layers_count = 3;
1370*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
1371*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1372*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1373*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
1374*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1375*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1376*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1377*d9f75844SAndroid Build Coastguard Worker },
1378*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1379*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
1380*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1381*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1382*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1383*d9f75844SAndroid Build Coastguard Worker });
1384*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1385*d9f75844SAndroid Build Coastguard Worker }
1386*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Vp9svc_3sl_Low)1387*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Vp9svc_3sl_Low) {
1388*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1389*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1390*d9f75844SAndroid Build Coastguard Worker "Enabled,inter_layer_pred_mode:on/"));
1391*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1392*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1393*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1394*d9f75844SAndroid Build Coastguard Worker "pc_vp9svc_3sl_low", *network_emulation_manager->time_controller(),
1395*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1396*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig()),
1397*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1398*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 30);
1399*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1400*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1401*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(0);
1402*d9f75844SAndroid Build Coastguard Worker video.temporal_layers_count = 3;
1403*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
1404*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1405*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1406*d9f75844SAndroid Build Coastguard Worker alice->SetVideoCodecs({VideoCodecConfig(
1407*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1408*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1409*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1410*d9f75844SAndroid Build Coastguard Worker },
1411*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1412*d9f75844SAndroid Build Coastguard Worker bob->SetVideoCodecs({VideoCodecConfig(
1413*d9f75844SAndroid Build Coastguard Worker /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1414*d9f75844SAndroid Build Coastguard Worker {kVP9FmtpProfileId,
1415*d9f75844SAndroid Build Coastguard Worker VP9ProfileToString(VP9Profile::kProfile0)}})});
1416*d9f75844SAndroid Build Coastguard Worker });
1417*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1418*d9f75844SAndroid Build Coastguard Worker }
1419*d9f75844SAndroid Build Coastguard Worker
1420*d9f75844SAndroid Build Coastguard Worker #endif // defined(RTC_ENABLE_VP9)
1421*d9f75844SAndroid Build Coastguard Worker
1422*d9f75844SAndroid Build Coastguard Worker /*
1423*d9f75844SAndroid Build Coastguard Worker // bugs.webrtc.org/9506
1424*d9f75844SAndroid Build Coastguard Worker #if !defined(WEBRTC_MAC)
1425*d9f75844SAndroid Build Coastguard Worker
1426*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1427*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, VP9KSVC_3SL_High) {
1428*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1429*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1430*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1431*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging simulcast;
1432*d9f75844SAndroid Build Coastguard Worker simulcast.call.send_side_bwe = true;
1433*d9f75844SAndroid Build Coastguard Worker simulcast.video[0] = SvcVp9Video();
1434*d9f75844SAndroid Build Coastguard Worker simulcast.analyzer = {"vp9ksvc_3sl_high", 0.0, 0.0, kTestDurationSec};
1435*d9f75844SAndroid Build Coastguard Worker simulcast.ss[0] = {
1436*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOnKeyPic,
1437*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1438*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(simulcast);
1439*d9f75844SAndroid Build Coastguard Worker }
1440*d9f75844SAndroid Build Coastguard Worker
1441*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1442*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, VP9KSVC_3SL_Medium) {
1443*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1444*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1445*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1446*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging simulcast;
1447*d9f75844SAndroid Build Coastguard Worker simulcast.call.send_side_bwe = true;
1448*d9f75844SAndroid Build Coastguard Worker simulcast.video[0] = SvcVp9Video();
1449*d9f75844SAndroid Build Coastguard Worker simulcast.analyzer = {"vp9ksvc_3sl_medium", 0.0, 0.0, kTestDurationSec};
1450*d9f75844SAndroid Build Coastguard Worker simulcast.ss[0] = {
1451*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream>(), 0, 3, 1, InterLayerPredMode::kOnKeyPic,
1452*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1453*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(simulcast);
1454*d9f75844SAndroid Build Coastguard Worker }
1455*d9f75844SAndroid Build Coastguard Worker
1456*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1457*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, VP9KSVC_3SL_Low) {
1458*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1459*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1460*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1461*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging simulcast;
1462*d9f75844SAndroid Build Coastguard Worker simulcast.call.send_side_bwe = true;
1463*d9f75844SAndroid Build Coastguard Worker simulcast.video[0] = SvcVp9Video();
1464*d9f75844SAndroid Build Coastguard Worker simulcast.analyzer = {"vp9ksvc_3sl_low", 0.0, 0.0, kTestDurationSec};
1465*d9f75844SAndroid Build Coastguard Worker simulcast.ss[0] = {
1466*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOnKeyPic,
1467*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1468*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(simulcast);
1469*d9f75844SAndroid Build Coastguard Worker }
1470*d9f75844SAndroid Build Coastguard Worker
1471*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1472*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted) {
1473*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1474*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1475*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1476*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging simulcast;
1477*d9f75844SAndroid Build Coastguard Worker simulcast.call.send_side_bwe = true;
1478*d9f75844SAndroid Build Coastguard Worker simulcast.video[0] = SvcVp9Video();
1479*d9f75844SAndroid Build Coastguard Worker simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted", 0.0, 0.0,
1480*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1481*d9f75844SAndroid Build Coastguard Worker simulcast.ss[0] = {
1482*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
1483*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1484*d9f75844SAndroid Build Coastguard Worker simulcast.config->link_capacity_kbps = 1000;
1485*d9f75844SAndroid Build Coastguard Worker simulcast.config->queue_delay_ms = 100;
1486*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(simulcast);
1487*d9f75844SAndroid Build Coastguard Worker }
1488*d9f75844SAndroid Build Coastguard Worker
1489*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1490*d9f75844SAndroid Build Coastguard Worker // TODO(webrtc:9722): Remove when experiment is cleaned up.
1491*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted_Trusted_Rate) {
1492*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(
1493*d9f75844SAndroid Build Coastguard Worker AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1494*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1495*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging simulcast;
1496*d9f75844SAndroid Build Coastguard Worker simulcast.call.send_side_bwe = true;
1497*d9f75844SAndroid Build Coastguard Worker simulcast.video[0] = SvcVp9Video();
1498*d9f75844SAndroid Build Coastguard Worker simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted_trusted_rate",
1499*d9f75844SAndroid Build Coastguard Worker 0.0, 0.0, kTestDurationSec};
1500*d9f75844SAndroid Build Coastguard Worker simulcast.ss[0] = {
1501*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
1502*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1503*d9f75844SAndroid Build Coastguard Worker simulcast.config->link_capacity_kbps = 1000;
1504*d9f75844SAndroid Build Coastguard Worker simulcast.config->queue_delay_ms = 100;
1505*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(simulcast);
1506*d9f75844SAndroid Build Coastguard Worker }
1507*d9f75844SAndroid Build Coastguard Worker #endif // !defined(WEBRTC_MAC)
1508*d9f75844SAndroid Build Coastguard Worker
1509*d9f75844SAndroid Build Coastguard Worker #endif // defined(RTC_ENABLE_VP9)
1510*d9f75844SAndroid Build Coastguard Worker */
1511*d9f75844SAndroid Build Coastguard Worker
1512*d9f75844SAndroid Build Coastguard Worker // Android bots can't handle FullHD, so disable the test.
1513*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/9220): Investigate source of flakiness on Mac.
1514*d9f75844SAndroid Build Coastguard Worker #if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
1515*d9f75844SAndroid Build Coastguard Worker #define MAYBE_Pc_Simulcast_HD_High DISABLED_Pc_Simulcast_HD_High
1516*d9f75844SAndroid Build Coastguard Worker #else
1517*d9f75844SAndroid Build Coastguard Worker #define MAYBE_Pc_Simulcast_HD_High Pc_Simulcast_HD_High
1518*d9f75844SAndroid Build Coastguard Worker #endif
TEST(PCFullStackTest,MAYBE_Pc_Simulcast_HD_High)1519*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, MAYBE_Pc_Simulcast_HD_High) {
1520*d9f75844SAndroid Build Coastguard Worker webrtc::test::ScopedFieldTrials override_trials(AppendFieldTrials(
1521*d9f75844SAndroid Build Coastguard Worker "WebRTC-ForceSimulatedOveruseIntervalMs/1000-50000-300/"));
1522*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1523*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1524*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
1525*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 0;
1526*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
1527*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1528*d9f75844SAndroid Build Coastguard Worker "pc_simulcast_HD_high", *network_emulation_manager->time_controller(),
1529*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1530*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1531*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1920, 1080, 30);
1532*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1533*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(2);
1534*d9f75844SAndroid Build Coastguard Worker video.temporal_layers_count = 3;
1535*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1536*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video));
1537*d9f75844SAndroid Build Coastguard Worker },
1538*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
1539*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1540*d9f75844SAndroid Build Coastguard Worker }
1541*d9f75844SAndroid Build Coastguard Worker
TEST_P(ParameterizedPCFullStackTest,Pc_Simulcast_Vp8_3sl_High)1542*d9f75844SAndroid Build Coastguard Worker TEST_P(ParameterizedPCFullStackTest, Pc_Simulcast_Vp8_3sl_High) {
1543*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1544*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1545*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
1546*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 0;
1547*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
1548*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1549*d9f75844SAndroid Build Coastguard Worker "pc_simulcast_vp8_3sl_high" + GetParam().test_case_name_postfix,
1550*d9f75844SAndroid Build Coastguard Worker *network_emulation_manager->time_controller(),
1551*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1552*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1553*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 30);
1554*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1555*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(2);
1556*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1557*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
1558*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1559*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1560*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1561*d9f75844SAndroid Build Coastguard Worker alice->SetUseNetworkThreadAsWorkerThread();
1562*d9f75844SAndroid Build Coastguard Worker }
1563*d9f75844SAndroid Build Coastguard Worker },
1564*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {
1565*d9f75844SAndroid Build Coastguard Worker if (GetParam().use_network_thread_as_worker_thread) {
1566*d9f75844SAndroid Build Coastguard Worker bob->SetUseNetworkThreadAsWorkerThread();
1567*d9f75844SAndroid Build Coastguard Worker }
1568*d9f75844SAndroid Build Coastguard Worker });
1569*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1570*d9f75844SAndroid Build Coastguard Worker }
1571*d9f75844SAndroid Build Coastguard Worker
TEST(PCFullStackTest,Pc_Simulcast_Vp8_3sl_Low)1572*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, Pc_Simulcast_Vp8_3sl_Low) {
1573*d9f75844SAndroid Build Coastguard Worker std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1574*d9f75844SAndroid Build Coastguard Worker CreateNetworkEmulationManager();
1575*d9f75844SAndroid Build Coastguard Worker BuiltInNetworkBehaviorConfig config;
1576*d9f75844SAndroid Build Coastguard Worker config.loss_percent = 0;
1577*d9f75844SAndroid Build Coastguard Worker config.queue_delay_ms = 100;
1578*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateTestFixture(
1579*d9f75844SAndroid Build Coastguard Worker "pc_simulcast_vp8_3sl_low", *network_emulation_manager->time_controller(),
1580*d9f75844SAndroid Build Coastguard Worker network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1581*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* alice) {
1582*d9f75844SAndroid Build Coastguard Worker VideoConfig video(1280, 720, 30);
1583*d9f75844SAndroid Build Coastguard Worker video.simulcast_config = VideoSimulcastConfig(3);
1584*d9f75844SAndroid Build Coastguard Worker video.emulated_sfu_config = EmulatedSFUConfig(0);
1585*d9f75844SAndroid Build Coastguard Worker video.stream_label = "alice-video";
1586*d9f75844SAndroid Build Coastguard Worker auto frame_generator = CreateFromYuvFileFrameGenerator(
1587*d9f75844SAndroid Build Coastguard Worker video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1588*d9f75844SAndroid Build Coastguard Worker alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1589*d9f75844SAndroid Build Coastguard Worker },
1590*d9f75844SAndroid Build Coastguard Worker [](PeerConfigurer* bob) {});
1591*d9f75844SAndroid Build Coastguard Worker fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1592*d9f75844SAndroid Build Coastguard Worker }
1593*d9f75844SAndroid Build Coastguard Worker
1594*d9f75844SAndroid Build Coastguard Worker /*
1595*d9f75844SAndroid Build Coastguard Worker // This test assumes ideal network conditions with target bandwidth being
1596*d9f75844SAndroid Build Coastguard Worker // available and exercises WebRTC calls with a high target bitrate(100 Mbps).
1597*d9f75844SAndroid Build Coastguard Worker // Android32 bots can't handle this high bitrate, so disable test for those.
1598*d9f75844SAndroid Build Coastguard Worker #if defined(WEBRTC_ANDROID)
1599*d9f75844SAndroid Build Coastguard Worker #define MAYBE_HighBitrateWithFakeCodec DISABLED_HighBitrateWithFakeCodec
1600*d9f75844SAndroid Build Coastguard Worker #else
1601*d9f75844SAndroid Build Coastguard Worker #define MAYBE_HighBitrateWithFakeCodec HighBitrateWithFakeCodec
1602*d9f75844SAndroid Build Coastguard Worker #endif // defined(WEBRTC_ANDROID)
1603*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) Disabled because target bitrate can't be
1604*d9f75844SAndroid Build Coastguard Worker configured yet. TEST(PCFullStackTest, MAYBE_HighBitrateWithFakeCodec) { auto
1605*d9f75844SAndroid Build Coastguard Worker fixture = CreateVideoQualityTestFixture(); const int target_bitrate = 100000000;
1606*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging generator;
1607*d9f75844SAndroid Build Coastguard Worker generator.call.send_side_bwe = true;
1608*d9f75844SAndroid Build Coastguard Worker generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate;
1609*d9f75844SAndroid Build Coastguard Worker generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate;
1610*d9f75844SAndroid Build Coastguard Worker generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate;
1611*d9f75844SAndroid Build Coastguard Worker generator.video[0] = {true,
1612*d9f75844SAndroid Build Coastguard Worker 360,
1613*d9f75844SAndroid Build Coastguard Worker 240,
1614*d9f75844SAndroid Build Coastguard Worker 30,
1615*d9f75844SAndroid Build Coastguard Worker target_bitrate / 2,
1616*d9f75844SAndroid Build Coastguard Worker target_bitrate,
1617*d9f75844SAndroid Build Coastguard Worker target_bitrate * 2,
1618*d9f75844SAndroid Build Coastguard Worker false,
1619*d9f75844SAndroid Build Coastguard Worker "FakeCodec",
1620*d9f75844SAndroid Build Coastguard Worker 1,
1621*d9f75844SAndroid Build Coastguard Worker 0,
1622*d9f75844SAndroid Build Coastguard Worker 0,
1623*d9f75844SAndroid Build Coastguard Worker false,
1624*d9f75844SAndroid Build Coastguard Worker false,
1625*d9f75844SAndroid Build Coastguard Worker false,
1626*d9f75844SAndroid Build Coastguard Worker "Generator"};
1627*d9f75844SAndroid Build Coastguard Worker generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0,
1628*d9f75844SAndroid Build Coastguard Worker kTestDurationSec};
1629*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(generator);
1630*d9f75844SAndroid Build Coastguard Worker }
1631*d9f75844SAndroid Build Coastguard Worker
1632*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1633*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, LargeRoomVP8_5thumb) {
1634*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1635*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging large_room;
1636*d9f75844SAndroid Build Coastguard Worker large_room.call.send_side_bwe = true;
1637*d9f75844SAndroid Build Coastguard Worker large_room.video[0] = SimulcastVp8VideoHigh();
1638*d9f75844SAndroid Build Coastguard Worker large_room.analyzer = {"largeroom_5thumb", 0.0, 0.0, kTestDurationSec};
1639*d9f75844SAndroid Build Coastguard Worker large_room.config->loss_percent = 0;
1640*d9f75844SAndroid Build Coastguard Worker large_room.config->queue_delay_ms = 100;
1641*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_high;
1642*d9f75844SAndroid Build Coastguard Worker video_params_high.video[0] = SimulcastVp8VideoHigh();
1643*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_medium;
1644*d9f75844SAndroid Build Coastguard Worker video_params_medium.video[0] = SimulcastVp8VideoMedium();
1645*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_low;
1646*d9f75844SAndroid Build Coastguard Worker video_params_low.video[0] = SimulcastVp8VideoLow();
1647*d9f75844SAndroid Build Coastguard Worker
1648*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> streams = {
1649*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1650*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1651*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1652*d9f75844SAndroid Build Coastguard Worker large_room.call.num_thumbnails = 5;
1653*d9f75844SAndroid Build Coastguard Worker large_room.ss[0] = {
1654*d9f75844SAndroid Build Coastguard Worker streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1655*d9f75844SAndroid Build Coastguard Worker false};
1656*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(large_room);
1657*d9f75844SAndroid Build Coastguard Worker }
1658*d9f75844SAndroid Build Coastguard Worker
1659*d9f75844SAndroid Build Coastguard Worker #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
1660*d9f75844SAndroid Build Coastguard Worker // Fails on mobile devices:
1661*d9f75844SAndroid Build Coastguard Worker // https://bugs.chromium.org/p/webrtc/issues/detail?id=7301
1662*d9f75844SAndroid Build Coastguard Worker #define MAYBE_LargeRoomVP8_50thumb DISABLED_LargeRoomVP8_50thumb
1663*d9f75844SAndroid Build Coastguard Worker #define MAYBE_LargeRoomVP8_15thumb DISABLED_LargeRoomVP8_15thumb
1664*d9f75844SAndroid Build Coastguard Worker #else
1665*d9f75844SAndroid Build Coastguard Worker #define MAYBE_LargeRoomVP8_50thumb LargeRoomVP8_50thumb
1666*d9f75844SAndroid Build Coastguard Worker #define MAYBE_LargeRoomVP8_15thumb LargeRoomVP8_15thumb
1667*d9f75844SAndroid Build Coastguard Worker #endif
1668*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1669*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, MAYBE_LargeRoomVP8_15thumb) {
1670*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1671*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging large_room;
1672*d9f75844SAndroid Build Coastguard Worker large_room.call.send_side_bwe = true;
1673*d9f75844SAndroid Build Coastguard Worker large_room.video[0] = SimulcastVp8VideoHigh();
1674*d9f75844SAndroid Build Coastguard Worker large_room.analyzer = {"largeroom_15thumb", 0.0, 0.0, kTestDurationSec};
1675*d9f75844SAndroid Build Coastguard Worker large_room.config->loss_percent = 0;
1676*d9f75844SAndroid Build Coastguard Worker large_room.config->queue_delay_ms = 100;
1677*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_high;
1678*d9f75844SAndroid Build Coastguard Worker video_params_high.video[0] = SimulcastVp8VideoHigh();
1679*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_medium;
1680*d9f75844SAndroid Build Coastguard Worker video_params_medium.video[0] = SimulcastVp8VideoMedium();
1681*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_low;
1682*d9f75844SAndroid Build Coastguard Worker video_params_low.video[0] = SimulcastVp8VideoLow();
1683*d9f75844SAndroid Build Coastguard Worker
1684*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> streams = {
1685*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1686*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1687*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1688*d9f75844SAndroid Build Coastguard Worker large_room.call.num_thumbnails = 15;
1689*d9f75844SAndroid Build Coastguard Worker large_room.ss[0] = {
1690*d9f75844SAndroid Build Coastguard Worker streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1691*d9f75844SAndroid Build Coastguard Worker false};
1692*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(large_room);
1693*d9f75844SAndroid Build Coastguard Worker }
1694*d9f75844SAndroid Build Coastguard Worker
1695*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1696*d9f75844SAndroid Build Coastguard Worker TEST(PCFullStackTest, MAYBE_LargeRoomVP8_50thumb) {
1697*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1698*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging large_room;
1699*d9f75844SAndroid Build Coastguard Worker large_room.call.send_side_bwe = true;
1700*d9f75844SAndroid Build Coastguard Worker large_room.video[0] = SimulcastVp8VideoHigh();
1701*d9f75844SAndroid Build Coastguard Worker large_room.analyzer = {"largeroom_50thumb", 0.0, 0.0, kTestDurationSec};
1702*d9f75844SAndroid Build Coastguard Worker large_room.config->loss_percent = 0;
1703*d9f75844SAndroid Build Coastguard Worker large_room.config->queue_delay_ms = 100;
1704*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_high;
1705*d9f75844SAndroid Build Coastguard Worker video_params_high.video[0] = SimulcastVp8VideoHigh();
1706*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_medium;
1707*d9f75844SAndroid Build Coastguard Worker video_params_medium.video[0] = SimulcastVp8VideoMedium();
1708*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_low;
1709*d9f75844SAndroid Build Coastguard Worker video_params_low.video[0] = SimulcastVp8VideoLow();
1710*d9f75844SAndroid Build Coastguard Worker
1711*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> streams = {
1712*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1713*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1714*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1715*d9f75844SAndroid Build Coastguard Worker large_room.call.num_thumbnails = 50;
1716*d9f75844SAndroid Build Coastguard Worker large_room.ss[0] = {
1717*d9f75844SAndroid Build Coastguard Worker streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1718*d9f75844SAndroid Build Coastguard Worker false};
1719*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(large_room);
1720*d9f75844SAndroid Build Coastguard Worker }
1721*d9f75844SAndroid Build Coastguard Worker */
1722*d9f75844SAndroid Build Coastguard Worker
1723*d9f75844SAndroid Build Coastguard Worker /*
1724*d9f75844SAndroid Build Coastguard Worker class PCDualStreamsTest : public ::testing::TestWithParam<int> {};
1725*d9f75844SAndroid Build Coastguard Worker
1726*d9f75844SAndroid Build Coastguard Worker // Disable dual video test on mobile device becuase it's too heavy.
1727*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on MAC.
1728*d9f75844SAndroid Build Coastguard Worker #if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC)
1729*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1730*d9f75844SAndroid Build Coastguard Worker TEST_P(PCDualStreamsTest,
1731*d9f75844SAndroid Build Coastguard Worker ModeratelyRestricted_SlidesVp8_2TL_Simulcast_Video_Simulcast_High) {
1732*d9f75844SAndroid Build Coastguard Worker const int first_stream = GetParam();
1733*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging dual_streams;
1734*d9f75844SAndroid Build Coastguard Worker
1735*d9f75844SAndroid Build Coastguard Worker // Screenshare Settings.
1736*d9f75844SAndroid Build Coastguard Worker dual_streams.screenshare[first_stream] = {true, false, 10};
1737*d9f75844SAndroid Build Coastguard Worker dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
1738*d9f75844SAndroid Build Coastguard Worker 2500000, false, "VP8", 2, 1, 400000,
1739*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1740*d9f75844SAndroid Build Coastguard Worker
1741*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging screenshare_params_high;
1742*d9f75844SAndroid Build Coastguard Worker screenshare_params_high.video[0] = {
1743*d9f75844SAndroid Build Coastguard Worker true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
1744*d9f75844SAndroid Build Coastguard Worker "VP8", 2, 0, 400000, false, false, false, ""};
1745*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::Params screenshare_params_low;
1746*d9f75844SAndroid Build Coastguard Worker screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
1747*d9f75844SAndroid Build Coastguard Worker 1000000, false, "VP8", 2, 0, 400000,
1748*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1749*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> screenhsare_streams = {
1750*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1751*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1752*d9f75844SAndroid Build Coastguard Worker
1753*d9f75844SAndroid Build Coastguard Worker dual_streams.ss[first_stream] = {
1754*d9f75844SAndroid Build Coastguard Worker screenhsare_streams, 1, 1, 0, InterLayerPredMode::kOn,
1755*d9f75844SAndroid Build Coastguard Worker std::vector<SpatialLayer>(), false};
1756*d9f75844SAndroid Build Coastguard Worker
1757*d9f75844SAndroid Build Coastguard Worker // Video settings.
1758*d9f75844SAndroid Build Coastguard Worker dual_streams.video[1 - first_stream] = SimulcastVp8VideoHigh();
1759*d9f75844SAndroid Build Coastguard Worker
1760*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_high;
1761*d9f75844SAndroid Build Coastguard Worker video_params_high.video[0] = SimulcastVp8VideoHigh();
1762*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_medium;
1763*d9f75844SAndroid Build Coastguard Worker video_params_medium.video[0] = SimulcastVp8VideoMedium();
1764*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging video_params_low;
1765*d9f75844SAndroid Build Coastguard Worker video_params_low.video[0] = SimulcastVp8VideoLow();
1766*d9f75844SAndroid Build Coastguard Worker std::vector<VideoStream> streams = {
1767*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1768*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1769*d9f75844SAndroid Build Coastguard Worker VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1770*d9f75844SAndroid Build Coastguard Worker
1771*d9f75844SAndroid Build Coastguard Worker dual_streams.ss[1 - first_stream] = {
1772*d9f75844SAndroid Build Coastguard Worker streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1773*d9f75844SAndroid Build Coastguard Worker false};
1774*d9f75844SAndroid Build Coastguard Worker
1775*d9f75844SAndroid Build Coastguard Worker // Call settings.
1776*d9f75844SAndroid Build Coastguard Worker dual_streams.call.send_side_bwe = true;
1777*d9f75844SAndroid Build Coastguard Worker dual_streams.call.dual_video = true;
1778*d9f75844SAndroid Build Coastguard Worker std::string test_label = "dualstreams_moderately_restricted_screenshare_" +
1779*d9f75844SAndroid Build Coastguard Worker std::to_string(first_stream);
1780*d9f75844SAndroid Build Coastguard Worker dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1781*d9f75844SAndroid Build Coastguard Worker dual_streams.config->loss_percent = 1;
1782*d9f75844SAndroid Build Coastguard Worker dual_streams.config->link_capacity_kbps = 7500;
1783*d9f75844SAndroid Build Coastguard Worker dual_streams.config->queue_length_packets = 30;
1784*d9f75844SAndroid Build Coastguard Worker dual_streams.config->queue_delay_ms = 100;
1785*d9f75844SAndroid Build Coastguard Worker
1786*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1787*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(dual_streams);
1788*d9f75844SAndroid Build Coastguard Worker }
1789*d9f75844SAndroid Build Coastguard Worker #endif // !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) &&
1790*d9f75844SAndroid Build Coastguard Worker // !defined(WEBRTC_MAC)
1791*d9f75844SAndroid Build Coastguard Worker
1792*d9f75844SAndroid Build Coastguard Worker // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1793*d9f75844SAndroid Build Coastguard Worker TEST_P(PCDualStreamsTest, Conference_Restricted) {
1794*d9f75844SAndroid Build Coastguard Worker const int first_stream = GetParam();
1795*d9f75844SAndroid Build Coastguard Worker ParamsWithLogging dual_streams;
1796*d9f75844SAndroid Build Coastguard Worker
1797*d9f75844SAndroid Build Coastguard Worker // Screenshare Settings.
1798*d9f75844SAndroid Build Coastguard Worker dual_streams.screenshare[first_stream] = {true, false, 10};
1799*d9f75844SAndroid Build Coastguard Worker dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
1800*d9f75844SAndroid Build Coastguard Worker 2500000, false, "VP8", 3, 2, 400000,
1801*d9f75844SAndroid Build Coastguard Worker false, false, false, ""};
1802*d9f75844SAndroid Build Coastguard Worker // Video settings.
1803*d9f75844SAndroid Build Coastguard Worker dual_streams.video[1 - first_stream] = {
1804*d9f75844SAndroid Build Coastguard Worker true, 1280,
1805*d9f75844SAndroid Build Coastguard Worker 720, 30,
1806*d9f75844SAndroid Build Coastguard Worker 150000, 500000,
1807*d9f75844SAndroid Build Coastguard Worker 700000, false,
1808*d9f75844SAndroid Build Coastguard Worker "VP8", 3,
1809*d9f75844SAndroid Build Coastguard Worker 2, 400000,
1810*d9f75844SAndroid Build Coastguard Worker false, false,
1811*d9f75844SAndroid Build Coastguard Worker false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1812*d9f75844SAndroid Build Coastguard Worker
1813*d9f75844SAndroid Build Coastguard Worker // Call settings.
1814*d9f75844SAndroid Build Coastguard Worker dual_streams.call.send_side_bwe = true;
1815*d9f75844SAndroid Build Coastguard Worker dual_streams.call.dual_video = true;
1816*d9f75844SAndroid Build Coastguard Worker std::string test_label = "dualstreams_conference_restricted_screenshare_" +
1817*d9f75844SAndroid Build Coastguard Worker std::to_string(first_stream);
1818*d9f75844SAndroid Build Coastguard Worker dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1819*d9f75844SAndroid Build Coastguard Worker dual_streams.config->loss_percent = 1;
1820*d9f75844SAndroid Build Coastguard Worker dual_streams.config->link_capacity_kbps = 5000;
1821*d9f75844SAndroid Build Coastguard Worker dual_streams.config->queue_length_packets = 30;
1822*d9f75844SAndroid Build Coastguard Worker dual_streams.config->queue_delay_ms = 100;
1823*d9f75844SAndroid Build Coastguard Worker
1824*d9f75844SAndroid Build Coastguard Worker auto fixture = CreateVideoQualityTestFixture();
1825*d9f75844SAndroid Build Coastguard Worker fixture->RunWithAnalyzer(dual_streams);
1826*d9f75844SAndroid Build Coastguard Worker }
1827*d9f75844SAndroid Build Coastguard Worker
1828*d9f75844SAndroid Build Coastguard Worker INSTANTIATE_TEST_SUITE_P(PCFullStackTest,
1829*d9f75844SAndroid Build Coastguard Worker PCDualStreamsTest,
1830*d9f75844SAndroid Build Coastguard Worker ::testing::Values(0, 1));
1831*d9f75844SAndroid Build Coastguard Worker */
1832*d9f75844SAndroid Build Coastguard Worker
1833*d9f75844SAndroid Build Coastguard Worker } // namespace webrtc
1834