blob: 66ec49c8705ae92581861930847108fe29e8e9b3 [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
pbos@webrtc.org69215d82013-07-10 15:02:02 +000012#include "testing/gtest/include/gtest/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
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000017static const int kFullStackTestDurationSecs = 60;
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 }
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000024};
25
sprangce4aef12015-11-02 07:23:20 -080026// VideoQualityTest::Params params = {
27// { ... }, // Common.
28// { ... }, // Video-specific settings.
29// { ... }, // Screenshare-specific settings.
30// { ... }, // Analyzer settings.
31// pipe, // FakeNetworkPipe::Config
32// { ... }, // Spatial scalability.
33// logs // bool
34// };
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000035
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000036TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) {
ivica5d6a06c2015-09-17 05:30:24 -070037 VideoQualityTest::Params paris_qcif = {
38 {176, 144, 30, 300000, 300000, 300000, "VP8", 1},
39 {"paris_qcif"},
40 {},
41 {"net_delay_0_0_plr_0", 36.0, 0.96, kFullStackTestDurationSecs}};
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000042 RunTest(paris_qcif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000043}
44
45TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) {
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000046 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
ivica5d6a06c2015-09-17 05:30:24 -070047 VideoQualityTest::Params foreman_cif = {
48 {352, 288, 30, 700000, 700000, 700000, "VP8", 1},
49 {"foreman_cif"},
50 {},
51 {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs}
52 };
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000053 RunTest(foreman_cif);
pbos@webrtc.org994d0b72014-06-27 08:47:52 +000054}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +000055
sprang@webrtc.org343096a2015-02-23 08:34:17 +000056TEST_F(FullStackTest, ForemanCifPlr5) {
ivica5d6a06c2015-09-17 05:30:24 -070057 VideoQualityTest::Params foreman_cif = {
58 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
59 {"foreman_cif"},
60 {},
61 {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}};
62 foreman_cif.pipe.loss_percent = 5;
63 foreman_cif.pipe.queue_delay_ms = 50;
stefan@webrtc.orgc216b9a2014-10-14 10:38:49 +000064 RunTest(foreman_cif);
65}
66
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000067TEST_F(FullStackTest, ForemanCif500kbps) {
ivica5d6a06c2015-09-17 05:30:24 -070068 VideoQualityTest::Params foreman_cif = {
69 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
70 {"foreman_cif"},
71 {},
72 {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}};
73 foreman_cif.pipe.queue_length_packets = 0;
74 foreman_cif.pipe.queue_delay_ms = 0;
75 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000076 RunTest(foreman_cif);
77}
78
79TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -070080 VideoQualityTest::Params foreman_cif = {
81 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
82 {"foreman_cif"},
83 {},
84 {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}
85 };
86 foreman_cif.pipe.queue_length_packets = 32;
87 foreman_cif.pipe.queue_delay_ms = 0;
88 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +000089 RunTest(foreman_cif);
90}
91
92TEST_F(FullStackTest, ForemanCif500kbps100ms) {
ivica5d6a06c2015-09-17 05:30:24 -070093 VideoQualityTest::Params foreman_cif = {
94 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
95 {"foreman_cif"},
96 {},
97 {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}};
98 foreman_cif.pipe.queue_length_packets = 0;
99 foreman_cif.pipe.queue_delay_ms = 100;
100 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000101 RunTest(foreman_cif);
102}
103
104TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700105 VideoQualityTest::Params foreman_cif = {
106 {352, 288, 30, 30000, 500000, 2000000, "VP8", 1},
107 {"foreman_cif"},
108 {},
109 {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0,
110 kFullStackTestDurationSecs}};
111 foreman_cif.pipe.queue_length_packets = 32;
112 foreman_cif.pipe.queue_delay_ms = 100;
113 foreman_cif.pipe.link_capacity_kbps = 500;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000114 RunTest(foreman_cif);
115}
116
117TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) {
ivica5d6a06c2015-09-17 05:30:24 -0700118 VideoQualityTest::Params foreman_cif = {
ivica1356ba52015-09-22 01:09:11 -0700119 {352, 288, 30, 30000, 2000000, 2000000, "VP8", 1},
ivica5d6a06c2015-09-17 05:30:24 -0700120 {"foreman_cif"},
121 {},
122 {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0,
123 kFullStackTestDurationSecs}};
124 foreman_cif.pipe.queue_length_packets = 32;
125 foreman_cif.pipe.queue_delay_ms = 100;
126 foreman_cif.pipe.link_capacity_kbps = 1000;
stefan@webrtc.orgb8e9e442014-07-09 11:29:06 +0000127 RunTest(foreman_cif);
128}
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000129
ivica7bd242e2015-10-06 02:04:06 -0700130TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) {
ivica5d6a06c2015-09-17 05:30:24 -0700131 VideoQualityTest::Params screenshare = {
sprangce4aef12015-11-02 07:23:20 -0800132 {1850, 1110, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
133 {},
134 {true, 10},
ivica5d6a06c2015-09-17 05:30:24 -0700135 {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}};
136 RunTest(screenshare);
Erik Språng6ee69aa2015-09-03 15:58:05 +0200137}
138
ivica7bd242e2015-10-06 02:04:06 -0700139TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
ivica5d6a06c2015-09-17 05:30:24 -0700140 VideoQualityTest::Params config = {
sprangce4aef12015-11-02 07:23:20 -0800141 {1850, 1110 / 2, 5, 50000, 200000, 2000000, "VP8", 2, 1, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700142 {},
143 {true, 10, 2},
144 {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}};
145 RunTest(config);
ivica028cf482015-07-30 02:15:56 -0700146}
147
philipelcfc319b2015-11-10 07:17:23 -0800148TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) {
ivica5d6a06c2015-09-17 05:30:24 -0700149 VideoQualityTest::Params screenshare = {
philipelcfc319b2015-11-10 07:17:23 -0800150 {1850, 1110, 5, 50000, 200000, 2000000, "VP9", 1, 0, 400000},
ivica5d6a06c2015-09-17 05:30:24 -0700151 {},
152 {true, 10},
philipelcfc319b2015-11-10 07:17:23 -0800153 {"screenshare_slides_vp9_2tl", 0.0, 0.0, kFullStackTestDurationSecs},
154 {},
155 false,
156 {std::vector<VideoStream>(), 0, 2, 1}};
ivica5d6a06c2015-09-17 05:30:24 -0700157 RunTest(screenshare);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000158}
pbos@webrtc.orgaf8d5af2013-07-09 08:02:33 +0000159} // namespace webrtc