Chromium Code Reviews (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out

Unified Diff: content/renderer/media/renderer_gpu_video_decoder_factories.h

Issue 9639005: HW video decode support for --enable-threaded-compositing (Closed) Base URL: svn://
Patch Set: CR response. 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: content/renderer/media/renderer_gpu_video_decoder_factories.h
diff --git a/content/renderer/media/renderer_gpu_video_decoder_factories.h b/content/renderer/media/renderer_gpu_video_decoder_factories.h
index 37359898d6ffa123259aba776ab42934113aefc8..5924a20926e0825805c3857d35ca6f1347fabf43 100644
--- a/content/renderer/media/renderer_gpu_video_decoder_factories.h
+++ b/content/renderer/media/renderer_gpu_video_decoder_factories.h
@@ -13,8 +13,9 @@
#include "media/filters/gpu_video_decoder.h"
#include "ui/gfx/size.h"
-class GpuChannelHost;
class ContentGLContext;
+class GpuChannelHost;
+class WebGraphicsContext3DCommandBufferImpl;
namespace base {
class WaitableEvent;
@@ -25,15 +26,19 @@ class WaitableEvent;
// implementation from which is already far too large.
// The public methods of the class can be called from any thread, and are
-// internally trampolined to the thread on which the class was constructed
-// (de-facto, the renderer thread) if called from a different thread.
+// internally trampolined to the appropriate thread. GPU/GL-related calls go to
+// the constructor-argument loop (mostly that's the compositor thread, or the
+// renderer thread if threaded compositing is disabled), and shmem-related calls
+// go to the render thread.
class CONTENT_EXPORT RendererGpuVideoDecoderFactories
: public media::GpuVideoDecoder::Factories {
// Takes a ref on |gpu_channel_host| and tests |context| for NULL before each
// use.
- RendererGpuVideoDecoderFactories(GpuChannelHost* gpu_channel_host,
- base::WeakPtr<ContentGLContext> context);
+ RendererGpuVideoDecoderFactories(
+ GpuChannelHost* gpu_channel_host,
+ MessageLoop* message_loop,
+ WebGraphicsContext3DCommandBufferImpl* wgc3dcbi);
virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
media::VideoDecodeAccelerator::Profile profile,
@@ -52,10 +57,16 @@ class CONTENT_EXPORT RendererGpuVideoDecoderFactories
virtual ~RendererGpuVideoDecoderFactories();
- // Async versions of the public methods. These all run on |message_loop_|
- // exclusively, and use output parameters instead of return values. Finally,
- // each takes a WaitableEvent* param to signal completion (except for
- // DeleteTexture, which is fire-and-forget).
+ // Helper for the constructor to acquire the ContentGLContext on the
+ // compositor thread (when it is enabled).
+ void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* wgc3dcbi,
+ base::WaitableEvent* waiter);
+ // Async versions of the public methods. They use output parameters instead
+ // of return values and each takes a WaitableEvent* param to signal completion
+ // (except for DeleteTexture, which is fire-and-forget).
+ // AsyncCreateSharedMemory runs on the renderer thread and the rest run on
+ // |message_loop_|.
void AsyncCreateVideoDecodeAccelerator(
media::VideoDecodeAccelerator::Profile profile,
media::VideoDecodeAccelerator::Client* client,
« no previous file with comments | « no previous file | content/renderer/media/ » ('j') | content/renderer/ » ('J')

Powered by Google App Engine
This is Rietveld 408576698