diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-12 04:49:31 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-12 04:49:31 +0000 |
commit | 8c2efc2eeb20a03ea58e03d636c4f4b017afffaa (patch) | |
tree | 60870ee79093448d35730a72170415fa5de7f9a4 /media/base | |
parent | 4415313c89e92b27506e8fd35c377f8da519fa29 (diff) | |
download | chromium_src-8c2efc2eeb20a03ea58e03d636c4f4b017afffaa.zip chromium_src-8c2efc2eeb20a03ea58e03d636c4f4b017afffaa.tar.gz chromium_src-8c2efc2eeb20a03ea58e03d636c4f4b017afffaa.tar.bz2 |
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
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/mock_filters.h | 1 | ||||
-rw-r--r-- | media/base/pipeline.cc | 2 | ||||
-rw-r--r-- | media/base/pipeline_unittest.cc | 4 | ||||
-rw-r--r-- | media/base/video_renderer.h | 3 |
4 files changed, 0 insertions, 10 deletions
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); }; |