Index: webrtc/video/full_stack.cc |
diff --git a/webrtc/video/full_stack.cc b/webrtc/video/full_stack.cc |
index ad1b5c6356557e3e4152b1dbd0f3c8c0f31ede2c..61665542715ebee7c321a13085ec90abdb82240f 100644 |
--- a/webrtc/video/full_stack.cc |
+++ b/webrtc/video/full_stack.cc |
@@ -52,6 +52,7 @@ struct FullStackTestParams { |
double avg_psnr_threshold; |
double avg_ssim_threshold; |
int test_durations_secs; |
+ std::string codec; |
FakeNetworkPipe::Config link; |
}; |
@@ -207,8 +208,13 @@ class VideoAnalyzer : public PacketReceiver, |
int last_frames_processed = -1; |
EventTypeWrapper eventType; |
- while ((eventType = done_->Wait(FullStackTest::kDefaultTimeoutMs)) != |
- kEventSignaled) { |
+#ifdef WEBRTC_ANDROID |
pbos-webrtc
2015/07/13 09:34:43
not lgtm, can you use kLongTimeoutMs for both inst
|
+ int factor = 2; |
+#else |
+ int factor = 1; |
+#endif |
+ while ((eventType = done_->Wait( |
+ factor * FullStackTest::kDefaultTimeoutMs)) != kEventSignaled) { |
int frames_processed; |
{ |
rtc::CritScope crit(&comparison_lock_); |
@@ -441,11 +447,23 @@ void FullStackTest::RunTest(const FullStackTestParams& params) { |
CreateSendConfig(1); |
- rtc::scoped_ptr<VideoEncoder> encoder( |
- VideoEncoder::Create(VideoEncoder::kVp8)); |
- send_config_.encoder_settings.encoder = encoder.get(); |
- send_config_.encoder_settings.payload_name = "VP8"; |
+ rtc::scoped_ptr<VideoEncoder> encoder; |
+ if (params.codec == "VP8") { |
+ encoder = |
+ rtc::scoped_ptr<VideoEncoder>(VideoEncoder::Create(VideoEncoder::kVp8)); |
+ send_config_.encoder_settings.encoder = encoder.get(); |
+ send_config_.encoder_settings.payload_name = "VP8"; |
+ } else if (params.codec == "VP9") { |
+ encoder = |
+ rtc::scoped_ptr<VideoEncoder>(VideoEncoder::Create(VideoEncoder::kVp9)); |
+ send_config_.encoder_settings.encoder = encoder.get(); |
+ send_config_.encoder_settings.payload_name = "VP9"; |
+ } else { |
+ RTC_NOTREACHED() << "Codec not supported!"; |
+ return; |
+ } |
send_config_.encoder_settings.payload_type = 124; |
+ |
send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); |
send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; |
@@ -458,14 +476,24 @@ void FullStackTest::RunTest(const FullStackTestParams& params) { |
stream->max_bitrate_bps = params.max_bitrate_bps; |
stream->max_framerate = params.clip.fps; |
+ VideoCodecVP8 vp8_settings; |
+ VideoCodecVP9 vp9_settings; |
if (params.screenshare) { |
encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; |
encoder_config_.min_transmit_bitrate_bps = 400 * 1000; |
- VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); |
- vp8_settings.denoisingOn = false; |
- vp8_settings.frameDroppingOn = false; |
- vp8_settings.numberOfTemporalLayers = 2; |
- encoder_config_.encoder_specific_settings = &vp8_settings; |
+ if (params.codec == "VP8") { |
+ vp8_settings = VideoEncoder::GetDefaultVp8Settings(); |
+ vp8_settings.denoisingOn = false; |
+ vp8_settings.frameDroppingOn = false; |
+ vp8_settings.numberOfTemporalLayers = 2; |
+ encoder_config_.encoder_specific_settings = &vp8_settings; |
+ } else if (params.codec == "VP9") { |
+ vp9_settings = VideoEncoder::GetDefaultVp9Settings(); |
+ vp9_settings.denoisingOn = false; |
+ vp9_settings.frameDroppingOn = false; |
+ vp9_settings.numberOfTemporalLayers = 2; |
+ encoder_config_.encoder_specific_settings = &vp9_settings; |
+ } |
stream->temporal_layer_thresholds_bps.clear(); |
stream->temporal_layer_thresholds_bps.push_back(stream->target_bitrate_bps); |
@@ -530,7 +558,8 @@ TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { |
300000, |
36.0, |
0.96, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
RunTest(paris_qcif); |
} |
@@ -544,7 +573,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { |
700000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
RunTest(foreman_cif); |
} |
@@ -557,7 +587,8 @@ TEST_F(FullStackTest, ForemanCifPlr5) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.loss_percent = 5; |
foreman_cif.link.queue_delay_ms = 50; |
RunTest(foreman_cif); |
@@ -572,7 +603,8 @@ TEST_F(FullStackTest, ForemanCif500kbps) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.queue_length_packets = 0; |
foreman_cif.link.queue_delay_ms = 0; |
foreman_cif.link.link_capacity_kbps = 500; |
@@ -588,7 +620,8 @@ TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.queue_length_packets = 32; |
foreman_cif.link.queue_delay_ms = 0; |
foreman_cif.link.link_capacity_kbps = 500; |
@@ -604,7 +637,8 @@ TEST_F(FullStackTest, ForemanCif500kbps100ms) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.queue_length_packets = 0; |
foreman_cif.link.queue_delay_ms = 100; |
foreman_cif.link.link_capacity_kbps = 500; |
@@ -620,7 +654,8 @@ TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.queue_length_packets = 32; |
foreman_cif.link.queue_delay_ms = 100; |
foreman_cif.link.link_capacity_kbps = 500; |
@@ -636,14 +671,30 @@ TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
foreman_cif.link.queue_length_packets = 32; |
foreman_cif.link.queue_delay_ms = 100; |
foreman_cif.link.link_capacity_kbps = 1000; |
RunTest(foreman_cif); |
} |
-TEST_F(FullStackTest, ScreenshareSlides) { |
+TEST_F(FullStackTest, ScreenshareSlidesVP8) { |
+ FullStackTestParams screenshare_params = { |
+ "screenshare_slides", |
+ {"screenshare_slides", 1850, 1110, 5}, |
+ true, |
+ 50000, |
+ 200000, |
+ 2000000, |
+ 0.0, |
+ 0.0, |
+ kFullStackTestDurationSecs, |
+ "VP8"}; |
+ RunTest(screenshare_params); |
+} |
+ |
+TEST_F(FullStackTest, ScreenshareSlidesVP9) { |
FullStackTestParams screenshare_params = { |
"screenshare_slides", |
{"screenshare_slides", 1850, 1110, 5}, |
@@ -653,7 +704,8 @@ TEST_F(FullStackTest, ScreenshareSlides) { |
2000000, |
0.0, |
0.0, |
- kFullStackTestDurationSecs}; |
+ kFullStackTestDurationSecs, |
+ "VP9"}; |
RunTest(screenshare_params); |
} |
} // namespace webrtc |