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_ |
(...skipping 15 matching lines...) Expand all Loading... |
26 // which makes the implementation of VideoQualityTest a bit uglier. | 26 // which makes the implementation of VideoQualityTest a bit uglier. |
27 struct Params { | 27 struct Params { |
28 struct { | 28 struct { |
29 size_t width; | 29 size_t width; |
30 size_t height; | 30 size_t height; |
31 int32_t fps; | 31 int32_t fps; |
32 int min_bitrate_bps; | 32 int min_bitrate_bps; |
33 int target_bitrate_bps; | 33 int target_bitrate_bps; |
34 int max_bitrate_bps; | 34 int max_bitrate_bps; |
35 std::string codec; | 35 std::string codec; |
36 size_t num_temporal_layers; | 36 int num_temporal_layers; |
| 37 int selected_tl; |
37 int min_transmit_bps; | 38 int min_transmit_bps; |
38 | 39 |
39 Call::Config::BitrateConfig call_bitrate_config; | 40 Call::Config::BitrateConfig call_bitrate_config; |
40 size_t tl_discard_threshold; | |
41 bool send_side_bwe; | 41 bool send_side_bwe; |
42 } common; | 42 } common; |
43 struct { // Video-specific settings. | 43 struct { // Video-specific settings. |
44 std::string clip_name; | 44 std::string clip_name; |
45 } video; | 45 } video; |
46 struct { // Screenshare-specific settings. | 46 struct { // Screenshare-specific settings. |
47 bool enabled; | 47 bool enabled; |
48 int32_t slide_change_interval; | 48 int32_t slide_change_interval; |
49 int32_t scroll_duration; | 49 int32_t scroll_duration; |
50 } screenshare; | 50 } screenshare; |
51 struct { // Analyzer settings. | 51 struct { // Analyzer settings. |
52 std::string test_label; | 52 std::string test_label; |
53 double avg_psnr_threshold; | 53 double avg_psnr_threshold; // (*) |
54 double avg_ssim_threshold; | 54 double avg_ssim_threshold; // (*) |
55 int test_durations_secs; | 55 int test_durations_secs; |
56 std::string graph_data_output_filename; | 56 std::string graph_data_output_filename; |
| 57 std::string graph_title; |
57 } analyzer; | 58 } analyzer; |
58 FakeNetworkPipe::Config pipe; | 59 FakeNetworkPipe::Config pipe; |
59 bool logs; | 60 bool logs; |
| 61 struct { // Spatial scalability. |
| 62 std::vector<VideoStream> streams; // If empty, one stream is assumed. |
| 63 size_t selected_stream; |
| 64 int num_spatial_layers; |
| 65 int selected_sl; |
| 66 // If empty, bitrates are generated in VP9Impl automatically. |
| 67 std::vector<SpatialLayer> spatial_layers; |
| 68 } ss; |
60 }; | 69 }; |
| 70 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the |
| 71 // selected stream/layer doesn't have the same resolution as the largest |
| 72 // stream/layer (to ignore the PSNR and SSIM calculation errors). |
61 | 73 |
62 VideoQualityTest(); | 74 VideoQualityTest(); |
63 void RunWithAnalyzer(const Params& params); | 75 void RunWithAnalyzer(const Params& params); |
64 void RunWithVideoRenderer(const Params& params); | 76 void RunWithVideoRenderer(const Params& params); |
65 | 77 |
| 78 static void FillScalabilitySettings( |
| 79 Params* params, |
| 80 const std::vector<std::string>& stream_descriptors, |
| 81 size_t selected_stream, |
| 82 int num_spatial_layers, |
| 83 int selected_sl, |
| 84 const std::vector<std::string>& sl_descriptors); |
| 85 |
66 protected: | 86 protected: |
67 // No-op implementation to be able to instantiate this class from non-TEST_F | 87 // No-op implementation to be able to instantiate this class from non-TEST_F |
68 // locations. | 88 // locations. |
69 void TestBody() override; | 89 void TestBody() override; |
70 | 90 |
71 void CreateCapturer(const Params& params, VideoCaptureInput* input); | 91 // Helper methods accessing only params_. |
72 void ValidateParams(const Params& params); | 92 std::string GenerateGraphTitle() const; |
73 void SetupFullStack(const Params& params, | 93 void CheckParams(); |
74 Transport* send_transport, | 94 |
75 Transport* recv_transport); | 95 // Helper static methods. |
76 void SetupScreenshare(const Params& params); | 96 static VideoStream DefaultVideoStream(const Params& params); |
| 97 static std::vector<int> ParseCSV(const std::string& str); |
| 98 |
| 99 // Helper methods for setting up the call. |
| 100 void CreateCapturer(VideoCaptureInput* input); |
| 101 void SetupCommon(Transport* send_transport, Transport* recv_transport); |
| 102 void SetupScreenshare(); |
77 | 103 |
78 // We need a more general capturer than the FrameGeneratorCapturer. | 104 // We need a more general capturer than the FrameGeneratorCapturer. |
79 rtc::scoped_ptr<test::VideoCapturer> capturer_; | 105 rtc::scoped_ptr<test::VideoCapturer> capturer_; |
80 rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_; | 106 rtc::scoped_ptr<test::TraceToStderr> trace_to_stderr_; |
81 rtc::scoped_ptr<test::FrameGenerator> frame_generator_; | 107 rtc::scoped_ptr<test::FrameGenerator> frame_generator_; |
82 rtc::scoped_ptr<VideoEncoder> encoder_; | 108 rtc::scoped_ptr<VideoEncoder> encoder_; |
83 VideoCodecUnion codec_settings_; | 109 VideoCodecUnion codec_settings_; |
84 Clock* const clock_; | 110 Clock* const clock_; |
| 111 |
| 112 Params params_; |
85 }; | 113 }; |
86 | 114 |
87 } // namespace webrtc | 115 } // namespace webrtc |
88 | 116 |
89 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 117 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
OLD | NEW |