diff options
author | rileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 20:00:45 +0000 |
---|---|---|
committer | rileya@chromium.org <rileya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-10 20:00:45 +0000 |
commit | 7c63c2ee2f35556e3b5d8c5f4195998994baf7cc (patch) | |
tree | d0dfee05ee508d2a38bcee7b009283f1da396d18 /media/base | |
parent | 5c159171b8cf439b43c42908ec158cef83889eca (diff) | |
download | chromium_src-7c63c2ee2f35556e3b5d8c5f4195998994baf7cc.zip chromium_src-7c63c2ee2f35556e3b5d8c5f4195998994baf7cc.tar.gz chromium_src-7c63c2ee2f35556e3b5d8c5f4195998994baf7cc.tar.bz2 |
Remove default implementations from Demuxer.
Seek(), Stop(), and OnAudioRendererDisabled() are now pure virtual. SetPlaybackRate() is removed entirely, and moved down to BufferedDataSource.
BUG=304990
Review URL: https://codereview.chromium.org/26492004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227979 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/data_source.cc | 2 | ||||
-rw-r--r-- | media/base/data_source.h | 3 | ||||
-rw-r--r-- | media/base/demuxer.cc | 14 | ||||
-rw-r--r-- | media/base/demuxer.h | 11 | ||||
-rw-r--r-- | media/base/pipeline.cc | 2 | ||||
-rw-r--r-- | media/base/pipeline_unittest.cc | 8 |
6 files changed, 4 insertions, 36 deletions
diff --git a/media/base/data_source.cc b/media/base/data_source.cc index c25f9e7..91f5260 100644 --- a/media/base/data_source.cc +++ b/media/base/data_source.cc @@ -23,8 +23,6 @@ void DataSource::set_host(DataSourceHost* host) { host_ = host; } -void DataSource::SetPlaybackRate(float playback_rate) {} - DataSourceHost* DataSource::host() { return host_; } } // namespace media diff --git a/media/base/data_source.h b/media/base/data_source.h index def1d01..9176c8e 100644 --- a/media/base/data_source.h +++ b/media/base/data_source.h @@ -46,9 +46,6 @@ class MEDIA_EXPORT DataSource { virtual void Read(int64 position, int size, uint8* data, const DataSource::ReadCB& read_cb) = 0; - // Notifies the DataSource of a change in the current playback rate. - virtual void SetPlaybackRate(float playback_rate); - // Stops the DataSource. Once this is called all future Read() calls will // return an error. virtual void Stop(const base::Closure& callback) = 0; diff --git a/media/base/demuxer.cc b/media/base/demuxer.cc index 6cd4e29..e7c38c3 100644 --- a/media/base/demuxer.cc +++ b/media/base/demuxer.cc @@ -14,18 +14,4 @@ Demuxer::Demuxer() {} Demuxer::~Demuxer() {} -void Demuxer::SetPlaybackRate(float playback_rate) {} - -void Demuxer::Seek(base::TimeDelta time, const PipelineStatusCB& status_cb) { - DCHECK(!status_cb.is_null()); - status_cb.Run(PIPELINE_OK); -} - -void Demuxer::Stop(const base::Closure& callback) { - DCHECK(!callback.is_null()); - callback.Run(); -} - -void Demuxer::OnAudioRendererDisabled() {} - } // namespace media diff --git a/media/base/demuxer.h b/media/base/demuxer.h index 853a21a..a2dad22 100644 --- a/media/base/demuxer.h +++ b/media/base/demuxer.h @@ -47,19 +47,16 @@ class MEDIA_EXPORT Demuxer { virtual void Initialize(DemuxerHost* host, const PipelineStatusCB& status_cb) = 0; - // The pipeline playback rate has been changed. Demuxers may implement this - // method if they need to respond to this call. - virtual void SetPlaybackRate(float playback_rate); - // Carry out any actions required to seek to the given time, executing the // callback upon completion. - virtual void Seek(base::TimeDelta time, const PipelineStatusCB& status_cb); + virtual void Seek(base::TimeDelta time, + const PipelineStatusCB& status_cb) = 0; // Starts stopping this demuxer, executing the callback upon completion. // // After the callback completes the demuxer may be destroyed. It is illegal to // call any method (including Stop()) after a demuxer has stopped. - virtual void Stop(const base::Closure& callback); + virtual void Stop(const base::Closure& callback) = 0; // This method is called from the pipeline when the audio renderer // is disabled. Demuxers can ignore the notification if they do not @@ -67,7 +64,7 @@ class MEDIA_EXPORT Demuxer { // // TODO(acolwell): Change to generic DisableStream(DemuxerStream::Type). // TODO(scherkus): this might not be needed http://crbug.com/234708 - virtual void OnAudioRendererDisabled(); + virtual void OnAudioRendererDisabled() = 0; // Returns the given stream type, or NULL if that type is not present. virtual DemuxerStream* GetStream(DemuxerStream::Type type) = 0; diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index 9790c61..5454fa7 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -760,8 +760,6 @@ void Pipeline::PlaybackRateChangedTask(float playback_rate) { clock_->SetPlaybackRate(playback_rate); } - if (demuxer_) - demuxer_->SetPlaybackRate(playback_rate); if (audio_renderer_) audio_renderer_->SetPlaybackRate(playback_rate_); if (video_renderer_) diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc index 2e4c528..1506c21 100644 --- a/media/base/pipeline_unittest.cc +++ b/media/base/pipeline_unittest.cc @@ -180,7 +180,6 @@ class PipelineTest : public ::testing::Test { if (start_status == PIPELINE_OK) { EXPECT_CALL(callbacks_, OnBufferingState(Pipeline::kHaveMetadata)); - EXPECT_CALL(*demuxer_, SetPlaybackRate(0.0f)); if (audio_stream_) { EXPECT_CALL(*audio_renderer_, SetPlaybackRate(0.0f)); @@ -228,7 +227,6 @@ class PipelineTest : public ::testing::Test { // Every filter should receive a call to Seek(). EXPECT_CALL(*demuxer_, Seek(seek_time, _)) .WillOnce(RunCallback<1>(PIPELINE_OK)); - EXPECT_CALL(*demuxer_, SetPlaybackRate(_)); if (audio_stream_) { EXPECT_CALL(*audio_renderer_, Pause(_)) @@ -615,7 +613,6 @@ TEST_F(PipelineTest, AudioStreamShorterThanVideo) { EXPECT_EQ(0, pipeline_->GetMediaTime().ToInternalValue()); float playback_rate = 1.0f; - EXPECT_CALL(*demuxer_, SetPlaybackRate(playback_rate)); EXPECT_CALL(*video_renderer_, SetPlaybackRate(playback_rate)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(playback_rate)); pipeline_->SetPlaybackRate(playback_rate); @@ -653,7 +650,6 @@ TEST_F(PipelineTest, ErrorDuringSeek) { InitializePipeline(PIPELINE_OK); float playback_rate = 1.0f; - EXPECT_CALL(*demuxer_, SetPlaybackRate(playback_rate)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(playback_rate)); pipeline_->SetPlaybackRate(playback_rate); message_loop_.RunUntilIdle(); @@ -788,7 +784,6 @@ TEST_F(PipelineTest, AudioTimeUpdateDuringSeek) { InitializePipeline(PIPELINE_OK); float playback_rate = 1.0f; - EXPECT_CALL(*demuxer_, SetPlaybackRate(playback_rate)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(playback_rate)); pipeline_->SetPlaybackRate(playback_rate); message_loop_.RunUntilIdle(); @@ -814,7 +809,6 @@ TEST_F(PipelineTest, AudioTimeUpdateDuringSeek) { .WillOnce(RunClosure<0>()); EXPECT_CALL(*audio_renderer_, Preroll(seek_time, _)) .WillOnce(RunCallback<1>(PIPELINE_OK)); - EXPECT_CALL(*demuxer_, SetPlaybackRate(_)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(_)); EXPECT_CALL(*audio_renderer_, SetVolume(_)); EXPECT_CALL(*audio_renderer_, Play(_)) @@ -999,7 +993,6 @@ class PipelineTeardownTest : public PipelineTest { EXPECT_CALL(*video_renderer_, Preroll(base::TimeDelta(), _)) .WillOnce(RunCallback<1>(PIPELINE_OK)); - EXPECT_CALL(*demuxer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*audio_renderer_, SetVolume(1.0f)); @@ -1108,7 +1101,6 @@ class PipelineTeardownTest : public PipelineTest { .WillOnce(RunCallback<1>(PIPELINE_OK)); // Playback rate and volume are updated prior to starting. - EXPECT_CALL(*demuxer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*audio_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f)); EXPECT_CALL(*audio_renderer_, SetVolume(1.0f)); |