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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } ss; | 86 } ss; |
87 struct Logging { | 87 struct Logging { |
88 bool logs; | 88 bool logs; |
89 std::string rtc_event_log_name; | 89 std::string rtc_event_log_name; |
90 std::string rtp_dump_name; | 90 std::string rtp_dump_name; |
91 std::string encoded_frame_base_path; | 91 std::string encoded_frame_base_path; |
92 } logging; | 92 } logging; |
93 }; | 93 }; |
94 | 94 |
95 VideoQualityTest(); | 95 VideoQualityTest(); |
96 void RunWithAnalyzer(const Params& params); | 96 void SetupCall(const Call::Config::BitrateConfig& bitrate_config, |
97 void RunWithRenderers(const Params& params); | 97 const FakeNetworkPipe::Config& pipe_cofing); |
| 98 void AddParams(const Params& p); |
| 99 void RunWithRenderers(); |
98 | 100 |
99 static void FillScalabilitySettings( | 101 static void FillScalabilitySettings( |
100 Params* params, | 102 Params* params, |
101 const std::vector<std::string>& stream_descriptors, | 103 const std::vector<std::string>& stream_descriptors, |
102 int num_streams, | 104 int num_streams, |
103 size_t selected_stream, | 105 size_t selected_stream, |
104 int num_spatial_layers, | 106 int num_spatial_layers, |
105 int selected_sl, | 107 int selected_sl, |
106 const std::vector<std::string>& sl_descriptors); | 108 const std::vector<std::string>& sl_descriptors); |
107 | 109 |
108 protected: | 110 protected: |
109 std::map<uint8_t, webrtc::MediaType> payload_type_map_; | 111 std::map<uint8_t, webrtc::MediaType> payload_type_map_; |
110 | 112 |
111 // No-op implementation to be able to instantiate this class from non-TEST_F | 113 // No-op implementation to be able to instantiate this class from non-TEST_F |
112 // locations. | 114 // locations. |
113 void TestBody() override; | 115 void TestBody() override; |
114 | 116 |
115 // Helper methods accessing only params_. | 117 // Helper methods accessing only params_. |
116 std::string GenerateGraphTitle() const; | 118 std::string GenerateGraphTitle() const; |
117 void CheckParams(); | 119 void CheckParams(Params* params); |
118 | 120 |
119 // Helper static methods. | 121 // Helper static methods. |
120 static VideoStream DefaultVideoStream(const Params& params); | 122 static VideoStream DefaultVideoStream(const Params& params); |
121 static VideoStream DefaultThumbnailStream(); | 123 static VideoStream DefaultThumbnailStream(); |
122 static std::vector<int> ParseCSV(const std::string& str); | 124 static std::vector<int> ParseCSV(const std::string& str); |
123 | 125 |
124 // Helper methods for setting up the call. | 126 // Helper methods for setting up the call. |
125 void CreateCapturer(); | 127 void CreateCapturer(Params* params, |
| 128 std::unique_ptr<test::VideoCapturer>* video_capturer_); |
126 void SetupThumbnailCapturers(size_t num_thumbnail_streams); | 129 void SetupThumbnailCapturers(size_t num_thumbnail_streams); |
127 void SetupVideo(Transport* send_transport, Transport* recv_transport); | 130 void SetupVideo( |
| 131 Transport* send_transport, |
| 132 Transport* recv_transport, |
| 133 Params* params, |
| 134 VideoSendStream::Config* video_send_config, |
| 135 VideoEncoderConfig* video_encoder_config, |
| 136 std::unique_ptr<VideoEncoder>* video_encoder, |
| 137 std::vector<VideoReceiveStream::Config>* video_receive_configs, |
| 138 std::vector<std::unique_ptr<VideoDecoder>>* allocated_decoders, |
| 139 std::vector<uint32_t>* send_ssrcs, |
| 140 std::vector<uint32_t>* send_rtx_ssrcs); |
128 void SetupThumbnails(Transport* send_transport, Transport* recv_transport); | 141 void SetupThumbnails(Transport* send_transport, Transport* recv_transport); |
129 void DestroyThumbnailStreams(); | 142 void DestroyThumbnailStreams(); |
130 void SetupScreenshareOrSVC(); | 143 void SetupScreenshareOrSVC( |
| 144 Params* params, |
| 145 VideoEncoderConfig* video_encoder_config, |
| 146 std::unique_ptr<test::FrameGenerator>* frame_generator); |
131 void SetupAudio(int send_channel_id, | 147 void SetupAudio(int send_channel_id, |
132 int receive_channel_id, | 148 int receive_channel_id, |
133 Transport* transport, | 149 Transport* transport, |
134 AudioReceiveStream** audio_receive_stream); | 150 AudioReceiveStream** audio_receive_stream); |
135 | 151 |
136 void StartEncodedFrameLogs(VideoSendStream* stream); | 152 void StartEncodedFrameLogs(Params* params, VideoSendStream* stream); |
137 void StartEncodedFrameLogs(VideoReceiveStream* stream); | 153 void StartEncodedFrameLogs(Params* params, VideoReceiveStream* stream); |
138 | 154 |
139 // We need a more general capturer than the FrameGeneratorCapturer. | 155 // We need a more general capturer than the FrameGeneratorCapturer. |
140 std::unique_ptr<test::VideoCapturer> video_capturer_; | 156 std::unique_ptr<test::VideoCapturer> video_capturer_; |
141 std::vector<std::unique_ptr<test::VideoCapturer>> thumbnail_capturers_; | 157 std::vector<std::unique_ptr<test::VideoCapturer>> thumbnail_capturers_; |
142 std::unique_ptr<test::TraceToStderr> trace_to_stderr_; | 158 std::unique_ptr<test::TraceToStderr> trace_to_stderr_; |
143 std::unique_ptr<test::FrameGenerator> frame_generator_; | 159 std::unique_ptr<test::FrameGenerator> frame_generator_; |
144 std::unique_ptr<VideoEncoder> video_encoder_; | 160 std::unique_ptr<VideoEncoder> video_encoder_; |
145 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> vp8_encoder_factory_; | 161 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> vp8_encoder_factory_; |
146 | 162 |
147 std::vector<std::unique_ptr<VideoEncoder>> thumbnail_encoders_; | 163 std::vector<std::unique_ptr<VideoEncoder>> thumbnail_encoders_; |
148 std::vector<VideoSendStream::Config> thumbnail_send_configs_; | 164 std::vector<VideoSendStream::Config> thumbnail_send_configs_; |
149 std::vector<VideoEncoderConfig> thumbnail_encoder_configs_; | 165 std::vector<VideoEncoderConfig> thumbnail_encoder_configs_; |
150 std::vector<VideoSendStream*> thumbnail_send_streams_; | 166 std::vector<VideoSendStream*> thumbnail_send_streams_; |
151 std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_; | 167 std::vector<VideoReceiveStream::Config> thumbnail_receive_configs_; |
152 std::vector<VideoReceiveStream*> thumbnail_receive_streams_; | 168 std::vector<VideoReceiveStream*> thumbnail_receive_streams_; |
153 | 169 |
154 Clock* const clock_; | 170 Clock* const clock_; |
155 | 171 |
156 int receive_logs_; | 172 int receive_logs_; |
157 int send_logs_; | 173 int send_logs_; |
158 | 174 |
159 VideoSendStream::DegradationPreference degradation_preference_ = | 175 VideoSendStream::DegradationPreference degradation_preference_ = |
160 VideoSendStream::DegradationPreference::kMaintainFramerate; | 176 VideoSendStream::DegradationPreference::kMaintainFramerate; |
161 Params params_; | 177 |
| 178 std::vector<Params> params_; |
| 179 |
| 180 Call::Config::BitrateConfig bitrate_config_; |
| 181 FakeNetworkPipe::Config pipe_config_; |
| 182 std::unique_ptr<test::DirectTransport> send_transport_; |
| 183 std::unique_ptr<test::DirectTransport> recv_transport_; |
| 184 uint32_t last_ssrc = 10000; |
162 }; | 185 }; |
163 | 186 |
164 } // namespace webrtc | 187 } // namespace webrtc |
165 | 188 |
166 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ | 189 #endif // WEBRTC_VIDEO_VIDEO_QUALITY_TEST_H_ |
OLD | NEW |