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

Unified Diff: media/filters/gpu_video_accelerator_factories.h

Issue 27420004: Remove threading from RendererGpuVideoAcceleratorFactories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dthread
Patch Set: 51676bf4 Initial. Created 7 years, 2 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/gpu_video_accelerator_factories.h
diff --git a/media/filters/gpu_video_accelerator_factories.h b/media/filters/gpu_video_accelerator_factories.h
index c152c2a4bda8ca51d0769ac047a85bb27e4ce2b3..ccca541fb59c7a9bbb9d70f8fa59752e503b0436 100644
--- a/media/filters/gpu_video_accelerator_factories.h
+++ b/media/filters/gpu_video_accelerator_factories.h
@@ -21,6 +21,14 @@ namespace media {
// Helper interface for specifying factories needed to instantiate a hardware
// video accelerator.
+// Threading model:
+// * The GpuVideoAcceleratorFactories has an associated message loop, which may
+// be retrieved as |GetMessageLoop()|.
+// * Calls to the Factories must be made on its message loop.
+// * With the exception of |ReadPixels()|, which for convenience maybe be
+// called from any thread.
sheu 2013/10/16 00:57:45 I'm still a little iffy about this. My other thou
Ami GONE FROM CHROMIUM 2013/10/17 22:22:17 An alternative: make ReadPixels callable from only
+// * This is because the main user of |ReadPixels()| is the |read_pixels_cb_|
+// of media::VideoFrame, which needs to be synchronous and thread-safe.
class MEDIA_EXPORT GpuVideoAcceleratorFactories
: public base::RefCountedThreadSafe<GpuVideoAcceleratorFactories> {
public:
@@ -43,7 +51,8 @@ class MEDIA_EXPORT GpuVideoAcceleratorFactories
virtual void WaitSyncPoint(uint32 sync_point) = 0;
- // Read pixels from a native texture and store into |pixels| as RGBA.
+ // Read pixels from a native texture and store into |pixels| as RGBA. Safe to
+ // call from any thread.
virtual void ReadPixels(uint32 texture_id,
const gfx::Size& size,
const SkBitmap& pixels) = 0;
@@ -52,16 +61,11 @@ class MEDIA_EXPORT GpuVideoAcceleratorFactories
// Close()ing the returned pointer.
virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
- // Returns the message loop the video accelerator runs on.
+ // Returns the message loop the GpuVideoAcceleratorFactories runs on. Calls
+ // to interface functions must be made on this loop, with the exception of
+ // |ReadPixels()|.
virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
- // Abort any outstanding factory operations and error any future
- // attempts at factory operations
- virtual void Abort() = 0;
-
- // Returns true if Abort() has been called.
- virtual bool IsAborted() = 0;
-
protected:
friend class base::RefCountedThreadSafe<GpuVideoAcceleratorFactories>;
virtual ~GpuVideoAcceleratorFactories();

Powered by Google App Engine
This is Rietveld 408576698