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

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: 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
« no previous file with comments | « media/filters/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index 3fde230540fb90d7529ccba34d2696b441323fe0..47db2ecf120573d41d69a34b30ef41bf65ef394d 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -61,6 +61,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_);
@@ -83,7 +88,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) {
@@ -103,7 +108,7 @@ void VideoRendererBase::Seek(base::TimeDelta time, const PipelineStatusCB& cb) {
AttemptRead_Locked();
}
-void VideoRendererBase::Initialize(VideoDecoder* decoder,
+void VideoRendererBase::Initialize(const scoped_refptr<VideoDecoder>& decoder,
const PipelineStatusCB& status_cb,
const StatisticsCB& statistics_cb,
const TimeCB& time_cb) {
@@ -457,7 +462,10 @@ void VideoRendererBase::AttemptFlush_Locked() {
if (!pending_paint_ && !pending_read_) {
state_ = kFlushed;
current_frame_ = NULL;
- ResetAndRunCB(&flush_cb_);
+
+ base::Closure flush_cb = flush_cb_;
+ flush_cb_.Reset();
+ decoder_->Flush(flush_cb);
}
}
« no previous file with comments | « media/filters/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698