OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 | 11 |
12 #include "webrtc/test/gtest.h" | 12 #include "webrtc/test/gtest.h" |
13 #include "webrtc/video/video_quality_test.h" | 13 #include "webrtc/video/video_quality_test.h" |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 static const int kFullStackTestDurationSecs = 60; | 17 static const int kFullStackTestDurationSecs = 45; |
18 | 18 |
19 class FullStackTest : public VideoQualityTest { | 19 class FullStackTest : public VideoQualityTest { |
20 public: | 20 public: |
21 void RunTest(const VideoQualityTest::Params ¶ms) { | 21 void RunTest(const VideoQualityTest::Params ¶ms) { |
22 RunWithAnalyzer(params); | 22 RunWithAnalyzer(params); |
23 } | 23 } |
24 | 24 |
25 void ForemanCifWithoutPacketLoss(const std::string& video_codec) { | 25 void ForemanCifWithoutPacketLoss(const std::string& video_codec) { |
26 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. | 26 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
27 VideoQualityTest::Params foreman_cif; | 27 VideoQualityTest::Params foreman_cif; |
28 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, | 28 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, |
29 video_codec, 1, 0, 0, false, false, "", "foreman_cif"}; | 29 video_codec, 1, 0, 0, false, false, "", "foreman_cif"}; |
30 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_" + video_codec, | 30 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_" + video_codec, |
31 0.0, 0.0, kFullStackTestDurationSecs}; | 31 0.0, 0.0, kFullStackTestDurationSecs}; |
32 RunTest(foreman_cif); | 32 RunTest(foreman_cif); |
33 } | 33 } |
34 | 34 |
35 void ForemanCifPlr5(const std::string& video_codec) { | 35 void ForemanCifPlr5(const std::string& video_codec, |
| 36 bool use_ulpfec, |
| 37 bool use_flexfec) { |
36 VideoQualityTest::Params foreman_cif; | 38 VideoQualityTest::Params foreman_cif; |
37 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, | 39 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, |
38 video_codec, 1, 0, 0, false, false, "", "foreman_cif"}; | 40 video_codec, 1, 0, 0, use_ulpfec, use_flexfec, "", |
39 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_" + video_codec, 0.0, | 41 "foreman_cif"}; |
40 0.0, kFullStackTestDurationSecs}; | 42 std::string fec_description; |
| 43 if (use_ulpfec) |
| 44 fec_description += "_ulpfec"; |
| 45 if (use_flexfec) |
| 46 fec_description += "_flexfec"; |
| 47 foreman_cif.analyzer = { |
| 48 "foreman_cif_delay_50_0_plr_5_" + video_codec + fec_description, 0.0, |
| 49 0.0, kFullStackTestDurationSecs}; |
41 foreman_cif.pipe.loss_percent = 5; | 50 foreman_cif.pipe.loss_percent = 5; |
42 foreman_cif.pipe.queue_delay_ms = 50; | 51 foreman_cif.pipe.queue_delay_ms = 50; |
43 RunTest(foreman_cif); | 52 RunTest(foreman_cif); |
44 } | 53 } |
45 }; | 54 }; |
46 | 55 |
47 // VideoQualityTest::Params params = { | 56 // VideoQualityTest::Params params = { |
48 // { ... }, // Common. | 57 // { ... }, // Common. |
49 // { ... }, // Video-specific settings. | 58 // { ... }, // Video-specific settings. |
50 // { ... }, // Screenshare-specific settings. | 59 // { ... }, // Screenshare-specific settings. |
51 // { ... }, // Analyzer settings. | 60 // { ... }, // Analyzer settings. |
52 // pipe, // FakeNetworkPipe::Config | 61 // pipe, // FakeNetworkPipe::Config |
53 // { ... }, // Spatial scalability. | 62 // { ... }, // Spatial scalability. |
54 // logs // bool | 63 // logs // bool |
55 // }; | 64 // }; |
56 | 65 |
57 #if !defined(RTC_DISABLE_VP9) | 66 #if !defined(RTC_DISABLE_VP9) |
58 TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) { | 67 TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) { |
59 ForemanCifWithoutPacketLoss("VP9"); | 68 ForemanCifWithoutPacketLoss("VP9"); |
60 } | 69 } |
61 | 70 |
62 TEST_F(FullStackTest, ForemanCifPlr5Vp9) { | 71 TEST_F(FullStackTest, ForemanCifPlr5Vp9) { |
63 ForemanCifPlr5("VP9"); | 72 const bool kUlpfec = false; |
| 73 const bool kFlexfec = false; |
| 74 ForemanCifPlr5("VP9", kUlpfec, kFlexfec); |
64 } | 75 } |
65 #endif // !defined(RTC_DISABLE_VP9) | 76 #endif // !defined(RTC_DISABLE_VP9) |
66 | 77 |
67 TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { | 78 TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { |
68 VideoQualityTest::Params paris_qcif; | 79 VideoQualityTest::Params paris_qcif; |
69 paris_qcif.call.send_side_bwe = true; | 80 paris_qcif.call.send_side_bwe = true; |
70 paris_qcif.video = {true, 176, 144, 30, 300000, 300000, 300000, false, | 81 paris_qcif.video = {true, 176, 144, 30, 300000, 300000, 300000, false, |
71 "VP8", 1, 0, 0, false, false, "", "paris_qcif"}; | 82 "VP8", 1, 0, 0, false, false, "", "paris_qcif"}; |
72 paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96, | 83 paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96, |
73 kFullStackTestDurationSecs}; | 84 kFullStackTestDurationSecs}; |
(...skipping 16 matching lines...) Expand all Loading... |
90 foreman_cif.call.send_side_bwe = true; | 101 foreman_cif.call.send_side_bwe = true; |
91 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8", | 102 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8", |
92 1, 0, 0, false, false, "", "foreman_cif"}; | 103 1, 0, 0, false, false, "", "foreman_cif"}; |
93 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, | 104 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, |
94 kFullStackTestDurationSecs}; | 105 kFullStackTestDurationSecs}; |
95 foreman_cif.pipe.loss_percent = 5; | 106 foreman_cif.pipe.loss_percent = 5; |
96 foreman_cif.pipe.queue_delay_ms = 50; | 107 foreman_cif.pipe.queue_delay_ms = 50; |
97 RunTest(foreman_cif); | 108 RunTest(foreman_cif); |
98 } | 109 } |
99 | 110 |
| 111 #if defined(WEBRTC_USE_H264) |
| 112 TEST_F(FullStackTest, ForemanCifWithoutPacketlossH264) { |
| 113 ForemanCifWithoutPacketLoss("H264"); |
| 114 } |
| 115 |
| 116 TEST_F(FullStackTest, ForemanCifPlr5H264) { |
| 117 const bool kUlpfec = false; |
| 118 const bool kFlexfec = false; |
| 119 ForemanCifPlr5("H264", kUlpfec, kFlexfec); |
| 120 } |
| 121 |
| 122 // Verify that this is worth the bot time, before enabling. |
| 123 TEST_F(FullStackTest, ForemanCifPlr5H264Flexfec) { |
| 124 const bool kUlpfec = false; |
| 125 const bool kFlexfec = true; |
| 126 ForemanCifPlr5("H264", kUlpfec, kFlexfec); |
| 127 } |
| 128 |
| 129 // Ulpfec with H264 is an unsupported combination, so this test is only useful |
| 130 // for debugging. It is therefore disabled by default. |
| 131 TEST_F(FullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) { |
| 132 const bool kUlpfec = true; |
| 133 const bool kFlexfec = false; |
| 134 ForemanCifPlr5("H264", kUlpfec, kFlexfec); |
| 135 } |
| 136 #endif // defined(WEBRTC_USE_H264) |
| 137 |
100 TEST_F(FullStackTest, ForemanCif500kbps) { | 138 TEST_F(FullStackTest, ForemanCif500kbps) { |
101 VideoQualityTest::Params foreman_cif; | 139 VideoQualityTest::Params foreman_cif; |
102 foreman_cif.call.send_side_bwe = true; | 140 foreman_cif.call.send_side_bwe = true; |
103 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8", | 141 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8", |
104 1, 0, 0, false, false, "", "foreman_cif"}; | 142 1, 0, 0, false, false, "", "foreman_cif"}; |
105 foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0, | 143 foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0, |
106 kFullStackTestDurationSecs}; | 144 kFullStackTestDurationSecs}; |
107 foreman_cif.pipe.queue_length_packets = 0; | 145 foreman_cif.pipe.queue_length_packets = 0; |
108 foreman_cif.pipe.queue_delay_ms = 0; | 146 foreman_cif.pipe.queue_delay_ms = 0; |
109 foreman_cif.pipe.link_capacity_kbps = 500; | 147 foreman_cif.pipe.link_capacity_kbps = 500; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 "VP9", 1, 0, 400000, false, false, "", ""}; | 284 "VP9", 1, 0, 400000, false, false, "", ""}; |
247 screenshare.screenshare = {true, 10}; | 285 screenshare.screenshare = {true, 10}; |
248 screenshare.analyzer = {"screenshare_slides_vp9_2sl", 0.0, 0.0, | 286 screenshare.analyzer = {"screenshare_slides_vp9_2sl", 0.0, 0.0, |
249 kFullStackTestDurationSecs}; | 287 kFullStackTestDurationSecs}; |
250 screenshare.logs = false; | 288 screenshare.logs = false; |
251 screenshare.ss = {std::vector<VideoStream>(), 0, 2, 1}; | 289 screenshare.ss = {std::vector<VideoStream>(), 0, 2, 1}; |
252 RunTest(screenshare); | 290 RunTest(screenshare); |
253 } | 291 } |
254 #endif // !defined(RTC_DISABLE_VP9) | 292 #endif // !defined(RTC_DISABLE_VP9) |
255 } // namespace webrtc | 293 } // namespace webrtc |
OLD | NEW |