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

Unified Diff: media/filters/video_renderer_base.h

Issue 11428095: Pass in media message loop to VideoRendererBase and enforce calling on the right thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GVD Created 8 years 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/pipeline_integration_test_base.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.h
diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h
index 85e6527c68112d60f56de6b729b5fa13e047f5ed..eee29058e403ce4d5692720aac76a385d58582e5 100644
--- a/media/filters/video_renderer_base.h
+++ b/media/filters/video_renderer_base.h
@@ -17,6 +17,10 @@
#include "media/base/video_frame.h"
#include "media/base/video_renderer.h"
+namespace base {
+class MessageLoopProxy;
+}
+
namespace media {
// VideoRendererBase creates its own thread for the sole purpose of timing frame
@@ -46,7 +50,8 @@ class MEDIA_EXPORT VideoRendererBase
//
// TODO(scherkus): pass the VideoFrame* to this callback and remove
// Get/PutCurrentFrame() http://crbug.com/108435
- VideoRendererBase(const base::Closure& paint_cb,
+ VideoRendererBase(const scoped_refptr<base::MessageLoopProxy>& message_loop,
+ const base::Closure& paint_cb,
const SetOpaqueCB& set_opaque_cb,
bool drop_frames);
@@ -95,10 +100,11 @@ class MEDIA_EXPORT VideoRendererBase
// Helper method that schedules an asynchronous read from the decoder as long
// as there isn't a pending read and we have capacity.
+ void AttemptRead();
void AttemptRead_Locked();
- // Called when the VideoDecoder Flush() completes.
- void OnDecoderFlushDone();
+ // Called when VideoDecoder::Reset() completes.
+ void OnDecoderResetDone();
// Attempts to complete flushing and transition into the flushed state.
void AttemptFlush_Locked();
@@ -133,6 +139,8 @@ class MEDIA_EXPORT VideoRendererBase
scoped_ptr<VideoDecoderList> decoders,
PipelineStatus status);
+ scoped_refptr<base::MessageLoopProxy> message_loop_;
+
// Used for accessing data members.
base::Lock lock_;
@@ -165,7 +173,7 @@ class MEDIA_EXPORT VideoRendererBase
// |
// | Initialize()
// V All frames returned
- // +------[kFlushed]<-----[kFlushing]<--- OnDecoderFlushDone()
+ // +------[kFlushed]<-----[kFlushing]<--- OnDecoderResetDone()
// | | Preroll() or upon ^
// | V got first frame [kFlushingDecoder]
// | [kPrerolling] ^
« no previous file with comments | « media/filters/pipeline_integration_test_base.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698