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

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

Issue 2681683003: Added Vp9 simulcast tests. (Closed)
Patch Set: Rebased on latest commits and resolved conflicts 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
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 public EncodedFrameObserver { 127 public EncodedFrameObserver {
128 public: 128 public:
129 VideoAnalyzer(test::LayerFilteringTransport* transport, 129 VideoAnalyzer(test::LayerFilteringTransport* transport,
130 const std::string& test_label, 130 const std::string& test_label,
131 double avg_psnr_threshold, 131 double avg_psnr_threshold,
132 double avg_ssim_threshold, 132 double avg_ssim_threshold,
133 int duration_frames, 133 int duration_frames,
134 FILE* graph_data_output_file, 134 FILE* graph_data_output_file,
135 const std::string& graph_title, 135 const std::string& graph_title,
136 uint32_t ssrc_to_analyze, 136 uint32_t ssrc_to_analyze,
137 uint32_t selected_width, 137 uint32_t selected_stream_width,
138 uint32_t selected_height) 138 uint32_t selected_stream_height)
139 : transport_(transport), 139 : transport_(transport),
140 receiver_(nullptr), 140 receiver_(nullptr),
141 send_stream_(nullptr), 141 send_stream_(nullptr),
142 receive_stream_(nullptr), 142 receive_stream_(nullptr),
143 captured_frame_forwarder_(this), 143 captured_frame_forwarder_(this),
144 test_label_(test_label), 144 test_label_(test_label),
145 graph_data_output_file_(graph_data_output_file), 145 graph_data_output_file_(graph_data_output_file),
146 graph_title_(graph_title), 146 graph_title_(graph_title),
147 ssrc_to_analyze_(ssrc_to_analyze), 147 ssrc_to_analyze_(ssrc_to_analyze),
148 selected_width_(selected_width), 148 selected_stream_width_(selected_stream_width),
149 selected_height_(selected_height), 149 selected_stream_height_(selected_stream_height),
150 pre_encode_proxy_(this), 150 pre_encode_proxy_(this),
151 encode_timing_proxy_(this), 151 encode_timing_proxy_(this),
152 frames_to_process_(duration_frames), 152 frames_to_process_(duration_frames),
153 frames_recorded_(0), 153 frames_recorded_(0),
154 frames_processed_(0), 154 frames_processed_(0),
155 dropped_frames_(0), 155 dropped_frames_(0),
156 dropped_frames_before_first_encode_(0), 156 dropped_frames_before_first_encode_(0),
157 dropped_frames_before_rendering_(0), 157 dropped_frames_before_rendering_(0),
158 last_render_time_(0), 158 last_render_time_(0),
159 rtp_timestamp_delta_(0), 159 rtp_timestamp_delta_(0),
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 DeliveryStatus DeliverPacket(MediaType media_type, 220 DeliveryStatus DeliverPacket(MediaType media_type,
221 const uint8_t* packet, 221 const uint8_t* packet,
222 size_t length, 222 size_t length,
223 const PacketTime& packet_time) override { 223 const PacketTime& packet_time) override {
224 // Ignore timestamps of RTCP packets. They're not synchronized with 224 // Ignore timestamps of RTCP packets. They're not synchronized with
225 // RTP packet timestamps and so they would confuse wrap_handler_. 225 // RTP packet timestamps and so they would confuse wrap_handler_.
226 if (RtpHeaderParser::IsRtcp(packet, length)) { 226 if (RtpHeaderParser::IsRtcp(packet, length)) {
227 return receiver_->DeliverPacket(media_type, packet, length, packet_time); 227 return receiver_->DeliverPacket(media_type, packet, length, packet_time);
228 } 228 }
229
230 RtpUtility::RtpHeaderParser parser(packet, length); 229 RtpUtility::RtpHeaderParser parser(packet, length);
231 RTPHeader header; 230 RTPHeader header;
232 parser.Parse(&header); 231 parser.Parse(&header);
232
233 if (!IsFlexfec(header.payloadType) && header.ssrc != ssrc_to_analyze_) { 233 if (!IsFlexfec(header.payloadType) && header.ssrc != ssrc_to_analyze_) {
234 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. 234 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps.
235 // (FlexFEC and media are sent on different SSRCs, which have different 235 // (FlexFEC and media are sent on different SSRCs, which have different
236 // timestamps spaces.) 236 // timestamps spaces.)
237 // Also ignore packets from wrong SSRC. 237 // Also ignore packets from wrong SSRC.
238 rtc::CritScope lock(&crit_); 238 rtc::CritScope lock(&crit_);
239 int64_t timestamp = 239 int64_t timestamp =
240 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_); 240 wrap_handler_.Unwrap(header.timestamp - rtp_timestamp_delta_);
241 recv_times_[timestamp] = 241 recv_times_[timestamp] =
242 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); 242 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
(...skipping 16 matching lines...) Expand all
259 RTC_CHECK(!frames_.empty()); 259 RTC_CHECK(!frames_.empty());
260 } 260 }
261 first_encoded_timestamp_ = 261 first_encoded_timestamp_ =
262 rtc::Optional<uint32_t>(video_frame.timestamp()); 262 rtc::Optional<uint32_t>(video_frame.timestamp());
263 } 263 }
264 } 264 }
265 265
266 void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) { 266 void PostEncodeFrameCallback(const EncodedFrame& encoded_frame) {
267 rtc::CritScope lock(&crit_); 267 rtc::CritScope lock(&crit_);
268 if (!first_sent_timestamp_ && 268 if (!first_sent_timestamp_ &&
269 encoded_frame.encoded_width_ == selected_width_ && 269 encoded_frame.encoded_width_ == selected_stream_width_ &&
270 encoded_frame.encoded_height_ == selected_height_) { 270 encoded_frame.encoded_height_ == selected_stream_height_) {
271 first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_); 271 first_sent_timestamp_ = rtc::Optional<uint32_t>(encoded_frame.timestamp_);
272 } 272 }
273 } 273 }
274 274
275 bool SendRtp(const uint8_t* packet, 275 bool SendRtp(const uint8_t* packet,
276 size_t length, 276 size_t length,
277 const PacketOptions& options) override { 277 const PacketOptions& options) override {
278 RtpUtility::RtpHeaderParser parser(packet, length); 278 RtpUtility::RtpHeaderParser parser(packet, length);
279 RTPHeader header; 279 RTPHeader header;
280 parser.Parse(&header); 280 parser.Parse(&header);
281 281
282 int64_t current_time = 282 int64_t current_time =
283 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); 283 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
284
284 bool result = transport_->SendRtp(packet, length, options); 285 bool result = transport_->SendRtp(packet, length, options);
285 { 286 {
286 rtc::CritScope lock(&crit_); 287 rtc::CritScope lock(&crit_);
287 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) { 288 if (rtp_timestamp_delta_ == 0 && header.ssrc == ssrc_to_analyze_) {
288 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_; 289 rtp_timestamp_delta_ = header.timestamp - *first_sent_timestamp_;
289 } 290 }
290 291
291 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) { 292 if (!IsFlexfec(header.payloadType) && header.ssrc == ssrc_to_analyze_) {
292 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps. 293 // Ignore FlexFEC timestamps, to avoid collisions with media timestamps.
293 // (FlexFEC and media are sent on different SSRCs, which have different 294 // (FlexFEC and media are sent on different SSRCs, which have different
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 frames_.push_back(video_frame); 838 frames_.push_back(video_frame);
838 } 839 }
839 840
840 VideoSendStream* send_stream_; 841 VideoSendStream* send_stream_;
841 VideoReceiveStream* receive_stream_; 842 VideoReceiveStream* receive_stream_;
842 CapturedFrameForwarder captured_frame_forwarder_; 843 CapturedFrameForwarder captured_frame_forwarder_;
843 const std::string test_label_; 844 const std::string test_label_;
844 FILE* const graph_data_output_file_; 845 FILE* const graph_data_output_file_;
845 const std::string graph_title_; 846 const std::string graph_title_;
846 const uint32_t ssrc_to_analyze_; 847 const uint32_t ssrc_to_analyze_;
847 const uint32_t selected_width_; 848 const uint32_t selected_stream_width_;
848 const uint32_t selected_height_; 849 const uint32_t selected_stream_height_;
849 PreEncodeProxy pre_encode_proxy_; 850 PreEncodeProxy pre_encode_proxy_;
850 OnEncodeTimingProxy encode_timing_proxy_; 851 OnEncodeTimingProxy encode_timing_proxy_;
851 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_); 852 std::vector<Sample> samples_ GUARDED_BY(comparison_lock_);
852 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_); 853 std::map<int64_t, int> samples_encode_time_ms_ GUARDED_BY(comparison_lock_);
853 test::Statistics sender_time_ GUARDED_BY(comparison_lock_); 854 test::Statistics sender_time_ GUARDED_BY(comparison_lock_);
854 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_); 855 test::Statistics receiver_time_ GUARDED_BY(comparison_lock_);
855 test::Statistics psnr_ GUARDED_BY(comparison_lock_); 856 test::Statistics psnr_ GUARDED_BY(comparison_lock_);
856 test::Statistics ssim_ GUARDED_BY(comparison_lock_); 857 test::Statistics ssim_ GUARDED_BY(comparison_lock_);
857 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_); 858 test::Statistics end_to_end_ GUARDED_BY(comparison_lock_);
858 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_); 859 test::Statistics rendered_delta_ GUARDED_BY(comparison_lock_);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 video_send_config_.rtp.ulpfec.red_payload_type; 1183 video_send_config_.rtp.ulpfec.red_payload_type;
1183 video_receive_configs_[params_.ss.selected_stream] 1184 video_receive_configs_[params_.ss.selected_stream]
1184 .rtp.ulpfec.ulpfec_payload_type = 1185 .rtp.ulpfec.ulpfec_payload_type =
1185 video_send_config_.rtp.ulpfec.ulpfec_payload_type; 1186 video_send_config_.rtp.ulpfec.ulpfec_payload_type;
1186 video_receive_configs_[params_.ss.selected_stream] 1187 video_receive_configs_[params_.ss.selected_stream]
1187 .rtp.ulpfec.red_rtx_payload_type = 1188 .rtp.ulpfec.red_rtx_payload_type =
1188 video_send_config_.rtp.ulpfec.red_rtx_payload_type; 1189 video_send_config_.rtp.ulpfec.red_rtx_payload_type;
1189 } 1190 }
1190 } 1191 }
1191 1192
1192 void VideoQualityTest::SetupScreenshare() { 1193 void VideoQualityTest::SetupScreenshareOrSimulcast() {
1193 RTC_CHECK(params_.screenshare.enabled); 1194 if (params_.screenshare.enabled) {
1195 // Fill out codec settings.
1196 video_encoder_config_.content_type =
1197 VideoEncoderConfig::ContentType::kScreen;
1198 // Fill out codec settings.
1199 video_encoder_config_.content_type =
1200 VideoEncoderConfig::ContentType::kScreen;
1201 degradation_preference_ =
1202 VideoSendStream::DegradationPreference::kMaintainResolution;
1203 if (params_.video.codec == "VP8") {
1204 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings();
1205 vp8_settings.denoisingOn = false;
1206 vp8_settings.frameDroppingOn = false;
1207 vp8_settings.numberOfTemporalLayers =
1208 static_cast<unsigned char>(params_.video.num_temporal_layers);
1209 video_encoder_config_.encoder_specific_settings =
1210 new rtc::RefCountedObject<
1211 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings);
1212 } else if (params_.video.codec == "VP9") {
1213 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1214 vp9_settings.denoisingOn = false;
1215 vp9_settings.frameDroppingOn = false;
1216 vp9_settings.numberOfTemporalLayers =
1217 static_cast<unsigned char>(params_.video.num_temporal_layers);
1218 vp9_settings.numberOfSpatialLayers =
1219 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1220 video_encoder_config_.encoder_specific_settings =
1221 new rtc::RefCountedObject<
1222 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1223 }
1224 // Setup frame generator.
1225 const size_t kWidth = 1850;
1226 const size_t kHeight = 1110;
1227 std::vector<std::string> slides;
1228 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1229 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1230 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1231 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1194 1232
1195 // Fill out codec settings. 1233 if (params_.screenshare.scroll_duration == 0) {
1196 video_encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; 1234 // Cycle image every slide_change_interval seconds.
1197 degradation_preference_ = 1235 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile(
1198 VideoSendStream::DegradationPreference::kMaintainResolution; 1236 slides, kWidth, kHeight,
1199 if (params_.video.codec == "VP8") { 1237 params_.screenshare.slide_change_interval * params_.video.fps));
1200 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); 1238 } else {
1201 vp8_settings.denoisingOn = false; 1239 RTC_CHECK_LE(params_.video.width, kWidth);
1202 vp8_settings.frameDroppingOn = false; 1240 RTC_CHECK_LE(params_.video.height, kHeight);
1203 vp8_settings.numberOfTemporalLayers = 1241 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1204 static_cast<unsigned char>(params_.video.num_temporal_layers); 1242 const int kPauseDurationMs = (params_.screenshare.slide_change_interval -
1205 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1243 params_.screenshare.scroll_duration) *
1206 VideoEncoderConfig::Vp8EncoderSpecificSettings>(vp8_settings); 1244 1000;
1207 } else if (params_.video.codec == "VP9") { 1245 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1246 params_.screenshare.slide_change_interval);
1247
1248 frame_generator_.reset(
1249 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1250 clock_, slides, kWidth, kHeight, params_.video.width,
1251 params_.video.height, params_.screenshare.scroll_duration * 1000,
1252 kPauseDurationMs));
1253 }
1254 } else if (params_.ss.num_spatial_layers > 1) {
1255 RTC_CHECK(params_.video.codec == "VP9");
1208 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); 1256 VideoCodecVP9 vp9_settings = VideoEncoder::GetDefaultVp9Settings();
1209 vp9_settings.denoisingOn = false;
1210 vp9_settings.frameDroppingOn = false;
1211 vp9_settings.numberOfTemporalLayers = 1257 vp9_settings.numberOfTemporalLayers =
1212 static_cast<unsigned char>(params_.video.num_temporal_layers); 1258 static_cast<unsigned char>(params_.video.num_temporal_layers);
1213 vp9_settings.numberOfSpatialLayers = 1259 vp9_settings.numberOfSpatialLayers =
1214 static_cast<unsigned char>(params_.ss.num_spatial_layers); 1260 static_cast<unsigned char>(params_.ss.num_spatial_layers);
1215 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject< 1261 video_encoder_config_.encoder_specific_settings = new rtc::RefCountedObject<
1216 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings); 1262 VideoEncoderConfig::Vp9EncoderSpecificSettings>(vp9_settings);
1217 } 1263 }
1218
1219 // Setup frame generator.
1220 const size_t kWidth = 1850;
1221 const size_t kHeight = 1110;
1222 std::vector<std::string> slides;
1223 slides.push_back(test::ResourcePath("web_screenshot_1850_1110", "yuv"));
1224 slides.push_back(test::ResourcePath("presentation_1850_1110", "yuv"));
1225 slides.push_back(test::ResourcePath("photo_1850_1110", "yuv"));
1226 slides.push_back(test::ResourcePath("difficult_photo_1850_1110", "yuv"));
1227
1228 if (params_.screenshare.scroll_duration == 0) {
1229 // Cycle image every slide_change_interval seconds.
1230 frame_generator_.reset(test::FrameGenerator::CreateFromYuvFile(
1231 slides, kWidth, kHeight,
1232 params_.screenshare.slide_change_interval * params_.video.fps));
1233 } else {
1234 RTC_CHECK_LE(params_.video.width, kWidth);
1235 RTC_CHECK_LE(params_.video.height, kHeight);
1236 RTC_CHECK_GT(params_.screenshare.slide_change_interval, 0);
1237 const int kPauseDurationMs = (params_.screenshare.slide_change_interval -
1238 params_.screenshare.scroll_duration) *
1239 1000;
1240 RTC_CHECK_LE(params_.screenshare.scroll_duration,
1241 params_.screenshare.slide_change_interval);
1242
1243 frame_generator_.reset(
1244 test::FrameGenerator::CreateScrollingInputFromYuvFiles(
1245 clock_, slides, kWidth, kHeight, params_.video.width,
1246 params_.video.height, params_.screenshare.scroll_duration * 1000,
1247 kPauseDurationMs));
1248 }
1249 } 1264 }
1250 1265
1251 void VideoQualityTest::CreateCapturer() { 1266 void VideoQualityTest::CreateCapturer() {
1252 if (params_.screenshare.enabled) { 1267 if (params_.screenshare.enabled) {
1253 test::FrameGeneratorCapturer* frame_generator_capturer = 1268 test::FrameGeneratorCapturer* frame_generator_capturer =
1254 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(), 1269 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(),
1255 params_.video.fps); 1270 params_.video.fps);
1256 EXPECT_TRUE(frame_generator_capturer->Init()); 1271 EXPECT_TRUE(frame_generator_capturer->Init());
1257 video_capturer_.reset(frame_generator_capturer); 1272 video_capturer_.reset(frame_generator_capturer);
1258 } else { 1273 } else {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 std::string graph_title = params_.analyzer.graph_title; 1323 std::string graph_title = params_.analyzer.graph_title;
1309 if (graph_title.empty()) 1324 if (graph_title.empty())
1310 graph_title = VideoQualityTest::GenerateGraphTitle(); 1325 graph_title = VideoQualityTest::GenerateGraphTitle();
1311 1326
1312 // In the case of different resolutions, the functions calculating PSNR and 1327 // In the case of different resolutions, the functions calculating PSNR and
1313 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer 1328 // SSIM return -1.0, instead of a positive value as usual. VideoAnalyzer
1314 // aborts if the average psnr/ssim are below the given threshold, which is 1329 // aborts if the average psnr/ssim are below the given threshold, which is
1315 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary 1330 // 0.0 by default. Setting the thresholds to -1.1 prevents the unnecessary
1316 // abort. 1331 // abort.
1317 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream]; 1332 VideoStream& selected_stream = params_.ss.streams[params_.ss.selected_stream];
1318 int selected_sl = params_.ss.selected_sl != -1
1319 ? params_.ss.selected_sl
1320 : params_.ss.num_spatial_layers - 1;
1321 bool disable_quality_check =
1322 selected_stream.width != params_.video.width ||
1323 selected_stream.height != params_.video.height ||
1324 (!params_.ss.spatial_layers.empty() &&
1325 params_.ss.spatial_layers[selected_sl].scaling_factor_num !=
1326 params_.ss.spatial_layers[selected_sl].scaling_factor_den);
1327 if (disable_quality_check) {
1328 fprintf(stderr,
1329 "Warning: Calculating PSNR and SSIM for downsized resolution "
1330 "not implemented yet! Skipping PSNR and SSIM calculations!\n");
1331 }
1332 1333
1333 VideoAnalyzer analyzer( 1334 VideoAnalyzer analyzer(
1334 &send_transport, params_.analyzer.test_label, 1335 &send_transport, params_.analyzer.test_label,
1335 disable_quality_check ? -1.1 : params_.analyzer.avg_psnr_threshold, 1336 params_.analyzer.avg_psnr_threshold, params_.analyzer.avg_ssim_threshold,
1336 disable_quality_check ? -1.1 : params_.analyzer.avg_ssim_threshold,
1337 params_.analyzer.test_durations_secs * params_.video.fps, 1337 params_.analyzer.test_durations_secs * params_.video.fps,
1338 graph_data_output_file, graph_title, 1338 graph_data_output_file, graph_title,
1339 kVideoSendSsrcs[params_.ss.selected_stream], 1339 kVideoSendSsrcs[params_.ss.selected_stream],
1340 static_cast<uint32_t>(selected_stream.width), 1340 static_cast<uint32_t>(selected_stream.width),
1341 static_cast<uint32_t>(selected_stream.height)); 1341 static_cast<uint32_t>(selected_stream.height));
1342 1342
1343 analyzer.SetReceiver(receiver_call_->Receiver()); 1343 analyzer.SetReceiver(receiver_call_->Receiver());
1344 send_transport.SetReceiver(&analyzer); 1344 send_transport.SetReceiver(&analyzer);
1345 recv_transport.SetReceiver(sender_call_->Receiver()); 1345 recv_transport.SetReceiver(sender_call_->Receiver());
1346 1346
1347 SetupVideo(&analyzer, &recv_transport); 1347 SetupVideo(&analyzer, &recv_transport);
1348 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer; 1348 video_receive_configs_[params_.ss.selected_stream].renderer = &analyzer;
1349 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy(); 1349 video_send_config_.pre_encode_callback = analyzer.pre_encode_proxy();
1350 for (auto& config : video_receive_configs_) 1350 for (auto& config : video_receive_configs_)
1351 config.pre_decode_callback = &analyzer; 1351 config.pre_decode_callback = &analyzer;
1352 RTC_DCHECK(!video_send_config_.post_encode_callback); 1352 RTC_DCHECK(!video_send_config_.post_encode_callback);
1353 video_send_config_.post_encode_callback = analyzer.encode_timing_proxy(); 1353 video_send_config_.post_encode_callback = analyzer.encode_timing_proxy();
1354 1354
1355 if (params_.screenshare.enabled) 1355 SetupScreenshareOrSimulcast();
sprang_webrtc 2017/02/09 17:10:39 Why remove if (params_.screenshare.enabled) ?
ilnik 2017/02/10 10:11:43 Because this function now setups not only screensh
1356 SetupScreenshare();
1357 1356
1358 CreateFlexfecStreams(); 1357 CreateFlexfecStreams();
1359 CreateVideoStreams(); 1358 CreateVideoStreams();
1360 analyzer.SetSendStream(video_send_stream_); 1359 analyzer.SetSendStream(video_send_stream_);
1361 if (video_receive_streams_.size() == 1) 1360 if (video_receive_streams_.size() == 1)
1362 analyzer.SetReceiveStream(video_receive_streams_[0]); 1361 analyzer.SetReceiveStream(video_receive_streams_[0]);
1363 1362
1364 video_send_stream_->SetSource(analyzer.OutputInterface(), 1363 video_send_stream_->SetSource(analyzer.OutputInterface(),
1365 degradation_preference_); 1364 degradation_preference_);
1366 1365
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 title.c_str(), params_.ss.streams[stream_id].width, 1484 title.c_str(), params_.ss.streams[stream_id].width,
1486 params_.ss.streams[stream_id].height)); 1485 params_.ss.streams[stream_id].height));
1487 1486
1488 SetupVideo(&transport, &transport); 1487 SetupVideo(&transport, &transport);
1489 video_send_config_.pre_encode_callback = local_preview.get(); 1488 video_send_config_.pre_encode_callback = local_preview.get();
1490 video_receive_configs_[stream_id].renderer = loopback_video.get(); 1489 video_receive_configs_[stream_id].renderer = loopback_video.get();
1491 if (params_.audio.enabled && params_.audio.sync_video) 1490 if (params_.audio.enabled && params_.audio.sync_video)
1492 video_receive_configs_[stream_id].sync_group = kSyncGroup; 1491 video_receive_configs_[stream_id].sync_group = kSyncGroup;
1493 1492
1494 if (params_.screenshare.enabled) 1493 if (params_.screenshare.enabled)
1495 SetupScreenshare(); 1494 SetupScreenshareOrSimulcast();
1496 1495
1497 video_send_stream_ = call->CreateVideoSendStream( 1496 video_send_stream_ = call->CreateVideoSendStream(
1498 video_send_config_.Copy(), video_encoder_config_.Copy()); 1497 video_send_config_.Copy(), video_encoder_config_.Copy());
1499 if (params_.video.flexfec) { 1498 if (params_.video.flexfec) {
1500 RTC_DCHECK(!flexfec_receive_configs_.empty()); 1499 RTC_DCHECK(!flexfec_receive_configs_.empty());
1501 flexfec_receive_stream = 1500 flexfec_receive_stream =
1502 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]); 1501 call->CreateFlexfecReceiveStream(flexfec_receive_configs_[0]);
1503 } 1502 }
1504 video_receive_stream = call->CreateVideoReceiveStream( 1503 video_receive_stream = call->CreateVideoReceiveStream(
1505 video_receive_configs_[stream_id].Copy()); 1504 video_receive_configs_[stream_id].Copy());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1587 std::ostringstream str; 1586 std::ostringstream str;
1588 str << receive_logs_++; 1587 str << receive_logs_++;
1589 std::string path = 1588 std::string path =
1590 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1589 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1591 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1590 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1592 10000000); 1591 10000000);
1593 } 1592 }
1594 } 1593 }
1595 1594
1596 } // namespace webrtc 1595 } // namespace webrtc
OLDNEW
« webrtc/video/full_stack_tests.cc ('K') | « webrtc/video/video_quality_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698