X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Frenderer%2Fmedia%2Frenderer_gpu_video_accelerator_factories.h;h=da6b09130620daf5ff9fb82e3f02b70b4ac0a60f;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=f91e690a064004ee09b4459fed77d4f3e690afac;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/src/content/renderer/media/renderer_gpu_video_accelerator_factories.h index f91e690..da6b091 100644 --- a/src/content/renderer/media/renderer_gpu_video_accelerator_factories.h +++ b/src/content/renderer/media/renderer_gpu_video_accelerator_factories.h @@ -14,7 +14,6 @@ #include "content/child/thread_safe_sender.h" #include "content/common/content_export.h" #include "media/filters/gpu_video_accelerator_factories.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/size.h" namespace base { @@ -31,12 +30,9 @@ class WebGraphicsContext3DCommandBufferImpl; // RenderViewImpl and only has its own header to allow extraction of its // implementation from render_view_impl.cc which is already far too large. // -// The RendererGpuVideoAcceleratorFactories can be constructed on any thread. -// Most public methods of the class must be called from the media thread. The -// exceptions (which can be called from any thread, as they are internally -// trampolined) are: -// * CreateVideoDecodeAccelerator() -// * ReadPixels() +// The RendererGpuVideoAcceleratorFactories can be constructed on any thread, +// but subsequent calls to all public methods of the class must be called from +// the |message_loop_proxy_|, as provided during construction. class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories : public media::GpuVideoAcceleratorFactories { public: @@ -44,10 +40,10 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories // use. Safe to call from any thread. RendererGpuVideoAcceleratorFactories( GpuChannelHost* gpu_channel_host, + const scoped_refptr& message_loop_proxy, const scoped_refptr& context_provider); // media::GpuVideoAcceleratorFactories implementation. - // CreateVideoDecodeAccelerator() is safe to call from any thread. virtual scoped_ptr CreateVideoDecodeAccelerator( media::VideoCodecProfile profile, @@ -64,42 +60,21 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories uint32 texture_target) OVERRIDE; virtual void DeleteTexture(uint32 texture_id) OVERRIDE; virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE; - // ReadPixels() is safe to call from any thread. virtual void ReadPixels(uint32 texture_id, - const gfx::Size& size, + const gfx::Rect& visible_rect, const SkBitmap& pixels) OVERRIDE; virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; virtual scoped_refptr GetTaskRunner() OVERRIDE; - virtual void Abort() OVERRIDE; - virtual bool IsAborted() OVERRIDE; - scoped_refptr Clone(); protected: friend class base::RefCountedThreadSafe; virtual ~RendererGpuVideoAcceleratorFactories(); private: - RendererGpuVideoAcceleratorFactories(); - // Helper to get a pointer to the WebGraphicsContext3DCommandBufferImpl, // if it has not been lost yet. WebGraphicsContext3DCommandBufferImpl* GetContext3d(); - // Helper for the constructor to acquire the ContentGLContext on - // |task_runner_|. - void AsyncBindContext(); - - // Async versions of the public methods, run on |task_runner_|. - // 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). - // AsyncCreateVideoDecodeAccelerator returns its output in the |vda_| member. - void AsyncCreateVideoDecodeAccelerator( - media::VideoCodecProfile profile, - media::VideoDecodeAccelerator::Client* client); - void AsyncReadPixels(uint32 texture_id, const gfx::Size& size); - void AsyncDestroyVideoDecodeAccelerator(); - scoped_refptr task_runner_; scoped_refptr gpu_channel_host_; scoped_refptr context_provider_; @@ -107,20 +82,6 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories // For sending requests to allocate shared memory in the Browser process. scoped_refptr thread_safe_sender_; - // This event is signaled if we have been asked to Abort(). - base::WaitableEvent aborted_waiter_; - - // This event is signaled by asynchronous tasks posted to |task_runner_| to - // indicate their completion. - // e.g. AsyncCreateVideoDecodeAccelerator()/AsyncCreateTextures() etc. - base::WaitableEvent task_runner_async_waiter_; - - // The vda returned by the CreateVideoDecodeAccelerator function. - scoped_ptr vda_; - - // Bitmap returned by ReadPixels(). - SkBitmap read_pixels_bitmap_; - DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories); };