From def39883f00c25525dfd34c3cee92b428e54b9e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Wed, 27 May 2015 17:59:11 +0200 Subject: [PATCH] Configure default render delay as 10 ms. BUG=chromium:488395 R=mflodman@webrtc.org, stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/56419005 Cr-Commit-Position: refs/heads/master@{#9296} --- webrtc/video/end_to_end_tests.cc | 5 +++++ webrtc/video/video_receive_stream.cc | 3 ++- webrtc/video_receive_stream.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc index 6236483bf..f0d06713b 100644 --- a/webrtc/video/end_to_end_tests.cc +++ b/webrtc/video/end_to_end_tests.cc @@ -1924,6 +1924,7 @@ TEST_F(EndToEndTest, ReportsSetEncoderRates) { TEST_F(EndToEndTest, GetStats) { static const int kStartBitrateBps = 3000000; + static const int kExpectedRenderDelayMs = 20; class StatsObserver : public test::EndToEndTest, public I420FrameCallback { public: explicit StatsObserver(const FakeNetworkPipe::Config& config) @@ -1971,6 +1972,9 @@ TEST_F(EndToEndTest, GetStats) { receive_stats_filled_["IncomingRate"] |= stats.network_frame_rate != 0 || stats.total_bitrate_bps != 0; + receive_stats_filled_["RenderDelayAsHighAsExpected"] |= + stats.render_delay_ms >= kExpectedRenderDelayMs; + receive_stats_filled_["FrameCallback"] |= stats.decode_frame_rate != 0; receive_stats_filled_["FrameRendered"] |= stats.render_frame_rate != 0; @@ -2100,6 +2104,7 @@ TEST_F(EndToEndTest, GetStats) { expected_send_ssrcs_.insert(ssrcs[i]); expected_receive_ssrcs_.push_back( (*receive_configs)[i].rtp.remote_ssrc); + (*receive_configs)[i].render_delay_ms = kExpectedRenderDelayMs; } } diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc index 12933caee..090aad39f 100644 --- a/webrtc/video/video_receive_stream.cc +++ b/webrtc/video/video_receive_stream.cc @@ -229,7 +229,8 @@ VideoReceiveStream::VideoReceiveStream(int num_cpu_cores, const Decoder& decoder = config_.decoders[i]; CHECK_EQ(0, vie_channel_->RegisterExternalDecoder( decoder.payload_type, decoder.decoder, decoder.is_renderer, - decoder.expected_delay_ms)); + decoder.is_renderer ? decoder.expected_delay_ms + : config.render_delay_ms)); VideoCodec codec = CreateDecoderVideoCodec(decoder); diff --git a/webrtc/video_receive_stream.h b/webrtc/video_receive_stream.h index c24c62e4f..b523b1ec0 100644 --- a/webrtc/video_receive_stream.h +++ b/webrtc/video_receive_stream.h @@ -92,7 +92,7 @@ class VideoReceiveStream { struct Config { Config() : renderer(NULL), - render_delay_ms(0), + render_delay_ms(10), audio_channel_id(-1), pre_decode_callback(NULL), pre_render_callback(NULL),