You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1976 lines
80 KiB

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