OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 10 #ifndef WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 11 #define WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
12 | 12 |
13 #include <memory> | 13 #include <memory> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/test/call_test.h" | 17 #include "webrtc/test/call_test.h" |
18 #include "webrtc/test/frame_generator.h" | 18 #include "webrtc/test/frame_generator.h" |
19 #include "webrtc/test/testsupport/trace_to_stderr.h" | 19 #include "webrtc/test/testsupport/trace_to_stderr.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 class VideoQualityTest : public test::CallTest { | 23 class VideoQualityTest : public test::CallTest { |
24 public: | 24 public: |
25 // Parameters are grouped into smaller structs to make it easier to set | 25 // Parameters are grouped into smaller structs to make it easier to set |
26 // the desired elements and skip unused, using aggregate initialization. | 26 // the desired elements and skip unused, using aggregate initialization. |
27 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, | 27 // Unfortunately, C++11 (as opposed to C11) doesn't support unnamed structs, |
28 // which makes the implementation of VideoQualityTest a bit uglier. | 28 // which makes the implementation of VideoQualityTest a bit uglier. |
29 struct Params { | 29 struct Params { |
30 Params(); | |
31 ~Params(); | |
32 struct { | 30 struct { |
33 bool send_side_bwe; | |
34 Call::Config::BitrateConfig call_bitrate_config; | |
35 } call; | |
36 struct { | |
37 bool enabled; | |
38 size_t width; | 31 size_t width; |
39 size_t height; | 32 size_t height; |
40 int32_t fps; | 33 int32_t fps; |
41 int min_bitrate_bps; | 34 int min_bitrate_bps; |
42 int target_bitrate_bps; | 35 int target_bitrate_bps; |
43 int max_bitrate_bps; | 36 int max_bitrate_bps; |
44 bool suspend_below_min_bitrate; | 37 bool suspend_below_min_bitrate; |
45 std::string codec; | 38 std::string codec; |
46 int num_temporal_layers; | 39 int num_temporal_layers; |
47 int selected_tl; | 40 int selected_tl; |
48 int min_transmit_bps; | 41 int min_transmit_bps; |
| 42 bool send_side_bwe; |
49 bool fec; | 43 bool fec; |
50 std::string encoded_frame_base_path; | 44 std::string encoded_frame_base_path; |
| 45 |
| 46 Call::Config::BitrateConfig call_bitrate_config; |
| 47 } common; |
| 48 struct { // Video-specific settings. |
51 std::string clip_name; | 49 std::string clip_name; |
52 } video; | 50 } video; |
53 struct { | 51 struct { // Screenshare-specific settings. |
54 bool enabled; | |
55 bool sync_video; | |
56 } audio; | |
57 struct { | |
58 bool enabled; | 52 bool enabled; |
59 int32_t slide_change_interval; | 53 int32_t slide_change_interval; |
60 int32_t scroll_duration; | 54 int32_t scroll_duration; |
61 } screenshare; | 55 } screenshare; |
62 struct { | 56 struct { // Analyzer settings. |
63 std::string test_label; | 57 std::string test_label; |
64 double avg_psnr_threshold; // (*) | 58 double avg_psnr_threshold; // (*) |
65 double avg_ssim_threshold; // (*) | 59 double avg_ssim_threshold; // (*) |
66 int test_durations_secs; | 60 int test_durations_secs; |
67 std::string graph_data_output_filename; | 61 std::string graph_data_output_filename; |
68 std::string graph_title; | 62 std::string graph_title; |
69 } analyzer; | 63 } analyzer; |
70 FakeNetworkPipe::Config pipe; | 64 FakeNetworkPipe::Config pipe; |
71 bool logs; | 65 bool logs; |
72 struct { // Spatial scalability. | 66 struct { // Spatial scalability. |
73 std::vector<VideoStream> streams; // If empty, one stream is assumed. | 67 std::vector<VideoStream> streams; // If empty, one stream is assumed. |
74 size_t selected_stream; | 68 size_t selected_stream; |
75 int num_spatial_layers; | 69 int num_spatial_layers; |
76 int selected_sl; | 70 int selected_sl; |
77 // If empty, bitrates are generated in VP9Impl automatically. | 71 // If empty, bitrates are generated in VP9Impl automatically. |
78 std::vector<SpatialLayer> spatial_layers; | 72 std::vector<SpatialLayer> spatial_layers; |
79 } ss; | 73 } ss; |
| 74 bool audio; |
| 75 bool audio_video_sync; |
80 }; | 76 }; |
81 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the | 77 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the |
82 // selected stream/layer doesn't have the same resolution as the largest | 78 // selected stream/layer doesn't have the same resolution as the largest |
83 // stream/layer (to ignore the PSNR and SSIM calculation errors). | 79 // stream/layer (to ignore the PSNR and SSIM calculation errors). |
84 | 80 |
85 VideoQualityTest(); | 81 VideoQualityTest(); |
86 void RunWithAnalyzer(const Params& params); | 82 void RunWithAnalyzer(const Params& params); |
87 void RunWithRenderers(const Params& params); | 83 void RunWithRenderers(const Params& params); |
88 | 84 |
89 static void FillScalabilitySettings( | 85 static void FillScalabilitySettings( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 120 |
125 int receive_logs_; | 121 int receive_logs_; |
126 int send_logs_; | 122 int send_logs_; |
127 | 123 |
128 Params params_; | 124 Params params_; |
129 }; | 125 }; |
130 | 126 |
131 } // namespace webrtc | 127 } // namespace webrtc |
132 | 128 |
133 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 129 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
OLD | NEW |