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

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

Issue 27420004: Remove threading from RendererGpuVideoAcceleratorFactories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dthread
Patch Set: 282a294f Rebase, rework, 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: content/renderer/media/renderer_gpu_video_accelerator_factories.h
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.h b/content/renderer/media/renderer_gpu_video_accelerator_factories.h
index eb9d650b5d038ad08362a569106ea7f277001b06..29c7f560ea0f2d3dee77dc2fddf007defab1cb33 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.h
+++ b/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 {
@@ -32,12 +31,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 most public methods of the class must be called from
Ami GONE FROM CHROMIUM 2013/10/22 17:21:19 s/most/all/
sheu 2013/10/24 01:16:39 Done.
+// the media thread.
class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
: public media::GpuVideoAcceleratorFactories {
public:
@@ -48,7 +44,6 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
const scoped_refptr<ContextProviderCommandBuffer>& context_provider);
// media::GpuVideoAcceleratorFactories implementation.
- // CreateVideoDecodeAccelerator() is safe to call from any thread.
virtual scoped_ptr<media::VideoDecodeAccelerator>
CreateVideoDecodeAccelerator(
media::VideoCodecProfile profile,
@@ -65,23 +60,17 @@ 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 SkBitmap& pixels) OVERRIDE;
virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE;
virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE;
- virtual void Abort() OVERRIDE;
- virtual bool IsAborted() OVERRIDE;
- scoped_refptr<RendererGpuVideoAcceleratorFactories> Clone();
protected:
friend class base::RefCountedThreadSafe<RendererGpuVideoAcceleratorFactories>;
virtual ~RendererGpuVideoAcceleratorFactories();
private:
- RendererGpuVideoAcceleratorFactories();
-
// Helper to get a pointer to the WebGraphicsContext3DCommandBufferImpl,
// if it has not been lost yet.
WebGraphicsContext3DCommandBufferImpl* GetContext3d();
@@ -90,17 +79,6 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
// |message_loop_|.
void AsyncBindContext();
- // Async versions of the public methods, run on |message_loop_|.
- // 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<base::MessageLoopProxy> message_loop_;
scoped_refptr<GpuChannelHost> gpu_channel_host_;
scoped_refptr<ContextProviderCommandBuffer> context_provider_;
@@ -108,20 +86,6 @@ class CONTENT_EXPORT RendererGpuVideoAcceleratorFactories
// For sending requests to allocate shared memory in the Browser process.
scoped_refptr<ThreadSafeSender> 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 |message_loop_| to
- // indicate their completion.
- // e.g. AsyncCreateVideoDecodeAccelerator()/AsyncCreateTextures() etc.
- base::WaitableEvent message_loop_async_waiter_;
-
- // The vda returned by the CreateVideoDecodeAccelerator function.
- scoped_ptr<media::VideoDecodeAccelerator> vda_;
-
- // Bitmap returned by ReadPixels().
- SkBitmap read_pixels_bitmap_;
-
DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories);
};

Powered by Google App Engine
This is Rietveld 408576698