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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 FakeNetworkPipe::Config pipe; | 71 FakeNetworkPipe::Config pipe; |
72 bool logs; | 72 bool logs; |
73 struct { // Spatial scalability. | 73 struct { // Spatial scalability. |
74 std::vector<VideoStream> streams; // If empty, one stream is assumed. | 74 std::vector<VideoStream> streams; // If empty, one stream is assumed. |
75 size_t selected_stream; | 75 size_t selected_stream; |
76 int num_spatial_layers; | 76 int num_spatial_layers; |
77 int selected_sl; | 77 int selected_sl; |
78 // If empty, bitrates are generated in VP9Impl automatically. | 78 // If empty, bitrates are generated in VP9Impl automatically. |
79 std::vector<SpatialLayer> spatial_layers; | 79 std::vector<SpatialLayer> spatial_layers; |
80 } ss; | 80 } ss; |
81 int num_thumbnails; | |
82 }; | 81 }; |
| 82 // (*) Set to -1.1 if generating graph data for simulcast or SVC and the |
| 83 // selected stream/layer doesn't have the same resolution as the largest |
| 84 // stream/layer (to ignore the PSNR and SSIM calculation errors). |
83 | 85 |
84 VideoQualityTest(); | 86 VideoQualityTest(); |
85 void RunWithAnalyzer(const Params& params); | 87 void RunWithAnalyzer(const Params& params); |
86 void RunWithRenderers(const Params& params); | 88 void RunWithRenderers(const Params& params); |
87 | 89 |
88 static void FillScalabilitySettings( | 90 static void FillScalabilitySettings( |
89 Params* params, | 91 Params* params, |
90 const std::vector<std::string>& stream_descriptors, | 92 const std::vector<std::string>& stream_descriptors, |
91 size_t selected_stream, | 93 size_t selected_stream, |
92 int num_spatial_layers, | 94 int num_spatial_layers, |
93 int selected_sl, | 95 int selected_sl, |
94 const std::vector<std::string>& sl_descriptors); | 96 const std::vector<std::string>& sl_descriptors); |
95 | 97 |
96 protected: | 98 protected: |
97 // No-op implementation to be able to instantiate this class from non-TEST_F | 99 // No-op implementation to be able to instantiate this class from non-TEST_F |
98 // locations. | 100 // locations. |
99 void TestBody() override; | 101 void TestBody() override; |
100 | 102 |
101 // Helper methods accessing only params_. | 103 // Helper methods accessing only params_. |
102 std::string GenerateGraphTitle() const; | 104 std::string GenerateGraphTitle() const; |
103 void CheckParams(); | 105 void CheckParams(); |
104 | 106 |
105 // Helper static methods. | 107 // Helper static methods. |
106 static VideoStream DefaultVideoStream(const Params& params); | 108 static VideoStream DefaultVideoStream(const Params& params); |
107 static VideoStream DefaultThumbnailStream(); | |
108 static std::vector<int> ParseCSV(const std::string& str); | 109 static std::vector<int> ParseCSV(const std::string& str); |
109 | 110 |
110 // Helper methods for setting up the call. | 111 // Helper methods for setting up the call. |
111 void CreateCapturer(); | 112 void CreateCapturer(); |
112 void SetupThumbnailCapturers(size_t num_thumbnail_streams); | |
113 void SetupVideo(Transport* send_transport, Transport* recv_transport); | 113 void SetupVideo(Transport* send_transport, Transport* recv_transport); |
114 void SetupThumbnails(Transport* send_transport, Transport* recv_transport); | |
115 void DestroyThumbnailStreams(); | |
116 void SetupScreenshareOrSVC(); | 114 void SetupScreenshareOrSVC(); |
117 void SetupAudio(int send_channel_id, | 115 void SetupAudio(int send_channel_id, |
118 int receive_channel_id, | 116 int receive_channel_id, |
119 Call* call, | 117 Call* call, |
120 Transport* transport, | 118 Transport* transport, |
121 AudioReceiveStream** audio_receive_stream); | 119 AudioReceiveStream** audio_receive_stream); |
122 | 120 |
123 void StartEncodedFrameLogs(VideoSendStream* stream); | 121 void StartEncodedFrameLogs(VideoSendStream* stream); |
124 void StartEncodedFrameLogs(VideoReceiveStream* stream); | 122 void StartEncodedFrameLogs(VideoReceiveStream* stream); |
125 | 123 |
126 // We need a more general capturer than the FrameGeneratorCapturer. | 124 // We need a more general capturer than the FrameGeneratorCapturer. |
127 std::unique_ptr<test::VideoCapturer> video_capturer_; | 125 std::unique_ptr<test::VideoCapturer> video_capturer_; |
128 std::vector<std::unique_ptr<test::VideoCapturer>> thumbnail_capturers_; | |
129 std::unique_ptr<test::TraceToStderr> trace_to_stderr_; | 126 std::unique_ptr<test::TraceToStderr> trace_to_stderr_; |
130 std::unique_ptr<test::FrameGenerator> frame_generator_; | 127 std::unique_ptr<test::FrameGenerator> frame_generator_; |
131 std::unique_ptr<VideoEncoder> video_encoder_; | 128 std::unique_ptr<VideoEncoder> video_encoder_; |
132 std::vector<std::unique_ptr<VideoEncoder>> thumbnail_encoders_; | |
133 std::vector<VideoSendStream::Config> thumbnail_send_configs_; | |
134 std::vector<VideoEncoderConfig> thumbnail_encoder_configs_; | |
135 std::vector<VideoSendStream*> thumbnail_send_streams_; | |
136 std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_; | |
137 std::vector<VideoReceiveStream*> thumbnail_receive_streams_; | |
138 | |
139 Clock* const clock_; | 129 Clock* const clock_; |
140 | 130 |
141 int receive_logs_; | 131 int receive_logs_; |
142 int send_logs_; | 132 int send_logs_; |
143 | 133 |
144 VideoSendStream::DegradationPreference degradation_preference_ = | 134 VideoSendStream::DegradationPreference degradation_preference_ = |
145 VideoSendStream::DegradationPreference::kBalanced; | 135 VideoSendStream::DegradationPreference::kBalanced; |
146 Params params_; | 136 Params params_; |
147 }; | 137 }; |
148 | 138 |
149 } // namespace webrtc | 139 } // namespace webrtc |
150 | 140 |
151 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 141 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
OLD | NEW |