Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1209)

Unified Diff: media/filters/video_renderer_base.cc

Issue 9700006: Move VideoDecoder out of media pipeline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and a small fix Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index ffd942bbea602eca34e172b867853eea58c7278a..2be9a0785fd584b69220329935d7d1cd93a8736b 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -59,6 +59,11 @@ void VideoRendererBase::Flush(const base::Closure& callback) {
}
void VideoRendererBase::Stop(const base::Closure& callback) {
+ if (state_ == kStopped) {
+ callback.Run();
+ return;
+ }
+
base::PlatformThreadHandle thread_to_join = base::kNullThreadHandle;
{
base::AutoLock auto_lock(lock_);
@@ -81,7 +86,7 @@ void VideoRendererBase::Stop(const base::Closure& callback) {
if (thread_to_join != base::kNullThreadHandle)
base::PlatformThread::Join(thread_to_join);
- callback.Run();
+ decoder_->Stop(callback);
}
void VideoRendererBase::SetPlaybackRate(float playback_rate) {
@@ -101,7 +106,7 @@ void VideoRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) {
AttemptRead_Locked();
}
-void VideoRendererBase::Initialize(VideoDecoder* decoder,
+void VideoRendererBase::Initialize(const scoped_refptr<VideoDecoder>& decoder,
const PipelineStatusCB& pipeline_status_cb,
const StatisticsCB& statistics_cb,
const VideoTimeCB& video_time_cb) {
@@ -452,7 +457,8 @@ void VideoRendererBase::AttemptFlush_Locked() {
if (!pending_paint_ && !pending_read_) {
state_ = kFlushed;
current_frame_ = NULL;
- ResetAndRunCB(&flush_callback_);
+ decoder_->Flush(flush_callback_);
Ami GONE FROM CHROMIUM 2012/03/14 20:05:01 This change is unsafe if flushing the decoder caus
xhwang 2012/03/14 22:28:41 Done.
+ flush_callback_.Reset();
}
}

Powered by Google App Engine
This is Rietveld 408576698