diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-13 10:44:56 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-13 10:44:56 +0000 |
commit | 9441c059c32c4e2c921399197ccce1d0a0478471 (patch) | |
tree | c9adb7562be8047dd4061e2abf3ff89862332ac0 /media | |
parent | 2bd43e73f50f2b7eebd72186e76a9ec444d66dc1 (diff) | |
download | chromium_src-9441c059c32c4e2c921399197ccce1d0a0478471.zip chromium_src-9441c059c32c4e2c921399197ccce1d0a0478471.tar.gz chromium_src-9441c059c32c4e2c921399197ccce1d0a0478471.tar.bz2 |
Remove VideoDecoder::PrepareForShutdownHack() and friends.
As of r156011 the pause/flush/stop shutdown dance is no more. Now that Pipeline immediately calls Stop() during teardown we can remove a pile of hacks that were used to signal that teardown was starting.
BUG=110228
Review URL: https://chromiumcodereview.appspot.com/10918172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/mock_filters.h | 1 | ||||
-rw-r--r-- | media/base/pipeline.cc | 5 | ||||
-rw-r--r-- | media/base/pipeline.h | 11 | ||||
-rw-r--r-- | media/base/video_decoder.cc | 2 | ||||
-rw-r--r-- | media/base/video_decoder.h | 8 | ||||
-rw-r--r-- | media/base/video_renderer.h | 7 | ||||
-rw-r--r-- | media/filters/gpu_video_decoder.cc | 19 | ||||
-rw-r--r-- | media/filters/gpu_video_decoder.h | 5 | ||||
-rw-r--r-- | media/filters/video_renderer_base.cc | 6 | ||||
-rw-r--r-- | media/filters/video_renderer_base.h | 1 |
10 files changed, 3 insertions, 62 deletions
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index ee4513f..ee3498a 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h @@ -153,7 +153,6 @@ class MockVideoRenderer : public VideoRenderer { MOCK_METHOD2(Preroll, void(base::TimeDelta time, const PipelineStatusCB& cb)); MOCK_METHOD1(Stop, void(const base::Closure& callback)); MOCK_METHOD1(SetPlaybackRate, void(float playback_rate)); - virtual void PrepareForShutdownHack() {} protected: virtual ~MockVideoRenderer(); diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc index c2f1f13..31ccf58 100644 --- a/media/base/pipeline.cc +++ b/media/base/pipeline.cc @@ -724,11 +724,6 @@ void Pipeline::StopTask(const base::Closure& stop_cb) { return; } - // TODO(scherkus): Remove after pipeline state machine refactoring has some - // time to bake http://crbug.com/110228 - if (video_renderer_) - video_renderer_->PrepareForShutdownHack(); - SetState(kStopping); pending_callbacks_.reset(); stop_cb_ = stop_cb; diff --git a/media/base/pipeline.h b/media/base/pipeline.h index e023e87..b90f4c4 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -452,16 +452,9 @@ class MEDIA_EXPORT Pipeline PipelineStatusCB error_cb_; BufferingStateCB buffering_state_cb_; - // Audio renderer reference used for setting the volume and determining - // when playback has finished. + // Renderer references used for setting the volume, playback rate, and + // determining when playback has finished. scoped_refptr<AudioRenderer> audio_renderer_; - - // Video Renderer reference used for determining when playback has finished - // and for signalling imminent shutdown. - // The signalling imminent shutdown is a HACK necessary because - // WebMediaPlayerImpl::Destroy() holds the render thread loop hostage - // until PipelineImpl::Stop() calls its callback. - // http://crbug.com/110228 tracks removing this hack. scoped_refptr<VideoRenderer> video_renderer_; // Demuxer reference used for setting the preload value. diff --git a/media/base/video_decoder.cc b/media/base/video_decoder.cc index b5100b8..4c7c4b7 100644 --- a/media/base/video_decoder.cc +++ b/media/base/video_decoder.cc @@ -14,6 +14,4 @@ bool VideoDecoder::HasAlpha() const { return false; } -void VideoDecoder::PrepareForShutdownHack() {} - } // namespace media diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h index c8fd93d..b22b144 100644 --- a/media/base/video_decoder.h +++ b/media/base/video_decoder.h @@ -64,14 +64,6 @@ class MEDIA_EXPORT VideoDecoder // that return formats with an alpha channel. virtual bool HasAlpha() const; - // Prepare decoder for shutdown. This is a HACK needed because - // PipelineImpl::Stop() goes through a Pause/Flush/Stop dance to all its - // filters, waiting for each state transition to complete before starting the - // next, but WebMediaPlayerImpl::Destroy() holds the renderer loop hostage for - // the duration. Default implementation does nothing; derived decoders may - // override as needed. http://crbug.com/110228 tracks removing this. - virtual void PrepareForShutdownHack(); - protected: friend class base::RefCountedThreadSafe<VideoDecoder>; virtual ~VideoDecoder(); diff --git a/media/base/video_renderer.h b/media/base/video_renderer.h index 57e22bc..c19c8f9 100644 --- a/media/base/video_renderer.h +++ b/media/base/video_renderer.h @@ -91,13 +91,6 @@ class MEDIA_EXPORT VideoRenderer // Updates the current playback rate. virtual void SetPlaybackRate(float playback_rate) = 0; - // Prepare decoder for shutdown. This is a HACK needed because - // PipelineImpl::Stop() goes through a Pause/Flush/Stop dance to all its - // filters, waiting for each state transition to complete before starting the - // next, but WebMediaPlayerImpl::Destroy() holds the renderer loop hostage for - // the duration. http://crbug.com/110228 tracks removing this. - virtual void PrepareForShutdownHack() = 0; - protected: friend class base::RefCountedThreadSafe<VideoRenderer>; diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index 40af5a3..149631d 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc @@ -56,7 +56,6 @@ GpuVideoDecoder::GpuVideoDecoder( decoder_texture_target_(0), next_picture_buffer_id_(0), next_bitstream_buffer_id_(0), - shutting_down_(false), error_occured_(false) { DCHECK(!message_loop_factory_cb_.is_null()); DCHECK(factories_); @@ -86,14 +85,7 @@ void GpuVideoDecoder::Reset(const base::Closure& closure) { if (!pending_read_cb_.is_null()) EnqueueFrameAndTriggerFrameDelivery(VideoFrame::CreateEmptyFrame()); - if (shutting_down_) { - // Immediately fire the callback instead of waiting for the reset to - // complete (which will happen after PipelineImpl::Stop() completes). - gvd_loop_proxy_->PostTask(FROM_HERE, closure); - } else { - pending_reset_cb_ = closure; - } - + pending_reset_cb_ = closure; vda_loop_proxy_->PostTask(FROM_HERE, base::Bind( &VideoDecodeAccelerator::Reset, weak_vda_)); } @@ -309,15 +301,6 @@ bool GpuVideoDecoder::HasAlpha() const { return true; } -void GpuVideoDecoder::PrepareForShutdownHack() { - if (!gvd_loop_proxy_->BelongsToCurrentThread()) { - gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( - &GpuVideoDecoder::PrepareForShutdownHack, this)); - return; - } - shutting_down_ = true; -} - void GpuVideoDecoder::NotifyInitializeDone() { NOTREACHED() << "GpuVideoDecodeAcceleratorHost::Initialize is synchronous!"; } diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h index 0a65379..67dcfd7 100644 --- a/media/filters/gpu_video_decoder.h +++ b/media/filters/gpu_video_decoder.h @@ -70,7 +70,6 @@ class MEDIA_EXPORT GpuVideoDecoder virtual void Reset(const base::Closure& closure) OVERRIDE; virtual void Stop(const base::Closure& closure) OVERRIDE; virtual bool HasAlpha() const OVERRIDE; - virtual void PrepareForShutdownHack() OVERRIDE; // VideoDecodeAccelerator::Client implementation. virtual void NotifyInitializeDone() OVERRIDE; @@ -215,10 +214,6 @@ class MEDIA_EXPORT GpuVideoDecoder int64 next_picture_buffer_id_; int64 next_bitstream_buffer_id_; - // Indicates PrepareForShutdownHack()'s been called. Makes further calls to - // this class not require the render thread's loop to be processing. - bool shutting_down_; - // Indicates decoding error occurred. bool error_occured_; diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc index 29e004c..8f6bf8a 100644 --- a/media/filters/video_renderer_base.cc +++ b/media/filters/video_renderer_base.cc @@ -214,12 +214,6 @@ void VideoRendererBase::OnDecoderInitDone( base::ResetAndReturn(&init_cb_).Run(PIPELINE_OK); } -void VideoRendererBase::PrepareForShutdownHack() { - base::AutoLock auto_lock(lock_); - if (decoder_) - decoder_->PrepareForShutdownHack(); -} - // PlatformThread::Delegate implementation. void VideoRendererBase::ThreadMain() { base::PlatformThread::SetName("CrVideoRenderer"); diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h index 592f5d1..85e6527 100644 --- a/media/filters/video_renderer_base.h +++ b/media/filters/video_renderer_base.h @@ -68,7 +68,6 @@ class MEDIA_EXPORT VideoRendererBase const PipelineStatusCB& cb) OVERRIDE; virtual void Stop(const base::Closure& callback) OVERRIDE; virtual void SetPlaybackRate(float playback_rate) OVERRIDE; - virtual void PrepareForShutdownHack() OVERRIDE; // PlatformThread::Delegate implementation. virtual void ThreadMain() OVERRIDE; |