From 8c2efc2eeb20a03ea58e03d636c4f4b017afffaa Mon Sep 17 00:00:00 2001 From: "scherkus@chromium.org" Date: Sat, 12 Jul 2014 04:49:31 +0000 Subject: Remove media::VideoRenderer::SetPlaybackRate(). Video renderers don't need the information as they are already making audio/video synchronization decisions based on a media timeline that already incorporates the current playback rate via the time callback. In particular, VideoRendererImpl only used playback rate to estimate a better duration to sleep until the current frame was ready ... except that in most cases we'd sleep for kIdleTimeDelta and wait until the media timeline had progressed past the current frame's timestamp. In other words, there's absolutely no reason to even try to estimate the sleep duration based on the playback rate. BUG=370634 Review URL: https://codereview.chromium.org/384943002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282797 0039d316-1c4b-4281-b951-d872f2087c98 --- media/base/mock_filters.h | 1 - media/base/pipeline.cc | 2 -- media/base/pipeline_unittest.cc | 4 ---- media/base/video_renderer.h | 3 --- 4 files changed, 10 deletions(-) (limited to 'media/base') diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index c74190e..7afa625 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h @@ -130,7 +130,6 @@ class MockVideoRenderer : public VideoRenderer { MOCK_METHOD1(Flush, void(const base::Closure& callback)); MOCK_METHOD1(StartPlayingFrom, void(base::TimeDelta timestamp)); MOCK_METHOD1(Stop, void(const base::Closure& callback)); - MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); private: DISALLOW_COPY_AND_ASSIGN(MockVideoRenderer); diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 71c7248..ca53be0 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -649,8 +649,6 @@ void Pipeline::PlaybackRateChangedTask(float playback_rate) { if (audio_renderer_) audio_renderer_->SetPlaybackRate(playback_rate_); - if (video_renderer_) - video_renderer_->SetPlaybackRate(playback_rate_); } void Pipeline::VolumeChangedTask(float volume) { diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc index 41d6704..17da202 100644 --- a/media/base/pipeline_unittest.cc +++ b/media/base/pipeline_unittest.cc @@ -208,7 +208,6 @@ class PipelineTest : public ::testing::Test { } if (video_stream_) { - EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*video_renderer_, StartPlayingFrom(base::TimeDelta())) .WillOnce(SetBufferingState(&video_buffering_state_cb_, BUFFERING_HAVE_ENOUGH)); @@ -285,7 +284,6 @@ class PipelineTest : public ::testing::Test { EXPECT_CALL(*video_renderer_, StartPlayingFrom(seek_time)) .WillOnce(SetBufferingState(&video_buffering_state_cb_, BUFFERING_HAVE_ENOUGH)); - EXPECT_CALL(*video_renderer_, SetPlaybackRate(_)); } // We expect a successful seek callback followed by a buffering update. @@ -631,7 +629,6 @@ TEST_F(PipelineTest, AudioStreamShorterThanVideo) { EXPECT_EQ(0, pipeline_->GetMediaTime().ToInternalValue()); float playback_rate = 1.0f; - EXPECT_CALL(*video_renderer_, SetPlaybackRate(playback_rate)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(playback_rate)); pipeline_->SetPlaybackRate(playback_rate); message_loop_.RunUntilIdle(); @@ -1000,7 +997,6 @@ class PipelineTeardownTest : public PipelineTest { BUFFERING_HAVE_ENOUGH)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(0.0f)); - EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*audio_renderer_, SetVolume(1.0f)); EXPECT_CALL(*audio_renderer_, StartRendering()); diff --git a/media/base/video_renderer.h b/media/base/video_renderer.h index e92eca8..2e36c7f 100644 --- a/media/base/video_renderer.h +++ b/media/base/video_renderer.h @@ -75,9 +75,6 @@ class MEDIA_EXPORT VideoRenderer { // when complete. virtual void Stop(const base::Closure& callback) = 0; - // Updates the current playback rate. - virtual void SetPlaybackRate(float playback_rate) = 0; - private: DISALLOW_COPY_AND_ASSIGN(VideoRenderer); }; -- cgit v1.1