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.

1561 lines
62 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 "absl/flags/flag.h"
  15. #include "absl/flags/parse.h"
  16. #include "absl/types/optional.h"
  17. #include "api/test/simulated_network.h"
  18. #include "api/test/test_dependency_factory.h"
  19. #include "api/test/video_quality_test_fixture.h"
  20. #include "api/video_codecs/sdp_video_format.h"
  21. #include "api/video_codecs/video_codec.h"
  22. #include "api/video_codecs/video_encoder_config.h"
  23. #include "media/base/vp9_profile.h"
  24. #include "modules/video_coding/codecs/vp9/include/vp9.h"
  25. #include "system_wrappers/include/field_trial.h"
  26. #include "test/field_trial.h"
  27. #include "test/gtest.h"
  28. #include "test/testsupport/file_utils.h"
  29. #include "video/video_quality_test.h"
  30. ABSL_FLAG(std::string,
  31. rtc_event_log_name,
  32. "",
  33. "Filename for rtc event log. Two files "
  34. "with \"_send\" and \"_recv\" suffixes will be created.");
  35. ABSL_FLAG(std::string,
  36. rtp_dump_name,
  37. "",
  38. "Filename for dumped received RTP stream.");
  39. ABSL_FLAG(std::string,
  40. encoded_frame_path,
  41. "",
  42. "The base path for encoded frame logs. Created files will have "
  43. "the form <encoded_frame_path>.<n>.(recv|send.<m>).ivf");
  44. namespace webrtc {
  45. namespace {
  46. static const int kFullStackTestDurationSecs = 45;
  47. const char kVp8TrustedRateControllerFieldTrial[] =
  48. "WebRTC-LibvpxVp8TrustedRateController/Enabled/";
  49. struct ParamsWithLogging : public VideoQualityTest::Params {
  50. public:
  51. ParamsWithLogging() {
  52. // Use these logging flags by default, for everything.
  53. logging = {absl::GetFlag(FLAGS_rtc_event_log_name),
  54. absl::GetFlag(FLAGS_rtp_dump_name),
  55. absl::GetFlag(FLAGS_encoded_frame_path)};
  56. this->config = BuiltInNetworkBehaviorConfig();
  57. }
  58. };
  59. std::unique_ptr<VideoQualityTestFixtureInterface>
  60. CreateVideoQualityTestFixture() {
  61. // The components will normally be nullptr (= use defaults), but it's possible
  62. // for external test runners to override the list of injected components.
  63. auto components = TestDependencyFactory::GetInstance().CreateComponents();
  64. return std::make_unique<VideoQualityTest>(std::move(components));
  65. }
  66. // Takes the current active field trials set, and appends some new trials.
  67. std::string AppendFieldTrials(std::string new_trial_string) {
  68. return std::string(field_trial::GetFieldTrialString()) + new_trial_string;
  69. }
  70. std::string ClipNameToClipPath(const char* clip_name) {
  71. return test::ResourcePath(clip_name, "yuv");
  72. }
  73. } // namespace
  74. // VideoQualityTest::Params params = {
  75. // { ... }, // Common.
  76. // { ... }, // Video-specific settings.
  77. // { ... }, // Screenshare-specific settings.
  78. // { ... }, // Analyzer settings.
  79. // pipe, // FakeNetworkPipe::Config
  80. // { ... }, // Spatial scalability.
  81. // logs // bool
  82. // };
  83. class GenericDescriptorTest : public ::testing::TestWithParam<std::string> {
  84. public:
  85. GenericDescriptorTest()
  86. : field_trial_(AppendFieldTrials(GetParam())),
  87. generic_descriptor_enabled_(
  88. field_trial::IsEnabled("WebRTC-GenericDescriptor")) {}
  89. std::string GetTestName(std::string base) {
  90. if (generic_descriptor_enabled_)
  91. base += "_generic_descriptor";
  92. return base;
  93. }
  94. bool GenericDescriptorEnabled() const { return generic_descriptor_enabled_; }
  95. private:
  96. test::ScopedFieldTrials field_trial_;
  97. bool generic_descriptor_enabled_;
  98. };
  99. #if defined(RTC_ENABLE_VP9)
  100. TEST(FullStackTest, ForemanCifWithoutPacketLossVp9) {
  101. auto fixture = CreateVideoQualityTestFixture();
  102. ParamsWithLogging foreman_cif;
  103. foreman_cif.call.send_side_bwe = true;
  104. foreman_cif.video[0] = {
  105. true, 352, 288, 30,
  106. 700000, 700000, 700000, false,
  107. "VP9", 1, 0, 0,
  108. false, false, true, ClipNameToClipPath("foreman_cif")};
  109. foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_VP9", 0.0, 0.0,
  110. kFullStackTestDurationSecs};
  111. fixture->RunWithAnalyzer(foreman_cif);
  112. }
  113. TEST_P(GenericDescriptorTest, ForemanCifPlr5Vp9) {
  114. auto fixture = CreateVideoQualityTestFixture();
  115. ParamsWithLogging foreman_cif;
  116. foreman_cif.call.send_side_bwe = true;
  117. foreman_cif.video[0] = {
  118. true, 352, 288, 30,
  119. 30000, 500000, 2000000, false,
  120. "VP9", 1, 0, 0,
  121. false, false, true, ClipNameToClipPath("foreman_cif")};
  122. foreman_cif.analyzer = {GetTestName("foreman_cif_delay_50_0_plr_5_VP9"), 0.0,
  123. 0.0, kFullStackTestDurationSecs};
  124. foreman_cif.config->loss_percent = 5;
  125. foreman_cif.config->queue_delay_ms = 50;
  126. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  127. fixture->RunWithAnalyzer(foreman_cif);
  128. }
  129. TEST(FullStackTest, GeneratorWithoutPacketLossVp9Profile2) {
  130. // Profile 2 might not be available on some platforms until
  131. // https://bugs.chromium.org/p/webm/issues/detail?id=1544 is solved.
  132. bool profile_2_is_supported = false;
  133. for (const auto& codec : SupportedVP9Codecs()) {
  134. if (ParseSdpForVP9Profile(codec.parameters)
  135. .value_or(VP9Profile::kProfile0) == VP9Profile::kProfile2) {
  136. profile_2_is_supported = true;
  137. }
  138. }
  139. if (!profile_2_is_supported)
  140. return;
  141. auto fixture = CreateVideoQualityTestFixture();
  142. SdpVideoFormat::Parameters vp92 = {
  143. {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}};
  144. ParamsWithLogging generator;
  145. generator.call.send_side_bwe = true;
  146. generator.video[0] = {
  147. true, 352, 288, 30, 700000, 700000, 700000, false, "VP9",
  148. 1, 0, 0, false, false, true, "GeneratorI010", 0, vp92};
  149. generator.analyzer = {"generator_net_delay_0_0_plr_0_VP9Profile2", 0.0, 0.0,
  150. kFullStackTestDurationSecs};
  151. fixture->RunWithAnalyzer(generator);
  152. }
  153. TEST(FullStackTest, ForemanCifWithoutPacketLossMultiplexI420Frame) {
  154. auto fixture = CreateVideoQualityTestFixture();
  155. ParamsWithLogging foreman_cif;
  156. foreman_cif.call.send_side_bwe = true;
  157. foreman_cif.video[0] = {
  158. true, 352, 288, 30,
  159. 700000, 700000, 700000, false,
  160. "multiplex", 1, 0, 0,
  161. false, false, false, ClipNameToClipPath("foreman_cif")};
  162. foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
  163. kFullStackTestDurationSecs};
  164. fixture->RunWithAnalyzer(foreman_cif);
  165. }
  166. TEST(FullStackTest, GeneratorWithoutPacketLossMultiplexI420AFrame) {
  167. auto fixture = CreateVideoQualityTestFixture();
  168. ParamsWithLogging generator;
  169. generator.call.send_side_bwe = true;
  170. generator.video[0] = {
  171. true, 352, 288, 30, 700000, 700000, 700000, false,
  172. "multiplex", 1, 0, 0, false, false, false, "GeneratorI420A"};
  173. generator.analyzer = {"generator_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
  174. kFullStackTestDurationSecs};
  175. fixture->RunWithAnalyzer(generator);
  176. }
  177. #endif // defined(RTC_ENABLE_VP9)
  178. #if defined(WEBRTC_LINUX)
  179. // Crashes on the linux trusty perf bot: bugs.webrtc.org/9129.
  180. #define MAYBE_ParisQcifWithoutPacketLoss DISABLED_ParisQcifWithoutPacketLoss
  181. #else
  182. #define MAYBE_ParisQcifWithoutPacketLoss ParisQcifWithoutPacketLoss
  183. #endif
  184. TEST(FullStackTest, MAYBE_ParisQcifWithoutPacketLoss) {
  185. auto fixture = CreateVideoQualityTestFixture();
  186. ParamsWithLogging paris_qcif;
  187. paris_qcif.call.send_side_bwe = true;
  188. paris_qcif.video[0] = {
  189. true, 176, 144, 30,
  190. 300000, 300000, 300000, false,
  191. "VP8", 1, 0, 0,
  192. false, false, true, ClipNameToClipPath("paris_qcif")};
  193. paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96,
  194. kFullStackTestDurationSecs};
  195. fixture->RunWithAnalyzer(paris_qcif);
  196. }
  197. TEST_P(GenericDescriptorTest, ForemanCifWithoutPacketLoss) {
  198. auto fixture = CreateVideoQualityTestFixture();
  199. // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
  200. ParamsWithLogging foreman_cif;
  201. foreman_cif.call.send_side_bwe = true;
  202. foreman_cif.video[0] = {
  203. true, 352, 288, 30,
  204. 700000, 700000, 700000, false,
  205. "VP8", 1, 0, 0,
  206. false, false, true, ClipNameToClipPath("foreman_cif")};
  207. foreman_cif.analyzer = {GetTestName("foreman_cif_net_delay_0_0_plr_0"), 0.0,
  208. 0.0, kFullStackTestDurationSecs};
  209. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  210. fixture->RunWithAnalyzer(foreman_cif);
  211. }
  212. TEST_P(GenericDescriptorTest, ForemanCif30kbpsWithoutPacketLoss) {
  213. auto fixture = CreateVideoQualityTestFixture();
  214. ParamsWithLogging foreman_cif;
  215. foreman_cif.call.send_side_bwe = true;
  216. foreman_cif.video[0] = {
  217. true, 352, 288, 10,
  218. 30000, 30000, 30000, false,
  219. "VP8", 1, 0, 0,
  220. false, false, true, ClipNameToClipPath("foreman_cif")};
  221. foreman_cif.analyzer = {GetTestName("foreman_cif_30kbps_net_delay_0_0_plr_0"),
  222. 0.0, 0.0, kFullStackTestDurationSecs};
  223. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  224. fixture->RunWithAnalyzer(foreman_cif);
  225. }
  226. // TODO(webrtc:9722): Remove when experiment is cleaned up.
  227. TEST_P(GenericDescriptorTest,
  228. ForemanCif30kbpsWithoutPacketLossTrustedRateControl) {
  229. test::ScopedFieldTrials override_field_trials(
  230. AppendFieldTrials(kVp8TrustedRateControllerFieldTrial));
  231. auto fixture = CreateVideoQualityTestFixture();
  232. ParamsWithLogging foreman_cif;
  233. foreman_cif.call.send_side_bwe = true;
  234. foreman_cif.video[0] = {
  235. true, 352, 288, 10,
  236. 30000, 30000, 30000, false,
  237. "VP8", 1, 0, 0,
  238. false, false, true, ClipNameToClipPath("foreman_cif")};
  239. foreman_cif.analyzer = {
  240. GetTestName("foreman_cif_30kbps_net_delay_0_0_plr_0_trusted_rate_ctrl"),
  241. 0.0, 0.0, kFullStackTestDurationSecs};
  242. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  243. fixture->RunWithAnalyzer(foreman_cif);
  244. }
  245. // Link capacity below default start rate.
  246. TEST(FullStackTest, ForemanCifLink150kbpsWithoutPacketLoss) {
  247. auto fixture = CreateVideoQualityTestFixture();
  248. ParamsWithLogging foreman_cif;
  249. foreman_cif.call.send_side_bwe = true;
  250. foreman_cif.video[0] = {
  251. true, 352, 288, 30,
  252. 30000, 500000, 2000000, false,
  253. "VP8", 1, 0, 0,
  254. false, false, true, ClipNameToClipPath("foreman_cif")};
  255. foreman_cif.analyzer = {"foreman_cif_link_150kbps_net_delay_0_0_plr_0", 0.0,
  256. 0.0, kFullStackTestDurationSecs};
  257. foreman_cif.config->link_capacity_kbps = 150;
  258. fixture->RunWithAnalyzer(foreman_cif);
  259. }
  260. // Restricted network and encoder overproducing by 30%.
  261. TEST(FullStackTest, ForemanCifLink150kbpsBadRateController) {
  262. auto fixture = CreateVideoQualityTestFixture();
  263. ParamsWithLogging foreman_cif;
  264. foreman_cif.call.send_side_bwe = true;
  265. foreman_cif.video[0] = {
  266. true, 352, 288, 30,
  267. 30000, 500000, 2000000, false,
  268. "VP8", 1, 0, 0,
  269. false, false, true, ClipNameToClipPath("foreman_cif"),
  270. 0, {}, 1.30};
  271. foreman_cif.analyzer = {
  272. "foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30", 0.0, 0.0,
  273. kFullStackTestDurationSecs};
  274. foreman_cif.config->link_capacity_kbps = 150;
  275. foreman_cif.config->queue_length_packets = 30;
  276. foreman_cif.config->queue_delay_ms = 100;
  277. fixture->RunWithAnalyzer(foreman_cif);
  278. }
  279. // Weak 3G-style link: 250kbps, 1% loss, 100ms delay, 15 packets queue.
  280. // Packet rate and loss are low enough that loss will happen with ~3s interval.
  281. // This triggers protection overhead to toggle between zero and non-zero.
  282. // Link queue is restrictive enough to trigger loss on probes.
  283. TEST(FullStackTest, ForemanCifMediaCapacitySmallLossAndQueue) {
  284. auto fixture = CreateVideoQualityTestFixture();
  285. ParamsWithLogging foreman_cif;
  286. foreman_cif.call.send_side_bwe = true;
  287. foreman_cif.video[0] = {
  288. true, 352, 288, 30,
  289. 30000, 500000, 2000000, false,
  290. "VP8", 1, 0, 0,
  291. false, false, true, ClipNameToClipPath("foreman_cif"),
  292. 0, {}, 1.30};
  293. foreman_cif.analyzer = {"foreman_cif_link_250kbps_delay100ms_10pkts_loss1",
  294. 0.0, 0.0, kFullStackTestDurationSecs};
  295. foreman_cif.config->link_capacity_kbps = 250;
  296. foreman_cif.config->queue_length_packets = 10;
  297. foreman_cif.config->queue_delay_ms = 100;
  298. foreman_cif.config->loss_percent = 1;
  299. fixture->RunWithAnalyzer(foreman_cif);
  300. }
  301. TEST_P(GenericDescriptorTest, ForemanCifPlr5) {
  302. auto fixture = CreateVideoQualityTestFixture();
  303. ParamsWithLogging foreman_cif;
  304. foreman_cif.call.send_side_bwe = true;
  305. foreman_cif.video[0] = {
  306. true, 352, 288, 30,
  307. 30000, 500000, 2000000, false,
  308. "VP8", 1, 0, 0,
  309. false, false, true, ClipNameToClipPath("foreman_cif")};
  310. foreman_cif.analyzer = {GetTestName("foreman_cif_delay_50_0_plr_5"), 0.0, 0.0,
  311. kFullStackTestDurationSecs};
  312. foreman_cif.config->loss_percent = 5;
  313. foreman_cif.config->queue_delay_ms = 50;
  314. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  315. fixture->RunWithAnalyzer(foreman_cif);
  316. }
  317. TEST_P(GenericDescriptorTest, ForemanCifPlr5Ulpfec) {
  318. auto fixture = CreateVideoQualityTestFixture();
  319. ParamsWithLogging foreman_cif;
  320. foreman_cif.call.send_side_bwe = true;
  321. foreman_cif.video[0] = {
  322. true, 352, 288, 30,
  323. 30000, 500000, 2000000, false,
  324. "VP8", 1, 0, 0,
  325. true, false, true, ClipNameToClipPath("foreman_cif")};
  326. foreman_cif.analyzer = {GetTestName("foreman_cif_delay_50_0_plr_5_ulpfec"),
  327. 0.0, 0.0, kFullStackTestDurationSecs};
  328. foreman_cif.config->loss_percent = 5;
  329. foreman_cif.config->queue_delay_ms = 50;
  330. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  331. fixture->RunWithAnalyzer(foreman_cif);
  332. }
  333. TEST(FullStackTest, ForemanCifPlr5Flexfec) {
  334. auto fixture = CreateVideoQualityTestFixture();
  335. ParamsWithLogging foreman_cif;
  336. foreman_cif.call.send_side_bwe = true;
  337. foreman_cif.video[0] = {
  338. true, 352, 288, 30,
  339. 30000, 500000, 2000000, false,
  340. "VP8", 1, 0, 0,
  341. false, true, true, ClipNameToClipPath("foreman_cif")};
  342. foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_flexfec", 0.0, 0.0,
  343. kFullStackTestDurationSecs};
  344. foreman_cif.config->loss_percent = 5;
  345. foreman_cif.config->queue_delay_ms = 50;
  346. fixture->RunWithAnalyzer(foreman_cif);
  347. }
  348. TEST(FullStackTest, ForemanCif500kbpsPlr3Flexfec) {
  349. auto fixture = CreateVideoQualityTestFixture();
  350. ParamsWithLogging foreman_cif;
  351. foreman_cif.call.send_side_bwe = true;
  352. foreman_cif.video[0] = {
  353. true, 352, 288, 30,
  354. 30000, 500000, 2000000, false,
  355. "VP8", 1, 0, 0,
  356. false, true, true, ClipNameToClipPath("foreman_cif")};
  357. foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_flexfec", 0.0,
  358. 0.0, kFullStackTestDurationSecs};
  359. foreman_cif.config->loss_percent = 3;
  360. foreman_cif.config->link_capacity_kbps = 500;
  361. foreman_cif.config->queue_delay_ms = 50;
  362. fixture->RunWithAnalyzer(foreman_cif);
  363. }
  364. TEST(FullStackTest, ForemanCif500kbpsPlr3Ulpfec) {
  365. auto fixture = CreateVideoQualityTestFixture();
  366. ParamsWithLogging foreman_cif;
  367. foreman_cif.call.send_side_bwe = true;
  368. foreman_cif.video[0] = {
  369. true, 352, 288, 30,
  370. 30000, 500000, 2000000, false,
  371. "VP8", 1, 0, 0,
  372. true, false, true, ClipNameToClipPath("foreman_cif")};
  373. foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_ulpfec", 0.0,
  374. 0.0, kFullStackTestDurationSecs};
  375. foreman_cif.config->loss_percent = 3;
  376. foreman_cif.config->link_capacity_kbps = 500;
  377. foreman_cif.config->queue_delay_ms = 50;
  378. fixture->RunWithAnalyzer(foreman_cif);
  379. }
  380. #if defined(WEBRTC_USE_H264)
  381. TEST(FullStackTest, ForemanCifWithoutPacketlossH264) {
  382. auto fixture = CreateVideoQualityTestFixture();
  383. // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
  384. ParamsWithLogging foreman_cif;
  385. foreman_cif.call.send_side_bwe = true;
  386. foreman_cif.video[0] = {
  387. true, 352, 288, 30,
  388. 700000, 700000, 700000, false,
  389. "H264", 1, 0, 0,
  390. false, false, true, ClipNameToClipPath("foreman_cif")};
  391. foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_H264", 0.0, 0.0,
  392. kFullStackTestDurationSecs};
  393. fixture->RunWithAnalyzer(foreman_cif);
  394. }
  395. TEST(FullStackTest, ForemanCif30kbpsWithoutPacketlossH264) {
  396. auto fixture = CreateVideoQualityTestFixture();
  397. ParamsWithLogging foreman_cif;
  398. foreman_cif.call.send_side_bwe = true;
  399. foreman_cif.video[0] = {
  400. true, 352, 288, 10,
  401. 30000, 30000, 30000, false,
  402. "H264", 1, 0, 0,
  403. false, false, true, ClipNameToClipPath("foreman_cif")};
  404. foreman_cif.analyzer = {"foreman_cif_30kbps_net_delay_0_0_plr_0_H264", 0.0,
  405. 0.0, kFullStackTestDurationSecs};
  406. fixture->RunWithAnalyzer(foreman_cif);
  407. }
  408. TEST_P(GenericDescriptorTest, ForemanCifPlr5H264) {
  409. auto fixture = CreateVideoQualityTestFixture();
  410. ParamsWithLogging foreman_cif;
  411. foreman_cif.call.send_side_bwe = true;
  412. foreman_cif.video[0] = {
  413. true, 352, 288, 30,
  414. 30000, 500000, 2000000, false,
  415. "H264", 1, 0, 0,
  416. false, false, true, ClipNameToClipPath("foreman_cif")};
  417. foreman_cif.analyzer = {GetTestName("foreman_cif_delay_50_0_plr_5_H264"), 0.0,
  418. 0.0, kFullStackTestDurationSecs};
  419. foreman_cif.config->loss_percent = 5;
  420. foreman_cif.config->queue_delay_ms = 50;
  421. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  422. fixture->RunWithAnalyzer(foreman_cif);
  423. }
  424. TEST(FullStackTest, ForemanCifPlr5H264SpsPpsIdrIsKeyframe) {
  425. test::ScopedFieldTrials override_field_trials(
  426. AppendFieldTrials("WebRTC-SpsPpsIdrIsH264Keyframe/Enabled/"));
  427. auto fixture = CreateVideoQualityTestFixture();
  428. ParamsWithLogging foreman_cif;
  429. foreman_cif.call.send_side_bwe = true;
  430. foreman_cif.video[0] = {
  431. true, 352, 288, 30,
  432. 30000, 500000, 2000000, false,
  433. "H264", 1, 0, 0,
  434. false, false, true, ClipNameToClipPath("foreman_cif")};
  435. foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr", 0.0,
  436. 0.0, kFullStackTestDurationSecs};
  437. foreman_cif.config->loss_percent = 5;
  438. foreman_cif.config->queue_delay_ms = 50;
  439. fixture->RunWithAnalyzer(foreman_cif);
  440. }
  441. // Verify that this is worth the bot time, before enabling.
  442. TEST(FullStackTest, ForemanCifPlr5H264Flexfec) {
  443. auto fixture = CreateVideoQualityTestFixture();
  444. ParamsWithLogging foreman_cif;
  445. foreman_cif.call.send_side_bwe = true;
  446. foreman_cif.video[0] = {
  447. true, 352, 288, 30,
  448. 30000, 500000, 2000000, false,
  449. "H264", 1, 0, 0,
  450. false, true, true, ClipNameToClipPath("foreman_cif")};
  451. foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_flexfec", 0.0, 0.0,
  452. kFullStackTestDurationSecs};
  453. foreman_cif.config->loss_percent = 5;
  454. foreman_cif.config->queue_delay_ms = 50;
  455. fixture->RunWithAnalyzer(foreman_cif);
  456. }
  457. // Ulpfec with H264 is an unsupported combination, so this test is only useful
  458. // for debugging. It is therefore disabled by default.
  459. TEST(FullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) {
  460. auto fixture = CreateVideoQualityTestFixture();
  461. ParamsWithLogging foreman_cif;
  462. foreman_cif.call.send_side_bwe = true;
  463. foreman_cif.video[0] = {
  464. true, 352, 288, 30,
  465. 30000, 500000, 2000000, false,
  466. "H264", 1, 0, 0,
  467. true, false, true, ClipNameToClipPath("foreman_cif")};
  468. foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_ulpfec", 0.0, 0.0,
  469. kFullStackTestDurationSecs};
  470. foreman_cif.config->loss_percent = 5;
  471. foreman_cif.config->queue_delay_ms = 50;
  472. fixture->RunWithAnalyzer(foreman_cif);
  473. }
  474. #endif // defined(WEBRTC_USE_H264)
  475. TEST(FullStackTest, ForemanCif500kbps) {
  476. auto fixture = CreateVideoQualityTestFixture();
  477. ParamsWithLogging foreman_cif;
  478. foreman_cif.call.send_side_bwe = true;
  479. foreman_cif.video[0] = {
  480. true, 352, 288, 30,
  481. 30000, 500000, 2000000, false,
  482. "VP8", 1, 0, 0,
  483. false, false, true, ClipNameToClipPath("foreman_cif")};
  484. foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0,
  485. kFullStackTestDurationSecs};
  486. foreman_cif.config->queue_length_packets = 0;
  487. foreman_cif.config->queue_delay_ms = 0;
  488. foreman_cif.config->link_capacity_kbps = 500;
  489. fixture->RunWithAnalyzer(foreman_cif);
  490. }
  491. TEST(FullStackTest, ForemanCif500kbpsLimitedQueue) {
  492. auto fixture = CreateVideoQualityTestFixture();
  493. ParamsWithLogging foreman_cif;
  494. foreman_cif.call.send_side_bwe = true;
  495. foreman_cif.video[0] = {
  496. true, 352, 288, 30,
  497. 30000, 500000, 2000000, false,
  498. "VP8", 1, 0, 0,
  499. false, false, true, ClipNameToClipPath("foreman_cif")};
  500. foreman_cif.analyzer = {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0,
  501. kFullStackTestDurationSecs};
  502. foreman_cif.config->queue_length_packets = 32;
  503. foreman_cif.config->queue_delay_ms = 0;
  504. foreman_cif.config->link_capacity_kbps = 500;
  505. fixture->RunWithAnalyzer(foreman_cif);
  506. }
  507. TEST(FullStackTest, ForemanCif500kbps100ms) {
  508. auto fixture = CreateVideoQualityTestFixture();
  509. ParamsWithLogging foreman_cif;
  510. foreman_cif.call.send_side_bwe = true;
  511. foreman_cif.video[0] = {
  512. true, 352, 288, 30,
  513. 30000, 500000, 2000000, false,
  514. "VP8", 1, 0, 0,
  515. false, false, true, ClipNameToClipPath("foreman_cif")};
  516. foreman_cif.analyzer = {"foreman_cif_500kbps_100ms", 0.0, 0.0,
  517. kFullStackTestDurationSecs};
  518. foreman_cif.config->queue_length_packets = 0;
  519. foreman_cif.config->queue_delay_ms = 100;
  520. foreman_cif.config->link_capacity_kbps = 500;
  521. fixture->RunWithAnalyzer(foreman_cif);
  522. }
  523. TEST_P(GenericDescriptorTest, ForemanCif500kbps100msLimitedQueue) {
  524. auto fixture = CreateVideoQualityTestFixture();
  525. ParamsWithLogging foreman_cif;
  526. foreman_cif.call.send_side_bwe = true;
  527. foreman_cif.video[0] = {
  528. true, 352, 288, 30,
  529. 30000, 500000, 2000000, false,
  530. "VP8", 1, 0, 0,
  531. false, false, true, ClipNameToClipPath("foreman_cif")};
  532. foreman_cif.analyzer = {GetTestName("foreman_cif_500kbps_100ms_32pkts_queue"),
  533. 0.0, 0.0, kFullStackTestDurationSecs};
  534. foreman_cif.config->queue_length_packets = 32;
  535. foreman_cif.config->queue_delay_ms = 100;
  536. foreman_cif.config->link_capacity_kbps = 500;
  537. foreman_cif.call.generic_descriptor = GenericDescriptorEnabled();
  538. fixture->RunWithAnalyzer(foreman_cif);
  539. }
  540. TEST(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
  541. auto fixture = CreateVideoQualityTestFixture();
  542. ParamsWithLogging foreman_cif;
  543. foreman_cif.call.send_side_bwe = false;
  544. foreman_cif.video[0] = {
  545. true, 352, 288, 30,
  546. 30000, 500000, 2000000, false,
  547. "VP8", 1, 0, 0,
  548. false, false, true, ClipNameToClipPath("foreman_cif")};
  549. foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe",
  550. 0.0, 0.0, kFullStackTestDurationSecs};
  551. foreman_cif.config->queue_length_packets = 32;
  552. foreman_cif.config->queue_delay_ms = 100;
  553. foreman_cif.config->link_capacity_kbps = 500;
  554. fixture->RunWithAnalyzer(foreman_cif);
  555. }
  556. TEST(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
  557. auto fixture = CreateVideoQualityTestFixture();
  558. ParamsWithLogging foreman_cif;
  559. foreman_cif.call.send_side_bwe = true;
  560. foreman_cif.video[0] = {
  561. true, 352, 288, 30,
  562. 30000, 2000000, 2000000, false,
  563. "VP8", 1, 0, 0,
  564. false, false, true, ClipNameToClipPath("foreman_cif")};
  565. foreman_cif.analyzer = {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
  566. kFullStackTestDurationSecs};
  567. foreman_cif.config->queue_length_packets = 32;
  568. foreman_cif.config->queue_delay_ms = 100;
  569. foreman_cif.config->link_capacity_kbps = 1000;
  570. fixture->RunWithAnalyzer(foreman_cif);
  571. }
  572. // TODO(sprang): Remove this if we have the similar ModerateLimits below?
  573. TEST(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
  574. auto fixture = CreateVideoQualityTestFixture();
  575. ParamsWithLogging conf_motion_hd;
  576. conf_motion_hd.call.send_side_bwe = true;
  577. conf_motion_hd.video[0] = {
  578. true, 1280,
  579. 720, 50,
  580. 30000, 3000000,
  581. 3000000, false,
  582. "VP8", 1,
  583. 0, 0,
  584. false, false,
  585. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  586. conf_motion_hd.analyzer = {"conference_motion_hd_2000kbps_100ms_32pkts_queue",
  587. 0.0, 0.0, kFullStackTestDurationSecs};
  588. conf_motion_hd.config->queue_length_packets = 32;
  589. conf_motion_hd.config->queue_delay_ms = 100;
  590. conf_motion_hd.config->link_capacity_kbps = 2000;
  591. fixture->RunWithAnalyzer(conf_motion_hd);
  592. }
  593. // TODO(webrtc:9722): Remove when experiment is cleaned up.
  594. TEST(FullStackTest, ConferenceMotionHd1TLModerateLimitsWhitelistVp8) {
  595. test::ScopedFieldTrials override_field_trials(
  596. AppendFieldTrials(kVp8TrustedRateControllerFieldTrial));
  597. auto fixture = CreateVideoQualityTestFixture();
  598. ParamsWithLogging conf_motion_hd;
  599. conf_motion_hd.call.send_side_bwe = true;
  600. conf_motion_hd.video[0] = {
  601. true, 1280,
  602. 720, 50,
  603. 30000, 3000000,
  604. 3000000, false,
  605. "VP8", 1,
  606. -1, 0,
  607. false, false,
  608. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  609. conf_motion_hd.analyzer = {
  610. "conference_motion_hd_1tl_moderate_limits_trusted_rate_ctrl", 0.0, 0.0,
  611. kFullStackTestDurationSecs};
  612. conf_motion_hd.config->queue_length_packets = 50;
  613. conf_motion_hd.config->loss_percent = 3;
  614. conf_motion_hd.config->queue_delay_ms = 100;
  615. conf_motion_hd.config->link_capacity_kbps = 2000;
  616. fixture->RunWithAnalyzer(conf_motion_hd);
  617. }
  618. TEST_P(GenericDescriptorTest, ConferenceMotionHd2TLModerateLimits) {
  619. auto fixture = CreateVideoQualityTestFixture();
  620. ParamsWithLogging conf_motion_hd;
  621. conf_motion_hd.call.send_side_bwe = true;
  622. conf_motion_hd.video[0] = {
  623. true, 1280,
  624. 720, 50,
  625. 30000, 3000000,
  626. 3000000, false,
  627. "VP8", 2,
  628. -1, 0,
  629. false, false,
  630. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  631. conf_motion_hd.analyzer = {
  632. GetTestName("conference_motion_hd_2tl_moderate_limits"), 0.0, 0.0,
  633. kFullStackTestDurationSecs};
  634. conf_motion_hd.config->queue_length_packets = 50;
  635. conf_motion_hd.config->loss_percent = 3;
  636. conf_motion_hd.config->queue_delay_ms = 100;
  637. conf_motion_hd.config->link_capacity_kbps = 2000;
  638. conf_motion_hd.call.generic_descriptor = GenericDescriptorEnabled();
  639. fixture->RunWithAnalyzer(conf_motion_hd);
  640. }
  641. TEST(FullStackTest, ConferenceMotionHd3TLModerateLimits) {
  642. auto fixture = CreateVideoQualityTestFixture();
  643. ParamsWithLogging conf_motion_hd;
  644. conf_motion_hd.call.send_side_bwe = true;
  645. conf_motion_hd.video[0] = {
  646. true, 1280,
  647. 720, 50,
  648. 30000, 3000000,
  649. 3000000, false,
  650. "VP8", 3,
  651. -1, 0,
  652. false, false,
  653. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  654. conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0,
  655. 0.0, kFullStackTestDurationSecs};
  656. conf_motion_hd.config->queue_length_packets = 50;
  657. conf_motion_hd.config->loss_percent = 3;
  658. conf_motion_hd.config->queue_delay_ms = 100;
  659. conf_motion_hd.config->link_capacity_kbps = 2000;
  660. fixture->RunWithAnalyzer(conf_motion_hd);
  661. }
  662. TEST(FullStackTest, ConferenceMotionHd4TLModerateLimits) {
  663. auto fixture = CreateVideoQualityTestFixture();
  664. ParamsWithLogging conf_motion_hd;
  665. conf_motion_hd.call.send_side_bwe = true;
  666. conf_motion_hd.video[0] = {
  667. true, 1280,
  668. 720, 50,
  669. 30000, 3000000,
  670. 3000000, false,
  671. "VP8", 4,
  672. -1, 0,
  673. false, false,
  674. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  675. conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0,
  676. 0.0, kFullStackTestDurationSecs};
  677. conf_motion_hd.config->queue_length_packets = 50;
  678. conf_motion_hd.config->loss_percent = 3;
  679. conf_motion_hd.config->queue_delay_ms = 100;
  680. conf_motion_hd.config->link_capacity_kbps = 2000;
  681. fixture->RunWithAnalyzer(conf_motion_hd);
  682. }
  683. TEST(FullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) {
  684. test::ScopedFieldTrials field_trial(
  685. AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"));
  686. auto fixture = CreateVideoQualityTestFixture();
  687. ParamsWithLogging conf_motion_hd;
  688. conf_motion_hd.call.send_side_bwe = true;
  689. conf_motion_hd.video[0] = {
  690. true, 1280,
  691. 720, 50,
  692. 30000, 3000000,
  693. 3000000, false,
  694. "VP8", 3,
  695. -1, 0,
  696. false, false,
  697. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  698. conf_motion_hd.analyzer = {"conference_motion_hd_3tl_alt_moderate_limits",
  699. 0.0, 0.0, kFullStackTestDurationSecs};
  700. conf_motion_hd.config->queue_length_packets = 50;
  701. conf_motion_hd.config->loss_percent = 3;
  702. conf_motion_hd.config->queue_delay_ms = 100;
  703. conf_motion_hd.config->link_capacity_kbps = 2000;
  704. fixture->RunWithAnalyzer(conf_motion_hd);
  705. }
  706. TEST(FullStackTest,
  707. ConferenceMotionHd3TLModerateLimitsAltTLPatternAndBaseHeavyTLAllocation) {
  708. auto fixture = CreateVideoQualityTestFixture();
  709. test::ScopedFieldTrials field_trial(
  710. AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"
  711. "WebRTC-UseBaseHeavyVP8TL3RateAllocation/Enabled/"));
  712. ParamsWithLogging conf_motion_hd;
  713. conf_motion_hd.call.send_side_bwe = true;
  714. conf_motion_hd.video[0] = {
  715. true, 1280,
  716. 720, 50,
  717. 30000, 3000000,
  718. 3000000, false,
  719. "VP8", 3,
  720. -1, 0,
  721. false, false,
  722. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  723. conf_motion_hd.analyzer = {
  724. "conference_motion_hd_3tl_alt_heavy_moderate_limits", 0.0, 0.0,
  725. kFullStackTestDurationSecs};
  726. conf_motion_hd.config->queue_length_packets = 50;
  727. conf_motion_hd.config->loss_percent = 3;
  728. conf_motion_hd.config->queue_delay_ms = 100;
  729. conf_motion_hd.config->link_capacity_kbps = 2000;
  730. fixture->RunWithAnalyzer(conf_motion_hd);
  731. }
  732. #if defined(RTC_ENABLE_VP9)
  733. TEST(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) {
  734. auto fixture = CreateVideoQualityTestFixture();
  735. ParamsWithLogging conf_motion_hd;
  736. conf_motion_hd.call.send_side_bwe = true;
  737. conf_motion_hd.video[0] = {
  738. true, 1280,
  739. 720, 50,
  740. 30000, 3000000,
  741. 3000000, false,
  742. "VP9", 1,
  743. 0, 0,
  744. false, false,
  745. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  746. conf_motion_hd.analyzer = {
  747. "conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9", 0.0, 0.0,
  748. kFullStackTestDurationSecs};
  749. conf_motion_hd.config->queue_length_packets = 32;
  750. conf_motion_hd.config->queue_delay_ms = 100;
  751. conf_motion_hd.config->link_capacity_kbps = 2000;
  752. fixture->RunWithAnalyzer(conf_motion_hd);
  753. }
  754. #endif
  755. TEST(FullStackTest, ScreenshareSlidesVP8_2TL) {
  756. auto fixture = CreateVideoQualityTestFixture();
  757. ParamsWithLogging screenshare;
  758. screenshare.call.send_side_bwe = true;
  759. screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
  760. 1000000, false, "VP8", 2, 1, 400000,
  761. false, false, false, ""};
  762. screenshare.screenshare[0] = {true, false, 10};
  763. screenshare.analyzer = {"screenshare_slides", 0.0, 0.0,
  764. kFullStackTestDurationSecs};
  765. fixture->RunWithAnalyzer(screenshare);
  766. }
  767. #if !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
  768. // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
  769. const char kScreenshareSimulcastVariableFramerateExperiment[] =
  770. "WebRTC-VP8VariableFramerateScreenshare/"
  771. "Enabled,min_fps:5.0,min_qp:15,undershoot:30/";
  772. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_Simulcast) {
  773. auto fixture = CreateVideoQualityTestFixture();
  774. ParamsWithLogging screenshare;
  775. screenshare.call.send_side_bwe = true;
  776. screenshare.screenshare[0] = {true, false, 10};
  777. screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
  778. 2500000, false, "VP8", 2, 1, 400000,
  779. false, false, false, ""};
  780. screenshare.analyzer = {"screenshare_slides_simulcast", 0.0, 0.0,
  781. kFullStackTestDurationSecs};
  782. ParamsWithLogging screenshare_params_high;
  783. screenshare_params_high.video[0] = {
  784. true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
  785. "VP8", 2, 0, 400000, false, false, false, ""};
  786. VideoQualityTest::Params screenshare_params_low;
  787. screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
  788. 1000000, false, "VP8", 2, 0, 400000,
  789. false, false, false, ""};
  790. std::vector<VideoStream> streams = {
  791. VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
  792. VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
  793. screenshare.ss[0] = {
  794. streams, 1, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  795. false};
  796. fixture->RunWithAnalyzer(screenshare);
  797. }
  798. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_Variable_Framerate) {
  799. test::ScopedFieldTrials field_trial(
  800. AppendFieldTrials(kScreenshareSimulcastVariableFramerateExperiment));
  801. auto fixture = CreateVideoQualityTestFixture();
  802. ParamsWithLogging screenshare;
  803. screenshare.call.send_side_bwe = true;
  804. screenshare.screenshare[0] = {true, false, 10};
  805. screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
  806. 2500000, false, "VP8", 2, 1, 400000,
  807. false, false, false, ""};
  808. screenshare.analyzer = {"screenshare_slides_simulcast_variable_framerate",
  809. 0.0, 0.0, kFullStackTestDurationSecs};
  810. ParamsWithLogging screenshare_params_high;
  811. screenshare_params_high.video[0] = {
  812. true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
  813. "VP8", 2, 0, 400000, false, false, false, ""};
  814. VideoQualityTest::Params screenshare_params_low;
  815. screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
  816. 1000000, false, "VP8", 2, 0, 400000,
  817. false, false, false, ""};
  818. std::vector<VideoStream> streams = {
  819. VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
  820. VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
  821. screenshare.ss[0] = {
  822. streams, 1, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  823. false};
  824. fixture->RunWithAnalyzer(screenshare);
  825. }
  826. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_low) {
  827. auto fixture = CreateVideoQualityTestFixture();
  828. ParamsWithLogging screenshare;
  829. screenshare.call.send_side_bwe = true;
  830. screenshare.screenshare[0] = {true, false, 10};
  831. screenshare.video[0] = {true, 1850, 1110, 30, 800000, 2500000,
  832. 2500000, false, "VP8", 2, 1, 400000,
  833. false, false, false, ""};
  834. screenshare.analyzer = {"screenshare_slides_simulcast_low", 0.0, 0.0,
  835. kFullStackTestDurationSecs};
  836. VideoQualityTest::Params screenshare_params_high;
  837. screenshare_params_high.video[0] = {
  838. true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
  839. "VP8", 2, 0, 400000, false, false, false, ""};
  840. VideoQualityTest::Params screenshare_params_low;
  841. screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
  842. 1000000, false, "VP8", 2, 0, 400000,
  843. false, false, false, ""};
  844. std::vector<VideoStream> streams = {
  845. VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
  846. VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
  847. screenshare.ss[0] = {
  848. streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  849. false};
  850. fixture->RunWithAnalyzer(screenshare);
  851. }
  852. #endif // !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
  853. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
  854. auto fixture = CreateVideoQualityTestFixture();
  855. ParamsWithLogging config;
  856. config.call.send_side_bwe = true;
  857. config.video[0] = {true, 1850, 1110 / 2, 5, 50000, 200000,
  858. 1000000, false, "VP8", 2, 1, 400000,
  859. false, false, false, ""};
  860. config.screenshare[0] = {true, false, 10, 2};
  861. config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
  862. kFullStackTestDurationSecs};
  863. fixture->RunWithAnalyzer(config);
  864. }
  865. TEST_P(GenericDescriptorTest, ScreenshareSlidesVP8_2TL_LossyNet) {
  866. auto fixture = CreateVideoQualityTestFixture();
  867. ParamsWithLogging screenshare;
  868. screenshare.call.send_side_bwe = true;
  869. screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
  870. 1000000, false, "VP8", 2, 1, 400000,
  871. false, false, false, ""};
  872. screenshare.screenshare[0] = {true, false, 10};
  873. screenshare.analyzer = {GetTestName("screenshare_slides_lossy_net"), 0.0, 0.0,
  874. kFullStackTestDurationSecs};
  875. screenshare.config->loss_percent = 5;
  876. screenshare.config->queue_delay_ms = 200;
  877. screenshare.config->link_capacity_kbps = 500;
  878. screenshare.call.generic_descriptor = GenericDescriptorEnabled();
  879. fixture->RunWithAnalyzer(screenshare);
  880. }
  881. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
  882. auto fixture = CreateVideoQualityTestFixture();
  883. ParamsWithLogging screenshare;
  884. screenshare.call.send_side_bwe = true;
  885. screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
  886. 1000000, false, "VP8", 2, 1, 400000,
  887. false, false, false, ""};
  888. screenshare.screenshare[0] = {true, false, 10};
  889. screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
  890. kFullStackTestDurationSecs};
  891. screenshare.config->loss_percent = 10;
  892. screenshare.config->queue_delay_ms = 200;
  893. screenshare.config->link_capacity_kbps = 500;
  894. fixture->RunWithAnalyzer(screenshare);
  895. }
  896. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) {
  897. auto fixture = CreateVideoQualityTestFixture();
  898. ParamsWithLogging screenshare;
  899. screenshare.call.send_side_bwe = true;
  900. screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
  901. 1000000, false, "VP8", 2, 1, 400000,
  902. false, false, false, ""};
  903. screenshare.screenshare[0] = {true, false, 10};
  904. screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0,
  905. kFullStackTestDurationSecs};
  906. screenshare.config->loss_percent = 5;
  907. screenshare.config->link_capacity_kbps = 200;
  908. screenshare.config->queue_length_packets = 30;
  909. fixture->RunWithAnalyzer(screenshare);
  910. }
  911. TEST(FullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted) {
  912. auto fixture = CreateVideoQualityTestFixture();
  913. ParamsWithLogging screenshare;
  914. screenshare.call.send_side_bwe = true;
  915. screenshare.video[0] = {true, 1850, 1110, 5, 50000, 200000,
  916. 1000000, false, "VP8", 2, 1, 400000,
  917. false, false, false, ""};
  918. screenshare.screenshare[0] = {true, false, 10};
  919. screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0,
  920. kFullStackTestDurationSecs};
  921. screenshare.config->loss_percent = 1;
  922. screenshare.config->link_capacity_kbps = 1200;
  923. screenshare.config->queue_length_packets = 30;
  924. fixture->RunWithAnalyzer(screenshare);
  925. }
  926. // Since ParamsWithLogging::Video is not trivially destructible, we can't
  927. // store these structs as const globals.
  928. ParamsWithLogging::Video SvcVp9Video() {
  929. return ParamsWithLogging::Video{
  930. true, 1280,
  931. 720, 30,
  932. 800000, 2500000,
  933. 2500000, false,
  934. "VP9", 3,
  935. 2, 400000,
  936. false, false,
  937. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  938. }
  939. ParamsWithLogging::Video SimulcastVp8VideoHigh() {
  940. return ParamsWithLogging::Video{
  941. true, 1280,
  942. 720, 30,
  943. 800000, 2500000,
  944. 2500000, false,
  945. "VP8", 3,
  946. 2, 400000,
  947. false, false,
  948. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  949. }
  950. ParamsWithLogging::Video SimulcastVp8VideoMedium() {
  951. return ParamsWithLogging::Video{
  952. true, 640,
  953. 360, 30,
  954. 150000, 500000,
  955. 700000, false,
  956. "VP8", 3,
  957. 2, 400000,
  958. false, false,
  959. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  960. }
  961. ParamsWithLogging::Video SimulcastVp8VideoLow() {
  962. return ParamsWithLogging::Video{
  963. true, 320,
  964. 180, 30,
  965. 30000, 150000,
  966. 200000, false,
  967. "VP8", 3,
  968. 2, 400000,
  969. false, false,
  970. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  971. }
  972. #if defined(RTC_ENABLE_VP9)
  973. TEST(FullStackTest, ScreenshareSlidesVP9_3SL_High_Fps) {
  974. auto fixture = CreateVideoQualityTestFixture();
  975. ParamsWithLogging screenshare;
  976. screenshare.call.send_side_bwe = true;
  977. screenshare.video[0] = {true, 1850, 1110, 30, 50000, 200000,
  978. 2000000, false, "VP9", 1, 0, 400000,
  979. false, false, false, ""};
  980. screenshare.screenshare[0] = {true, false, 10};
  981. screenshare.analyzer = {"screenshare_slides_vp9_3sl_high_fps", 0.0, 0.0,
  982. kFullStackTestDurationSecs};
  983. screenshare.ss[0] = {
  984. std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOn,
  985. std::vector<SpatialLayer>(), true};
  986. fixture->RunWithAnalyzer(screenshare);
  987. }
  988. TEST(FullStackTest, ScreenshareSlidesVP9_3SL_Variable_Fps) {
  989. webrtc::test::ScopedFieldTrials override_trials(
  990. AppendFieldTrials("WebRTC-VP9VariableFramerateScreenshare/"
  991. "Enabled,min_qp:32,min_fps:5.0,undershoot:30,frames_"
  992. "before_steady_state:5/"));
  993. auto fixture = CreateVideoQualityTestFixture();
  994. ParamsWithLogging screenshare;
  995. screenshare.call.send_side_bwe = true;
  996. screenshare.video[0] = {true, 1850, 1110, 30, 50000, 200000,
  997. 2000000, false, "VP9", 1, 0, 400000,
  998. false, false, false, ""};
  999. screenshare.screenshare[0] = {true, false, 10};
  1000. screenshare.analyzer = {"screenshare_slides_vp9_3sl_variable_fps", 0.0, 0.0,
  1001. kFullStackTestDurationSecs};
  1002. screenshare.ss[0] = {
  1003. std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOn,
  1004. std::vector<SpatialLayer>(), true};
  1005. fixture->RunWithAnalyzer(screenshare);
  1006. }
  1007. TEST(FullStackTest, VP9SVC_3SL_High) {
  1008. auto fixture = CreateVideoQualityTestFixture();
  1009. ParamsWithLogging simulcast;
  1010. simulcast.call.send_side_bwe = true;
  1011. simulcast.video[0] = SvcVp9Video();
  1012. simulcast.analyzer = {"vp9svc_3sl_high", 0.0, 0.0,
  1013. kFullStackTestDurationSecs};
  1014. simulcast.ss[0] = {
  1015. std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOn,
  1016. std::vector<SpatialLayer>(), false};
  1017. fixture->RunWithAnalyzer(simulcast);
  1018. }
  1019. TEST(FullStackTest, VP9SVC_3SL_Medium) {
  1020. auto fixture = CreateVideoQualityTestFixture();
  1021. ParamsWithLogging simulcast;
  1022. simulcast.call.send_side_bwe = true;
  1023. simulcast.video[0] = SvcVp9Video();
  1024. simulcast.analyzer = {"vp9svc_3sl_medium", 0.0, 0.0,
  1025. kFullStackTestDurationSecs};
  1026. simulcast.ss[0] = {
  1027. std::vector<VideoStream>(), 0, 3, 1, InterLayerPredMode::kOn,
  1028. std::vector<SpatialLayer>(), false};
  1029. fixture->RunWithAnalyzer(simulcast);
  1030. }
  1031. TEST(FullStackTest, VP9SVC_3SL_Low) {
  1032. auto fixture = CreateVideoQualityTestFixture();
  1033. ParamsWithLogging simulcast;
  1034. simulcast.call.send_side_bwe = true;
  1035. simulcast.video[0] = SvcVp9Video();
  1036. simulcast.analyzer = {"vp9svc_3sl_low", 0.0, 0.0, kFullStackTestDurationSecs};
  1037. simulcast.ss[0] = {
  1038. std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOn,
  1039. std::vector<SpatialLayer>(), false};
  1040. fixture->RunWithAnalyzer(simulcast);
  1041. }
  1042. // bugs.webrtc.org/9506
  1043. #if !defined(WEBRTC_MAC)
  1044. TEST(FullStackTest, VP9KSVC_3SL_High) {
  1045. webrtc::test::ScopedFieldTrials override_trials(
  1046. AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
  1047. auto fixture = CreateVideoQualityTestFixture();
  1048. ParamsWithLogging simulcast;
  1049. simulcast.call.send_side_bwe = true;
  1050. simulcast.video[0] = SvcVp9Video();
  1051. simulcast.analyzer = {"vp9ksvc_3sl_high", 0.0, 0.0,
  1052. kFullStackTestDurationSecs};
  1053. simulcast.ss[0] = {
  1054. std::vector<VideoStream>(), 0, 3, 2, InterLayerPredMode::kOnKeyPic,
  1055. std::vector<SpatialLayer>(), false};
  1056. fixture->RunWithAnalyzer(simulcast);
  1057. }
  1058. TEST(FullStackTest, VP9KSVC_3SL_Medium) {
  1059. webrtc::test::ScopedFieldTrials override_trials(
  1060. AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
  1061. auto fixture = CreateVideoQualityTestFixture();
  1062. ParamsWithLogging simulcast;
  1063. simulcast.call.send_side_bwe = true;
  1064. simulcast.video[0] = SvcVp9Video();
  1065. simulcast.analyzer = {"vp9ksvc_3sl_medium", 0.0, 0.0,
  1066. kFullStackTestDurationSecs};
  1067. simulcast.ss[0] = {
  1068. std::vector<VideoStream>(), 0, 3, 1, InterLayerPredMode::kOnKeyPic,
  1069. std::vector<SpatialLayer>(), false};
  1070. fixture->RunWithAnalyzer(simulcast);
  1071. }
  1072. TEST(FullStackTest, VP9KSVC_3SL_Low) {
  1073. webrtc::test::ScopedFieldTrials override_trials(
  1074. AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
  1075. auto fixture = CreateVideoQualityTestFixture();
  1076. ParamsWithLogging simulcast;
  1077. simulcast.call.send_side_bwe = true;
  1078. simulcast.video[0] = SvcVp9Video();
  1079. simulcast.analyzer = {"vp9ksvc_3sl_low", 0.0, 0.0,
  1080. kFullStackTestDurationSecs};
  1081. simulcast.ss[0] = {
  1082. std::vector<VideoStream>(), 0, 3, 0, InterLayerPredMode::kOnKeyPic,
  1083. std::vector<SpatialLayer>(), false};
  1084. fixture->RunWithAnalyzer(simulcast);
  1085. }
  1086. TEST(FullStackTest, VP9KSVC_3SL_Medium_Network_Restricted) {
  1087. webrtc::test::ScopedFieldTrials override_trials(
  1088. AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
  1089. auto fixture = CreateVideoQualityTestFixture();
  1090. ParamsWithLogging simulcast;
  1091. simulcast.call.send_side_bwe = true;
  1092. simulcast.video[0] = SvcVp9Video();
  1093. simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted", 0.0, 0.0,
  1094. kFullStackTestDurationSecs};
  1095. simulcast.ss[0] = {
  1096. std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
  1097. std::vector<SpatialLayer>(), false};
  1098. simulcast.config->link_capacity_kbps = 1000;
  1099. simulcast.config->queue_delay_ms = 100;
  1100. fixture->RunWithAnalyzer(simulcast);
  1101. }
  1102. // TODO(webrtc:9722): Remove when experiment is cleaned up.
  1103. TEST(FullStackTest, VP9KSVC_3SL_Medium_Network_Restricted_Trusted_Rate) {
  1104. webrtc::test::ScopedFieldTrials override_trials(
  1105. AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"
  1106. "WebRTC-LibvpxVp9TrustedRateController/Enabled/"));
  1107. auto fixture = CreateVideoQualityTestFixture();
  1108. ParamsWithLogging simulcast;
  1109. simulcast.call.send_side_bwe = true;
  1110. simulcast.video[0] = SvcVp9Video();
  1111. simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted_trusted_rate",
  1112. 0.0, 0.0, kFullStackTestDurationSecs};
  1113. simulcast.ss[0] = {
  1114. std::vector<VideoStream>(), 0, 3, -1, InterLayerPredMode::kOnKeyPic,
  1115. std::vector<SpatialLayer>(), false};
  1116. simulcast.config->link_capacity_kbps = 1000;
  1117. simulcast.config->queue_delay_ms = 100;
  1118. fixture->RunWithAnalyzer(simulcast);
  1119. }
  1120. #endif // !defined(WEBRTC_MAC)
  1121. #endif // defined(RTC_ENABLE_VP9)
  1122. // Android bots can't handle FullHD, so disable the test.
  1123. // TODO(bugs.webrtc.org/9220): Investigate source of flakiness on Mac.
  1124. #if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
  1125. #define MAYBE_SimulcastFullHdOveruse DISABLED_SimulcastFullHdOveruse
  1126. #else
  1127. #define MAYBE_SimulcastFullHdOveruse SimulcastFullHdOveruse
  1128. #endif
  1129. TEST(FullStackTest, MAYBE_SimulcastFullHdOveruse) {
  1130. auto fixture = CreateVideoQualityTestFixture();
  1131. ParamsWithLogging simulcast;
  1132. simulcast.call.send_side_bwe = true;
  1133. simulcast.video[0] = {true, 1920, 1080, 30, 800000, 2500000,
  1134. 2500000, false, "VP8", 3, 2, 400000,
  1135. false, false, false, "Generator"};
  1136. simulcast.analyzer = {"simulcast_HD_high", 0.0, 0.0,
  1137. kFullStackTestDurationSecs};
  1138. simulcast.config->loss_percent = 0;
  1139. simulcast.config->queue_delay_ms = 100;
  1140. std::vector<VideoStream> streams = {
  1141. VideoQualityTest::DefaultVideoStream(simulcast, 0),
  1142. VideoQualityTest::DefaultVideoStream(simulcast, 0),
  1143. VideoQualityTest::DefaultVideoStream(simulcast, 0)};
  1144. simulcast.ss[0] = {
  1145. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1146. true};
  1147. webrtc::test::ScopedFieldTrials override_trials(AppendFieldTrials(
  1148. "WebRTC-ForceSimulatedOveruseIntervalMs/1000-50000-300/"));
  1149. fixture->RunWithAnalyzer(simulcast);
  1150. }
  1151. TEST(FullStackTest, SimulcastVP8_3SL_High) {
  1152. auto fixture = CreateVideoQualityTestFixture();
  1153. ParamsWithLogging simulcast;
  1154. simulcast.call.send_side_bwe = true;
  1155. simulcast.video[0] = SimulcastVp8VideoHigh();
  1156. simulcast.analyzer = {"simulcast_vp8_3sl_high", 0.0, 0.0,
  1157. kFullStackTestDurationSecs};
  1158. simulcast.config->loss_percent = 0;
  1159. simulcast.config->queue_delay_ms = 100;
  1160. ParamsWithLogging video_params_high;
  1161. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1162. ParamsWithLogging video_params_medium;
  1163. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1164. ParamsWithLogging video_params_low;
  1165. video_params_low.video[0] = SimulcastVp8VideoLow();
  1166. std::vector<VideoStream> streams = {
  1167. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1168. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1169. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1170. simulcast.ss[0] = {
  1171. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1172. false};
  1173. fixture->RunWithAnalyzer(simulcast);
  1174. }
  1175. TEST(FullStackTest, SimulcastVP8_3SL_Medium) {
  1176. auto fixture = CreateVideoQualityTestFixture();
  1177. ParamsWithLogging simulcast;
  1178. simulcast.call.send_side_bwe = true;
  1179. simulcast.video[0] = SimulcastVp8VideoHigh();
  1180. simulcast.analyzer = {"simulcast_vp8_3sl_medium", 0.0, 0.0,
  1181. kFullStackTestDurationSecs};
  1182. simulcast.config->loss_percent = 0;
  1183. simulcast.config->queue_delay_ms = 100;
  1184. ParamsWithLogging video_params_high;
  1185. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1186. ParamsWithLogging video_params_medium;
  1187. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1188. ParamsWithLogging video_params_low;
  1189. video_params_low.video[0] = SimulcastVp8VideoLow();
  1190. std::vector<VideoStream> streams = {
  1191. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1192. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1193. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1194. simulcast.ss[0] = {
  1195. streams, 1, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1196. false};
  1197. fixture->RunWithAnalyzer(simulcast);
  1198. }
  1199. TEST(FullStackTest, SimulcastVP8_3SL_Low) {
  1200. auto fixture = CreateVideoQualityTestFixture();
  1201. ParamsWithLogging simulcast;
  1202. simulcast.call.send_side_bwe = true;
  1203. simulcast.video[0] = SimulcastVp8VideoHigh();
  1204. simulcast.analyzer = {"simulcast_vp8_3sl_low", 0.0, 0.0,
  1205. kFullStackTestDurationSecs};
  1206. simulcast.config->loss_percent = 0;
  1207. simulcast.config->queue_delay_ms = 100;
  1208. ParamsWithLogging video_params_high;
  1209. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1210. ParamsWithLogging video_params_medium;
  1211. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1212. ParamsWithLogging video_params_low;
  1213. video_params_low.video[0] = SimulcastVp8VideoLow();
  1214. std::vector<VideoStream> streams = {
  1215. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1216. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1217. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1218. simulcast.ss[0] = {
  1219. streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1220. false};
  1221. fixture->RunWithAnalyzer(simulcast);
  1222. }
  1223. // This test assumes ideal network conditions with target bandwidth being
  1224. // available and exercises WebRTC calls with a high target bitrate(100 Mbps).
  1225. // Android32 bots can't handle this high bitrate, so disable test for those.
  1226. #if defined(WEBRTC_ANDROID)
  1227. #define MAYBE_HighBitrateWithFakeCodec DISABLED_HighBitrateWithFakeCodec
  1228. #else
  1229. #define MAYBE_HighBitrateWithFakeCodec HighBitrateWithFakeCodec
  1230. #endif // defined(WEBRTC_ANDROID)
  1231. TEST(FullStackTest, MAYBE_HighBitrateWithFakeCodec) {
  1232. auto fixture = CreateVideoQualityTestFixture();
  1233. const int target_bitrate = 100000000;
  1234. ParamsWithLogging generator;
  1235. generator.call.send_side_bwe = true;
  1236. generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate;
  1237. generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate;
  1238. generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate;
  1239. generator.video[0] = {true,
  1240. 360,
  1241. 240,
  1242. 30,
  1243. target_bitrate / 2,
  1244. target_bitrate,
  1245. target_bitrate * 2,
  1246. false,
  1247. "FakeCodec",
  1248. 1,
  1249. 0,
  1250. 0,
  1251. false,
  1252. false,
  1253. false,
  1254. "Generator"};
  1255. generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0,
  1256. kFullStackTestDurationSecs};
  1257. fixture->RunWithAnalyzer(generator);
  1258. }
  1259. TEST(FullStackTest, LargeRoomVP8_5thumb) {
  1260. auto fixture = CreateVideoQualityTestFixture();
  1261. ParamsWithLogging large_room;
  1262. large_room.call.send_side_bwe = true;
  1263. large_room.video[0] = SimulcastVp8VideoHigh();
  1264. large_room.analyzer = {"largeroom_5thumb", 0.0, 0.0,
  1265. kFullStackTestDurationSecs};
  1266. large_room.config->loss_percent = 0;
  1267. large_room.config->queue_delay_ms = 100;
  1268. ParamsWithLogging video_params_high;
  1269. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1270. ParamsWithLogging video_params_medium;
  1271. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1272. ParamsWithLogging video_params_low;
  1273. video_params_low.video[0] = SimulcastVp8VideoLow();
  1274. std::vector<VideoStream> streams = {
  1275. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1276. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1277. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1278. large_room.call.num_thumbnails = 5;
  1279. large_room.ss[0] = {
  1280. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1281. false};
  1282. fixture->RunWithAnalyzer(large_room);
  1283. }
  1284. #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
  1285. // Fails on mobile devices:
  1286. // https://bugs.chromium.org/p/webrtc/issues/detail?id=7301
  1287. #define MAYBE_LargeRoomVP8_50thumb DISABLED_LargeRoomVP8_50thumb
  1288. #define MAYBE_LargeRoomVP8_15thumb DISABLED_LargeRoomVP8_15thumb
  1289. #else
  1290. #define MAYBE_LargeRoomVP8_50thumb LargeRoomVP8_50thumb
  1291. #define MAYBE_LargeRoomVP8_15thumb LargeRoomVP8_15thumb
  1292. #endif
  1293. TEST(FullStackTest, MAYBE_LargeRoomVP8_15thumb) {
  1294. auto fixture = CreateVideoQualityTestFixture();
  1295. ParamsWithLogging large_room;
  1296. large_room.call.send_side_bwe = true;
  1297. large_room.video[0] = SimulcastVp8VideoHigh();
  1298. large_room.analyzer = {"largeroom_15thumb", 0.0, 0.0,
  1299. kFullStackTestDurationSecs};
  1300. large_room.config->loss_percent = 0;
  1301. large_room.config->queue_delay_ms = 100;
  1302. ParamsWithLogging video_params_high;
  1303. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1304. ParamsWithLogging video_params_medium;
  1305. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1306. ParamsWithLogging video_params_low;
  1307. video_params_low.video[0] = SimulcastVp8VideoLow();
  1308. std::vector<VideoStream> streams = {
  1309. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1310. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1311. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1312. large_room.call.num_thumbnails = 15;
  1313. large_room.ss[0] = {
  1314. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1315. false};
  1316. fixture->RunWithAnalyzer(large_room);
  1317. }
  1318. TEST(FullStackTest, MAYBE_LargeRoomVP8_50thumb) {
  1319. auto fixture = CreateVideoQualityTestFixture();
  1320. ParamsWithLogging large_room;
  1321. large_room.call.send_side_bwe = true;
  1322. large_room.video[0] = SimulcastVp8VideoHigh();
  1323. large_room.analyzer = {"largeroom_50thumb", 0.0, 0.0,
  1324. kFullStackTestDurationSecs};
  1325. large_room.config->loss_percent = 0;
  1326. large_room.config->queue_delay_ms = 100;
  1327. ParamsWithLogging video_params_high;
  1328. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1329. ParamsWithLogging video_params_medium;
  1330. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1331. ParamsWithLogging video_params_low;
  1332. video_params_low.video[0] = SimulcastVp8VideoLow();
  1333. std::vector<VideoStream> streams = {
  1334. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1335. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1336. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1337. large_room.call.num_thumbnails = 50;
  1338. large_room.ss[0] = {
  1339. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1340. false};
  1341. fixture->RunWithAnalyzer(large_room);
  1342. }
  1343. INSTANTIATE_TEST_SUITE_P(
  1344. FullStackTest,
  1345. GenericDescriptorTest,
  1346. ::testing::Values("WebRTC-GenericDescriptor/Disabled/",
  1347. "WebRTC-GenericDescriptor/Enabled/"));
  1348. class DualStreamsTest : public ::testing::TestWithParam<int> {};
  1349. // Disable dual video test on mobile device becuase it's too heavy.
  1350. // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on MAC.
  1351. #if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC)
  1352. TEST_P(DualStreamsTest,
  1353. ModeratelyRestricted_SlidesVp8_2TL_Simulcast_Video_Simulcast_High) {
  1354. const int first_stream = GetParam();
  1355. ParamsWithLogging dual_streams;
  1356. // Screenshare Settings.
  1357. dual_streams.screenshare[first_stream] = {true, false, 10};
  1358. dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
  1359. 2500000, false, "VP8", 2, 1, 400000,
  1360. false, false, false, ""};
  1361. ParamsWithLogging screenshare_params_high;
  1362. screenshare_params_high.video[0] = {
  1363. true, 1850, 1110, 60, 600000, 1250000, 1250000, false,
  1364. "VP8", 2, 0, 400000, false, false, false, ""};
  1365. VideoQualityTest::Params screenshare_params_low;
  1366. screenshare_params_low.video[0] = {true, 1850, 1110, 5, 30000, 200000,
  1367. 1000000, false, "VP8", 2, 0, 400000,
  1368. false, false, false, ""};
  1369. std::vector<VideoStream> screenhsare_streams = {
  1370. VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
  1371. VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
  1372. dual_streams.ss[first_stream] = {
  1373. screenhsare_streams, 1, 1, 0, InterLayerPredMode::kOn,
  1374. std::vector<SpatialLayer>(), false};
  1375. // Video settings.
  1376. dual_streams.video[1 - first_stream] = SimulcastVp8VideoHigh();
  1377. ParamsWithLogging video_params_high;
  1378. video_params_high.video[0] = SimulcastVp8VideoHigh();
  1379. ParamsWithLogging video_params_medium;
  1380. video_params_medium.video[0] = SimulcastVp8VideoMedium();
  1381. ParamsWithLogging video_params_low;
  1382. video_params_low.video[0] = SimulcastVp8VideoLow();
  1383. std::vector<VideoStream> streams = {
  1384. VideoQualityTest::DefaultVideoStream(video_params_low, 0),
  1385. VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
  1386. VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
  1387. dual_streams.ss[1 - first_stream] = {
  1388. streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
  1389. false};
  1390. // Call settings.
  1391. dual_streams.call.send_side_bwe = true;
  1392. dual_streams.call.dual_video = true;
  1393. std::string test_label = "dualstreams_moderately_restricted_screenshare_" +
  1394. std::to_string(first_stream);
  1395. dual_streams.analyzer = {test_label, 0.0, 0.0, kFullStackTestDurationSecs};
  1396. dual_streams.config->loss_percent = 1;
  1397. dual_streams.config->link_capacity_kbps = 7500;
  1398. dual_streams.config->queue_length_packets = 30;
  1399. dual_streams.config->queue_delay_ms = 100;
  1400. auto fixture = CreateVideoQualityTestFixture();
  1401. fixture->RunWithAnalyzer(dual_streams);
  1402. }
  1403. #endif // !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) &&
  1404. // !defined(WEBRTC_MAC)
  1405. TEST_P(DualStreamsTest, Conference_Restricted) {
  1406. const int first_stream = GetParam();
  1407. ParamsWithLogging dual_streams;
  1408. // Screenshare Settings.
  1409. dual_streams.screenshare[first_stream] = {true, false, 10};
  1410. dual_streams.video[first_stream] = {true, 1850, 1110, 5, 800000, 2500000,
  1411. 2500000, false, "VP8", 3, 2, 400000,
  1412. false, false, false, ""};
  1413. // Video settings.
  1414. dual_streams.video[1 - first_stream] = {
  1415. true, 1280,
  1416. 720, 30,
  1417. 150000, 500000,
  1418. 700000, false,
  1419. "VP8", 3,
  1420. 2, 400000,
  1421. false, false,
  1422. false, ClipNameToClipPath("ConferenceMotion_1280_720_50")};
  1423. // Call settings.
  1424. dual_streams.call.send_side_bwe = true;
  1425. dual_streams.call.dual_video = true;
  1426. std::string test_label = "dualstreams_conference_restricted_screenshare_" +
  1427. std::to_string(first_stream);
  1428. dual_streams.analyzer = {test_label, 0.0, 0.0, kFullStackTestDurationSecs};
  1429. dual_streams.config->loss_percent = 1;
  1430. dual_streams.config->link_capacity_kbps = 5000;
  1431. dual_streams.config->queue_length_packets = 30;
  1432. dual_streams.config->queue_delay_ms = 100;
  1433. auto fixture = CreateVideoQualityTestFixture();
  1434. fixture->RunWithAnalyzer(dual_streams);
  1435. }
  1436. INSTANTIATE_TEST_SUITE_P(FullStackTest,
  1437. DualStreamsTest,
  1438. ::testing::Values(0, 1));
  1439. } // namespace webrtc