Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 2681683003: Added Vp9 simulcast tests. (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "webrtc/video/video_quality_test.h" 10 #include "webrtc/video/video_quality_test.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 public: 130 public:
131 VideoAnalyzer(test::LayerFilteringTransport* transport, 131 VideoAnalyzer(test::LayerFilteringTransport* transport,
132 const std::string& test_label, 132 const std::string& test_label,
133 double avg_psnr_threshold, 133 double avg_psnr_threshold,
134 double avg_ssim_threshold, 134 double avg_ssim_threshold,
135 int duration_frames, 135 int duration_frames,
136 FILE* graph_data_output_file, 136 FILE* graph_data_output_file,
137 const std::string& graph_title, 137 const std::string& graph_title,
138 uint32_t ssrc_to_analyze, 138 uint32_t ssrc_to_analyze,
139 uint32_t rtx_ssrc_to_analyze, 139 uint32_t rtx_ssrc_to_analyze,
140 uint32_t selected_width, 140 uint32_t selected_stream_width,
141 uint32_t selected_height, 141 uint32_t selected_stream_height,
142 bool is_quick_test_enabled) 142 bool is_quick_test_enabled)
143 : transport_(transport), 143 : transport_(transport),
144 receiver_(nullptr), 144 receiver_(nullptr),
145 send_stream_(nullptr), 145 send_stream_(nullptr),
146 receive_stream_(nullptr), 146 receive_stream_(nullptr),
147 captured_frame_forwarder_(this), 147 captured_frame_forwarder_(this),
148 test_label_(test_label), 148 test_label_(test_label),
149 graph_data_output_file_(graph_data_output_file), 149 graph_data_output_file_(graph_data_output_file),
150 graph_title_(graph_title), 150 graph_title_(graph_title),
151 ssrc_to_analyze_(ssrc_to_analyze), 151 ssrc_to_analyze_(ssrc_to_analyze),
152 rtx_ssrc_to_analyze_(rtx_ssrc_to_analyze), 152 rtx_ssrc_to_analyze_(rtx_ssrc_to_analyze),
153 selected_width_(selected_width), 153 selected_stream_width_(selected_stream_width),
154 selected_height_(selected_height), 154 selected_stream_height_(selected_stream_height),
155 pre_encode_proxy_(this), 155 pre_encode_proxy_(this),
156 encode_timing_proxy_(this), 156 encode_timing_proxy_(this),
157 frames_to_process_(duration_frames), 157 frames_to_process_(duration_frames),
158 frames_recorded_(0), 158 frames_recorded_(0),
159 frames_processed_(0), 159 frames_processed_(0),
160 dropped_frames_(0), 160 dropped_frames_(0),
161 dropped_frames_before_first_encode_(0), 161 dropped_frames_before_first_encode_(0),
162 dropped_frames_before_rendering_(0), 162 dropped_frames_before_rendering_(0),
163 last_render_time_(0), 163 last_render_time_(0),
164 rtp_timestamp_delta_(0), 164 rtp_timestamp_delta_(0),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 DeliveryStatus DeliverPacket(MediaType media_type, 226 DeliveryStatus DeliverPacket(MediaType media_type,
227 const uint8_t* packet, 227 const uint8_t* packet,
228 size_t length, 228 size_t length,
229 const PacketTime& packet_time) override { 229 const PacketTime& packet_time) override {
230 // Ignore timestamps of RTCP packets. They're not synchronized with 230 // Ignore timestamps of RTCP packets. They're not synchronized with
231 // RTP packet timestamps and so they would confuse wrap_handler_. 231 // RTP packet timestamps and so they would confuse wrap_handler_.
232 if (RtpHeaderParser::IsRtcp(packet, length)) { 232 if (RtpHeaderParser::IsRtcp(packet, length)) {
233 return receiver_->DeliverPacket(media_type, packet, length, packet_time); 233 return receiver_->DeliverPacket(media_type, packet, length, packet_time);
234 } 234 }
235
236 RtpUtility::RtpHeaderParser parser(packet, length); 235 RtpUtility::RtpHeaderParser parser(packet, length);
237 RTPHeader header; 236 RTPHeader header;
238 parser.Parse(&header); 237 parser.Parse(&header);
239 if (!IsFlexfec(header.payloadType) && 238 if (!IsFlexfec(header.payloadType) &&
240 (header.ssrc == ssrc_to_analyze_ || 239 (header.ssrc == ssrc_to_analyze_ ||
241 header.ssrc == rtx_ssrc_to_analyze_)) { 240 header.ssrc == rtx_ssrc_to_analyze_)) {
242 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. 241 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps.
243 // (FlexFEC and media are sent on different SSRCs, which have different 242 // (FlexFEC and media are sent on different SSRCs, which have different
244 // timestamps spaces.) 243 // timestamps spaces.)
245 // Also ignore packets from wrong SSRC, but include retransmits. 244 // Also ignore packets from wrong SSRC, but include retransmits.
(...skipping 21 matching lines...) Expand all
267 RTC_CHECK(!frames_.empty()); 266 RTC_CHECK(!frames_.empty());
268 } 267 }
269 first_encoded_timestamp_ = 268 first_encoded_timestamp_ =
270 rtc::Optional<uint32_t>(video_frame.timestamp()); 269 rtc::Optional<uint32_t>(video_frame.timestamp());
271 } 270 }
272 } 271 }
273 272
274 void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) { 273 void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) {
275 rtc::CritScope lock(&crit_); 274 rtc::CritScope lock(&crit_);
276 if (!first_sent_timestamp_ && 275 if (!first_sent_timestamp_ &&
277 encoded_frame.encoded_width_ == selected_width_ && 276 encoded_frame.encoded_width_ == selected_stream_width_ &&
278 encoded_frame.encoded_height_ == selected_height_) { 277 encoded_frame.encoded_height_ == selected_stream_height_) {
279 first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_); 278 first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_);
280 } 279 }
281 } 280 }
282 281
283 bool SendRtp(const uint8_t* packet, 282 bool SendRtp(const uint8_t* packet,
284 size_t length, 283 size_t length,
285 const PacketOptions& options) override { 284 const PacketOptions& options) override {
286 RtpUtility::RtpHeaderParser parser(packet, length); 285 RtpUtility::RtpHeaderParser parser(packet, length);
287 RTPHeader header; 286 RTPHeader header;
288 parser.Parse(&header); 287 parser.Parse(&header);
289 288
290 int64_t current_time = 289 int64_t current_time =
291 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); 290 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
291
292 bool result = transport_->SendRtp(packet, length, options); 292 bool result = transport_->SendRtp(packet, length, options);
293 { 293 {
294 rtc::CritScope lock(&crit_); 294 rtc::CritScope lock(&crit_);
295 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) { 295 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) {
296 RTC_CHECK(static_cast<bool>(first_sent_timestamp_)); 296 RTC_CHECK(static_cast<bool>(first_sent_timestamp_));
297 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_; 297 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_;
298 } 298 }
299 299
300 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { 300 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) {
301 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. 301 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps.
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } 850 }
851 851
852 VideoSendStream* send_stream_; 852 VideoSendStream* send_stream_;
853 VideoReceiveStream* receive_stream_; 853 VideoReceiveStream* receive_stream_;
854 CapturedFrameForwarder captured_frame_forwarder_; 854 CapturedFrameForwarder captured_frame_forwarder_;
855 const std::string test_label_; 855 const std::string test_label_;
856 FILE* const graph_data_output_file_; 856 FILE* const graph_data_output_file_;
857 const std::string graph_title_; 857 const std::string graph_title_;
858 const uint32_t ssrc_to_analyze_; 858 const uint32_t ssrc_to_analyze_;
859 const uint32_t rtx_ssrc_to_analyze_; 859 const uint32_t rtx_ssrc_to_analyze_;
860 const uint32_t selected_width_; 860 const uint32_t selected_stream_width_;
861 const uint32_t selected_height_; 861 const uint32_t selected_stream_height_;
862 PreEncodeProxy pre_encode_proxy_; 862 PreEncodeProxy pre_encode_proxy_;
863 OnEncodeTimingProxy encode_timing_proxy_; 863 OnEncodeTimingProxy encode_timing_proxy_;
864 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); 864 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_);
865 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); 865 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_);
866 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); 866 test::Statistics sender_time_ GUARDED_BY(comparison_lock_);
867 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); 867 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_);
868 test::Statistics psnr_ GUARDED_BY(comparison_lock_); 868 test::Statistics psnr_ GUARDED_BY(comparison_lock_);
869 test::Statistics ssim_ GUARDED_BY(comparison_lock_); 869 test::Statistics ssim_ GUARDED_BY(comparison_lock_);
870 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); 870 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_);
871 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); 871 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_);
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 video_send_config_.rtp.ulpfec.red_payload_type; 1199 video_send_config_.rtp.ulpfec.red_payload_type;
1200 video_receive_configs_[params_.ss.selected_stream] 1200 video_receive_configs_[params_.ss.selected_stream]
1201 .rtp.ulpfec.ulpfec_payload_type = 1201 .rtp.ulpfec.ulpfec_payload_type =
1202 video_send_config_.rtp.ulpfec.ulpfec_payload_type; 1202 video_send_config_.rtp.ulpfec.ulpfec_payload_type;
1203 video_receive_configs_[params_.ss.selected_stream] 1203 video_receive_configs_[params_.ss.selected_stream]
1204 .rtp.ulpfec.red_rtx_payload_type = 1204 .rtp.ulpfec.red_rtx_payload_type =
1205 video_send_config_.rtp.ulpfec.red_rtx_payload_type; 1205 video_send_config_.rtp.ulpfec.red_rtx_payload_type;
1206 } 1206 }
1207 } 1207 }
1208 1208
1209 void VideoQualityTest::SetupScreenshare() { 1209 void VideoQualityTest::SetupScreenshareOrSVC() {
1210 RTC_CHECK(params_.screenshare.enabled); 1210 if (params_.screenshare.enabled) {
1211 // Fill out codec settings.
1212 video_encoder_config_.content_type =
1213 VideoEncoderConfig::ContentType::kScreen;
1214 degradation_preference_ =
1215 VideoSendStream::DegradationPreference::kMaintainResolution;
1216 if (params_.video.codec == "VP8") {
1217 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings();
1218 vp8_settings.denoisingOn = false;
1219 vp8_settings.frameDroppingOn = false;
1220 vp8_settings.numberOfTemporalLayers =
1221 static_cast<unsigned char>(params_.video.num_temporal_layers);
1222 video_encoder_config_.encoder_specific_settings =
1223 new rtc::RefCountedObject<
1224 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
1225 } else if (params_.video.codec == "VP9") {
1226 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1227 vp9_settings.denoisingOn = false;
1228 vp9_settings.frameDroppingOn = false;
1229 vp9_settings.numberOfTemporalLayers =
1230 static_cast<unsigned char>(params_.video.num_temporal_layers);
1231 vp9_settings.numberOfSpatialLayers =
1232 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1233 video_encoder_config_.encoder_specific_settings =
1234 new rtc::RefCountedObject<
1235 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1236 }
1237 // Setup frame generator.
1238 const size_t kWidth = 1850;
1239 const size_t kHeight = 1110;
1240 std::vector<std::string> slides;
1241 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1242 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1243 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1244 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1211 1245
1212 // Fill out codec settings. 1246 if (params_.screenshare.scroll_duration == 0) {
1213 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; 1247 // Cycle image every slide_change_interval seconds.
1214 degradation_preference_ = 1248 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile(
1215 VideoSendStream::DegradationPreference::kMaintainResolution; 1249 slides, kWidth, kHeight,
1216 if (params_.video.codec == "VP8") { 1250 params_.screenshare.slide_change_interval * params_.video.fps));
1217 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); 1251 } else {
1218 vp8_settings.denoisingOn = false; 1252 RTC_CHECK_LE(params_.video.width, kWidth);
1219 vp8_settings.frameDroppingOn = false; 1253 RTC_CHECK_LE(params_.video.height, kHeight);
1220 vp8_settings.numberOfTemporalLayers = 1254 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1221 static_cast<unsigned char>(params_.video.num_temporal_layers); 1255 const int kPauseDurationMs = (params_.screenshare.slide_change_interval -
1222 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1256 params_.screenshare.scroll_duration) *
1223 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings); 1257 1000;
1224 } else if (params_.video.codec == "VP9") { 1258 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1259 params_.screenshare.slide_change_interval);
1260
1261 frame_generator_.reset(
1262 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1263 clock_, slides, kWidth, kHeight, params_.video.width,
1264 params_.video.height, params_.screenshare.scroll_duration * 1000,
1265 kPauseDurationMs));
1266 }
1267 } else if (params_.ss.num_spatial_layers > 1) { // For non-screenshare case.
1268 RTC_CHECK(params_.video.codec == "VP9");
1225 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); 1269 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1226 vp9_settings.denoisingOn = false;
1227 vp9_settings.frameDroppingOn = false;
1228 vp9_settings.numberOfTemporalLayers = 1270 vp9_settings.numberOfTemporalLayers =
1229 static_cast<unsigned char>(params_.video.num_temporal_layers); 1271 static_cast<unsigned char>(params_.video.num_temporal_layers);
1230 vp9_settings.numberOfSpatialLayers = 1272 vp9_settings.numberOfSpatialLayers =
1231 static_cast<unsigned char>(params_.ss.num_spatial_layers); 1273 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1232 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1274 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
1233 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); 1275 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1234 } 1276 }
1235
1236 // Setup frame generator.
1237 const size_t kWidth = 1850;
1238 const size_t kHeight = 1110;
1239 std::vector<std::string> slides;
1240 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1241 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1242 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1243 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1244
1245 if (params_.screenshare.scroll_duration == 0) {
1246 // Cycle image every slide_change_interval seconds.
1247 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile(
1248 slides, kWidth, kHeight,
1249 params_.screenshare.slide_change_interval * params_.video.fps));
1250 } else {
1251 RTC_CHECK_LE(params_.video.width, kWidth);
1252 RTC_CHECK_LE(params_.video.height, kHeight);
1253 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1254 const int kPauseDurationMs = (params_.screenshare.slide_change_interval -
1255 params_.screenshare.scroll_duration) *
1256 1000;
1257 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1258 params_.screenshare.slide_change_interval);
1259
1260 frame_generator_.reset(
1261 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1262 clock_, slides, kWidth, kHeight, params_.video.width,
1263 params_.video.height, params_.screenshare.scroll_duration * 1000,
1264 kPauseDurationMs));
1265 }
1266 } 1277 }
1267 1278
1268 void VideoQualityTest::CreateCapturer() { 1279 void VideoQualityTest::CreateCapturer() {
1269 if (params_.screenshare.enabled) { 1280 if (params_.screenshare.enabled) {
1270 test::FrameGeneratorCapturer* frame_generator_capturer = 1281 test::FrameGeneratorCapturer* frame_generator_capturer =
1271 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(), 1282 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(),
1272 params_.video.fps); 1283 params_.video.fps);
1273 EXPECT_TRUE(frame_generator_capturer->Init()); 1284 EXPECT_TRUE(frame_generator_capturer->Init());
1274 video_capturer_.reset(frame_generator_capturer); 1285 video_capturer_.reset(frame_generator_capturer);
1275 } else { 1286 } else {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 std::string graph_title = params_.analyzer.graph_title; 1336 std::string graph_title = params_.analyzer.graph_title;
1326 if (graph_title.empty()) 1337 if (graph_title.empty())
1327 graph_title = VideoQualityTest::GenerateGraphTitle(); 1338 graph_title = VideoQualityTest::GenerateGraphTitle();
1328 1339
1329 // In the case of different resolutions, the functions calculating PSNR and 1340 // In the case of different resolutions, the functions calculating PSNR and
1330 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer 1341 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer
1331 // aborts if the average psnr/ssim are below the given threshold, which is 1342 // aborts if the average psnr/ssim are below the given threshold, which is
1332 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary 1343 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary
1333 // abort. 1344 // abort.
1334 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream]; 1345 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream];
1335 int selected_sl = params_.ss.selected_sl != -1
1336 ? params_.ss.selected_sl
1337 : params_.ss.num_spatial_layers - 1;
1338 bool disable_quality_check =
1339 selected_stream.width != params_.video.width ||
1340 selected_stream.height != params_.video.height ||
1341 (!params_.ss.spatial_layers.empty() &&
1342 params_.ss.spatial_layers[selected_sl].scaling_factor_num !=
1343 params_.ss.spatial_layers[selected_sl].scaling_factor_den);
1344 if (disable_quality_check) {
1345 fprintf(stderr,
1346 "Warning: Calculating PSNR and SSIM for downsized resolution "
1347 "not implemented yet! Skipping PSNR and SSIM calculations!\n");
1348 }
1349 1346
1350 bool is_quick_test_enabled = 1347 bool is_quick_test_enabled =
1351 field_trial::FindFullName("WebRTC-QuickPerfTest") == "Enabled"; 1348 field_trial::FindFullName("WebRTC-QuickPerfTest") == "Enabled";
1352 VideoAnalyzer analyzer( 1349 VideoAnalyzer analyzer(
1353 &send_transport, params_.analyzer.test_label, 1350 &send_transport, params_.analyzer.test_label,
1354 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold, 1351
1355 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold, 1352 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold,
1356 is_quick_test_enabled 1353 is_quick_test_enabled
1357 ? kFramesSentInQuickTest 1354 ? kFramesSentInQuickTest
1358 : params_.analyzer.test_durations_secs * params_.video.fps, 1355 : params_.analyzer.test_durations_secs * params_.video.fps,
1359 graph_data_output_file, graph_title, 1356 graph_data_output_file, graph_title,
1360 kVideoSendSsrcs[params_.ss.selected_stream], 1357 kVideoSendSsrcs[params_.ss.selected_stream],
1361 kSendRtxSsrcs[params_.ss.selected_stream], 1358 kSendRtxSsrcs[params_.ss.selected_stream],
1362 static_cast<uint32_t>(selected_stream.width), 1359 static_cast<uint32_t>(selected_stream.width),
1363 static_cast<uint32_t>(selected_stream.height), is_quick_test_enabled); 1360 static_cast<uint32_t>(selected_stream.height), is_quick_test_enabled);
1364 analyzer.SetReceiver(receiver_call_->Receiver()); 1361 analyzer.SetReceiver(receiver_call_->Receiver());
1365 send_transport.SetReceiver(&analyzer); 1362 send_transport.SetReceiver(&analyzer);
1366 recv_transport.SetReceiver(sender_call_->Receiver()); 1363 recv_transport.SetReceiver(sender_call_->Receiver());
1367 1364
1368 SetupVideo(&analyzer, &recv_transport); 1365 SetupVideo(&analyzer, &recv_transport);
1369 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; 1366 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer;
1370 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); 1367 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy();
1371 for (auto& config : video_receive_configs_) 1368 for (auto& config : video_receive_configs_)
1372 config.pre_decode_callback = &analyzer; 1369 config.pre_decode_callback = &analyzer;
1373 RTC_DCHECK(!video_send_config_.post_encode_callback); 1370 RTC_DCHECK(!video_send_config_.post_encode_callback);
1374 video_send_config_.post_encode_callback = analyzer.encode_timing_proxy(); 1371 video_send_config_.post_encode_callback = analyzer.encode_timing_proxy();
1375 1372
1376 if (params_.screenshare.enabled) 1373 SetupScreenshareOrSVC();
1377 SetupScreenshare();
1378 1374
1379 CreateFlexfecStreams(); 1375 CreateFlexfecStreams();
1380 CreateVideoStreams(); 1376 CreateVideoStreams();
1381 analyzer.SetSendStream(video_send_stream_); 1377 analyzer.SetSendStream(video_send_stream_);
1382 if (video_receive_streams_.size() == 1) 1378 if (video_receive_streams_.size() == 1)
1383 analyzer.SetReceiveStream(video_receive_streams_[0]); 1379 analyzer.SetReceiveStream(video_receive_streams_[0]);
1384 1380
1385 video_send_stream_->SetSource(analyzer.OutputInterface(), 1381 video_send_stream_->SetSource(analyzer.OutputInterface(),
1386 degradation_preference_); 1382 degradation_preference_);
1387 1383
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 title.c_str(), params_.ss.streams[stream_id].width, 1502 title.c_str(), params_.ss.streams[stream_id].width,
1507 params_.ss.streams[stream_id].height)); 1503 params_.ss.streams[stream_id].height));
1508 1504
1509 SetupVideo(&transport, &transport); 1505 SetupVideo(&transport, &transport);
1510 video_send_config_.pre_encode_callback = local_preview.get(); 1506 video_send_config_.pre_encode_callback = local_preview.get();
1511 video_receive_configs_[stream_id].renderer = loopback_video.get(); 1507 video_receive_configs_[stream_id].renderer = loopback_video.get();
1512 if (params_.audio.enabled && params_.audio.sync_video) 1508 if (params_.audio.enabled && params_.audio.sync_video)
1513 video_receive_configs_[stream_id].sync_group = kSyncGroup; 1509 video_receive_configs_[stream_id].sync_group = kSyncGroup;
1514 1510
1515 if (params_.screenshare.enabled) 1511 if (params_.screenshare.enabled)
1516 SetupScreenshare(); 1512 SetupScreenshareOrSVC();
1517 1513
1518 video_send_stream_ = call->CreateVideoSendStream( 1514 video_send_stream_ = call->CreateVideoSendStream(
1519 video_send_config_.Copy(), video_encoder_config_.Copy()); 1515 video_send_config_.Copy(), video_encoder_config_.Copy());
1520 if (params_.video.flexfec) { 1516 if (params_.video.flexfec) {
1521 RTC_DCHECK(!flexfec_receive_configs_.empty()); 1517 RTC_DCHECK(!flexfec_receive_configs_.empty());
1522 flexfec_receive_stream = 1518 flexfec_receive_stream =
1523 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]); 1519 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]);
1524 } 1520 }
1525 video_receive_stream = call->CreateVideoReceiveStream( 1521 video_receive_stream = call->CreateVideoReceiveStream(
1526 video_receive_configs_[stream_id].Copy()); 1522 video_receive_configs_[stream_id].Copy());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 std::ostringstream str; 1604 std::ostringstream str;
1609 str << receive_logs_++; 1605 str << receive_logs_++;
1610 std::string path = 1606 std::string path =
1611 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1607 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1612 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1608 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1613 10000000); 1609 10000000);
1614 } 1610 }
1615 } 1611 }
1616 1612
1617 } // namespace webrtc 1613 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698