blob: 276934850af8be7c7e95909d051a098d7a423031 [file] [log] [blame]
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +00001/*
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 <stdio.h>
11
kwiberg77eab702016-09-28 17:42:01 -070012#include "webrtc/test/gtest.h"
ivica5d6a06c2015-09-17 05:30:24 -070013#include "webrtc/video/video_quality_test.h"
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000014
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000015namespace webrtc {
16
brandtrdd369c62016-11-16 23:56:57 -080017static const int kFullStackTestDurationSecs = 45;
pbos@webrtc.orgb613b5a2013-12-03 10:13:04 +000018
ivica5d6a06c2015-09-17 05:30:24 -070019class FullStackTest : public VideoQualityTest {
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000020 public:
ivica5d6a06c2015-09-17 05:30:24 -070021 void RunTest(const VideoQualityTest::Params &params) {
22 RunWithAnalyzer(params);
pbos@webrtc.org94015242013-10-16 11:05:37 +000023 }
asapersson88b0a222016-02-12 13:16:43 -080024
25 void ForemanCifWithoutPacketLoss(const std::string& video_codec) {
26 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
minyue626bc952016-10-31 05:47:02 -070027 VideoQualityTest::Params foreman_cif;
28 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false,
brandtr1293aca2016-11-16 22:47:29 -080029 video_codec, 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -070030 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_" + video_codec,
31 0.0, 0.0, kFullStackTestDurationSecs};
asapersson88b0a222016-02-12 13:16:43 -080032 RunTest(foreman_cif);
33 }
34
brandtrdd369c62016-11-16 23:56:57 -080035 void ForemanCifPlr5(const std::string& video_codec,
36 bool use_ulpfec,
37 bool use_flexfec) {
minyue626bc952016-10-31 05:47:02 -070038 VideoQualityTest::Params foreman_cif;
39 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false,
brandtrdd369c62016-11-16 23:56:57 -080040 video_codec, 1, 0, 0, use_ulpfec, use_flexfec, "",
41 "foreman_cif"};
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};
asapersson88b0a222016-02-12 13:16:43 -080050 foreman_cif.pipe.loss_percent = 5;
51 foreman_cif.pipe.queue_delay_ms = 50;
52 RunTest(foreman_cif);
53 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000054};
55
sprangce4aef12015-11-02 07:23:20 -080056// VideoQualityTest::Params params = {
57// { ... }, // Common.
58// { ... }, // Video-specific settings.
59// { ... }, // Screenshare-specific settings.
60// { ... }, // Analyzer settings.
61// pipe, // FakeNetworkPipe::Config
62// { ... }, // Spatial scalability.
63// logs // bool
64// };
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000065
Peter Boström12996152016-05-14 02:03:18 +020066#if !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080067TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) {
68 ForemanCifWithoutPacketLoss("VP9");
69}
70
71TEST_F(FullStackTest, ForemanCifPlr5Vp9) {
brandtrdd369c62016-11-16 23:56:57 -080072 const bool kUlpfec = false;
73 const bool kFlexfec = false;
74 ForemanCifPlr5("VP9", kUlpfec, kFlexfec);
asapersson88b0a222016-02-12 13:16:43 -080075}
Peter Boström12996152016-05-14 02:03:18 +020076#endif // !defined(RTC_DISABLE_VP9)
asapersson88b0a222016-02-12 13:16:43 -080077
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000078TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
minyue626bc952016-10-31 05:47:02 -070079 VideoQualityTest::Params paris_qcif;
80 paris_qcif.call.send_side_bwe = true;
81 paris_qcif.video = {true, 176, 144, 30, 300000, 300000, 300000, false,
brandtr1293aca2016-11-16 22:47:29 -080082 "VP8", 1, 0, 0, false, false, "", "paris_qcif"};
minyue626bc952016-10-31 05:47:02 -070083 paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96,
84 kFullStackTestDurationSecs};
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000085 RunTest(paris_qcif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000086}
87
88TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) {
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000089 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
minyue626bc952016-10-31 05:47:02 -070090 VideoQualityTest::Params foreman_cif;
91 foreman_cif.call.send_side_bwe = true;
92 foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -080093 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -070094 foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0,
95 kFullStackTestDurationSecs};
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000096 RunTest(foreman_cif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000097}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000098
sprang@webrtc.org343096a2015-02-23 08:34:17 +000099TEST_F(FullStackTest, ForemanCifPlr5) {
minyue626bc952016-10-31 05:47:02 -0700100 VideoQualityTest::Params foreman_cif;
101 foreman_cif.call.send_side_bwe = true;
102 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800103 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700104 foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0,
105 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700106 foreman_cif.pipe.loss_percent = 5;
107 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.orgc216b9a2014-10-14 10:38:49 +0000108 RunTest(foreman_cif);
109}
110
brandtrdd369c62016-11-16 23:56:57 -0800111#if defined(WEBRTC_USE_H264)
112TEST_F(FullStackTest, ForemanCifWithoutPacketlossH264) {
113 ForemanCifWithoutPacketLoss("H264");
114}
115
116TEST_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.
123TEST_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.
131TEST_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
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000138TEST_F(FullStackTest, ForemanCif500kbps) {
minyue626bc952016-10-31 05:47:02 -0700139 VideoQualityTest::Params foreman_cif;
140 foreman_cif.call.send_side_bwe = true;
141 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800142 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700143 foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0,
144 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700145 foreman_cif.pipe.queue_length_packets = 0;
146 foreman_cif.pipe.queue_delay_ms = 0;
147 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000148 RunTest(foreman_cif);
149}
150
151TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
minyue626bc952016-10-31 05:47:02 -0700152 VideoQualityTest::Params foreman_cif;
153 foreman_cif.call.send_side_bwe = true;
154 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800155 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700156 foreman_cif.analyzer = {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0,
157 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700158 foreman_cif.pipe.queue_length_packets = 32;
159 foreman_cif.pipe.queue_delay_ms = 0;
160 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000161 RunTest(foreman_cif);
162}
163
164TEST_F(FullStackTest, ForemanCif500kbps100ms) {
minyue626bc952016-10-31 05:47:02 -0700165 VideoQualityTest::Params foreman_cif;
166 foreman_cif.call.send_side_bwe = true;
167 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800168 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700169 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms", 0.0, 0.0,
170 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700171 foreman_cif.pipe.queue_length_packets = 0;
172 foreman_cif.pipe.queue_delay_ms = 100;
173 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000174 RunTest(foreman_cif);
175}
176
177TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
minyue626bc952016-10-31 05:47:02 -0700178 VideoQualityTest::Params foreman_cif;
179 foreman_cif.call.send_side_bwe = true;
180 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800181 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700182 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
183 kFullStackTestDurationSecs};
stefanb1797672016-08-11 07:00:57 -0700184 foreman_cif.pipe.queue_length_packets = 32;
185 foreman_cif.pipe.queue_delay_ms = 100;
186 foreman_cif.pipe.link_capacity_kbps = 500;
187 RunTest(foreman_cif);
188}
189
190TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
minyue626bc952016-10-31 05:47:02 -0700191 VideoQualityTest::Params foreman_cif;
192 foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, "VP8",
brandtr1293aca2016-11-16 22:47:29 -0800193 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700194 foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
195 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700196 foreman_cif.pipe.queue_length_packets = 32;
197 foreman_cif.pipe.queue_delay_ms = 100;
198 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000199 RunTest(foreman_cif);
200}
201
202TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
minyue626bc952016-10-31 05:47:02 -0700203 VideoQualityTest::Params foreman_cif;
204 foreman_cif.call.send_side_bwe = true;
205 foreman_cif.video = {true, 352, 288, 30, 30000, 2000000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800206 "VP8", 1, 0, 0, false, false, "", "foreman_cif"};
minyue626bc952016-10-31 05:47:02 -0700207 foreman_cif.analyzer = {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
208 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700209 foreman_cif.pipe.queue_length_packets = 32;
210 foreman_cif.pipe.queue_delay_ms = 100;
211 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000212 RunTest(foreman_cif);
213}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000214
stefanb1797672016-08-11 07:00:57 -0700215TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) {
minyue626bc952016-10-31 05:47:02 -0700216 VideoQualityTest::Params conf_motion_hd;
217 conf_motion_hd.call.send_side_bwe = true;
218 conf_motion_hd.video = {true, 1280, 720, 50, 30000, 3000000, 3000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800219 "VP8", 1, 0, 0, false, false, "",
minyue626bc952016-10-31 05:47:02 -0700220 "ConferenceMotion_1280_720_50"};
221 conf_motion_hd.analyzer = {"conference_motion_hd_2000kbps_100ms_32pkts_queue",
222 0.0, 0.0, kFullStackTestDurationSecs};
stefanb1797672016-08-11 07:00:57 -0700223 conf_motion_hd.pipe.queue_length_packets = 32;
224 conf_motion_hd.pipe.queue_delay_ms = 100;
225 conf_motion_hd.pipe.link_capacity_kbps = 2000;
226 RunTest(conf_motion_hd);
227}
228
ivica7bd242e2015-10-06 02:04:06 -0700229TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
minyue626bc952016-10-31 05:47:02 -0700230 VideoQualityTest::Params screenshare;
231 screenshare.call.send_side_bwe = true;
232 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800233 "VP8", 2, 1, 400000, false, false, "", ""};
minyue626bc952016-10-31 05:47:02 -0700234 screenshare.screenshare = {true, 10};
235 screenshare.analyzer = {"screenshare_slides", 0.0, 0.0,
236 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700237 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200238}
239
ivica7bd242e2015-10-06 02:04:06 -0700240TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
minyue626bc952016-10-31 05:47:02 -0700241 VideoQualityTest::Params config;
242 config.call.send_side_bwe = true;
243 config.video = {true, 1850, 1110 / 2, 5, 50000, 200000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800244 "VP8", 2, 1, 400000, false, false, "", ""};
minyue626bc952016-10-31 05:47:02 -0700245 config.screenshare = {true, 10, 2};
246 config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
247 kFullStackTestDurationSecs};
ivica5d6a06c2015-09-17 05:30:24 -0700248 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700249}
250
sprangee37de32015-11-23 06:10:23 -0800251TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) {
minyue626bc952016-10-31 05:47:02 -0700252 VideoQualityTest::Params screenshare;
253 screenshare.call.send_side_bwe = true;
254 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800255 "VP8", 2, 1, 400000, false, false, "", ""};
minyue626bc952016-10-31 05:47:02 -0700256 screenshare.screenshare = {true, 10};
257 screenshare.analyzer = {"screenshare_slides_lossy_net", 0.0, 0.0,
258 kFullStackTestDurationSecs};
sprangee37de32015-11-23 06:10:23 -0800259 screenshare.pipe.loss_percent = 5;
260 screenshare.pipe.queue_delay_ms = 200;
261 screenshare.pipe.link_capacity_kbps = 500;
262 RunTest(screenshare);
263}
264
265TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
minyue626bc952016-10-31 05:47:02 -0700266 VideoQualityTest::Params screenshare;
267 screenshare.call.send_side_bwe = true;
268 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800269 "VP8", 2, 1, 400000, false, false, "", ""};
minyue626bc952016-10-31 05:47:02 -0700270 screenshare.screenshare = {true, 10};
271 screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
272 kFullStackTestDurationSecs};
sprangee37de32015-11-23 06:10:23 -0800273 screenshare.pipe.loss_percent = 10;
274 screenshare.pipe.queue_delay_ms = 200;
275 screenshare.pipe.link_capacity_kbps = 500;
276 RunTest(screenshare);
277}
278
Peter Boström12996152016-05-14 02:03:18 +0200279#if !defined(RTC_DISABLE_VP9)
philipelcfc319b2015-11-10 07:17:23 -0800280TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
minyue626bc952016-10-31 05:47:02 -0700281 VideoQualityTest::Params screenshare;
282 screenshare.call.send_side_bwe = true;
283 screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false,
brandtr1293aca2016-11-16 22:47:29 -0800284 "VP9", 1, 0, 400000, false, false, "", ""};
minyue626bc952016-10-31 05:47:02 -0700285 screenshare.screenshare = {true, 10};
286 screenshare.analyzer = {"screenshare_slides_vp9_2sl", 0.0, 0.0,
287 kFullStackTestDurationSecs};
288 screenshare.logs = false;
289 screenshare.ss = {std::vector<VideoStream>(), 0, 2, 1};
ivica5d6a06c2015-09-17 05:30:24 -0700290 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000291}
Peter Boström12996152016-05-14 02:03:18 +0200292#endif // !defined(RTC_DISABLE_VP9)
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000293} // namespace webrtc