OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 class GpuChannelHost; | 24 class GpuChannelHost; |
25 class WebGraphicsContext3DCommandBufferImpl; | 25 class WebGraphicsContext3DCommandBufferImpl; |
26 | 26 |
27 // Glue code to expose functionality needed by media::GpuVideoDecoder to | 27 // Glue code to expose functionality needed by media::GpuVideoDecoder to |
28 // RenderViewImpl. This class is entirely an implementation detail of | 28 // RenderViewImpl. This class is entirely an implementation detail of |
29 // RenderViewImpl and only has its own header to allow extraction of its | 29 // RenderViewImpl and only has its own header to allow extraction of its |
30 // implementation from render_view_impl.cc which is already far too large. | 30 // implementation from render_view_impl.cc which is already far too large. |
31 // | 31 // |
32 // The public methods of the class can be called from any thread, and are | 32 // The public methods of the class can be called from any thread, and are |
33 // internally trampolined to the appropriate thread. GPU/GL-related calls go to | 33 // internally trampolined to the appropriate thread. GPU/GL-related calls go to |
34 // the constructor-argument loop (mostly that's the compositor thread, or the | 34 // the constructor-argument loop, and shmem-related calls go to the render |
35 // renderer thread if threaded compositing is disabled), and shmem-related calls | 35 // thread. |
Ami GONE FROM CHROMIUM
2013/06/11 23:48:05
I mourn the loss of the elided bits (as I've had t
wuchengli
2013/06/13 10:28:07
Done.
| |
36 // go to the render thread. | |
37 class CONTENT_EXPORT RendererGpuVideoDecoderFactories | 36 class CONTENT_EXPORT RendererGpuVideoDecoderFactories |
38 : public media::GpuVideoDecoder::Factories { | 37 : public media::GpuVideoDecoder::Factories { |
39 public: | 38 public: |
40 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each | 39 // Takes a ref on |gpu_channel_host| and tests |context| for loss before each |
41 // use. | 40 // use. |
42 RendererGpuVideoDecoderFactories( | 41 RendererGpuVideoDecoderFactories( |
43 GpuChannelHost* gpu_channel_host, | 42 GpuChannelHost* gpu_channel_host, |
44 const scoped_refptr<base::MessageLoopProxy>& message_loop, | 43 const scoped_refptr<base::MessageLoopProxy>& message_loop, |
45 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); | 44 WebGraphicsContext3DCommandBufferImpl* wgc3dcbi); |
46 | 45 |
47 // media::GpuVideoDecoder::Factories implementation. | 46 // media::GpuVideoDecoder::Factories implementation. |
48 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 47 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
49 media::VideoCodecProfile profile, | 48 media::VideoCodecProfile profile, |
50 media::VideoDecodeAccelerator::Client* client) OVERRIDE; | 49 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
51 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 50 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
52 std::vector<uint32>* texture_ids, | 51 std::vector<uint32>* texture_ids, |
53 uint32 texture_target) OVERRIDE; | 52 uint32 texture_target) OVERRIDE; |
54 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; | 53 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; |
55 virtual void ReadPixels(uint32 texture_id, | 54 virtual void ReadPixels(uint32 texture_id, |
56 uint32 texture_target, | 55 uint32 texture_target, |
57 const gfx::Size& size, | 56 const gfx::Size& size, |
58 const SkBitmap& pixels) OVERRIDE; | 57 const SkBitmap& pixels) OVERRIDE; |
59 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; | 58 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; |
60 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE; | 59 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE; |
61 virtual void Abort() OVERRIDE; | 60 virtual void Abort() OVERRIDE; |
62 virtual bool IsAborted() OVERRIDE; | 61 virtual bool IsAborted() OVERRIDE; |
63 | 62 |
63 // Makes a copy of |this|. | |
Ami GONE FROM CHROMIUM
2013/06/11 23:48:05
nit: s/Copy/Clone/ ?
("copy" connotes subordinat
wuchengli
2013/06/13 10:28:07
Done.
| |
64 virtual RendererGpuVideoDecoderFactories* Copy(); | |
Ami GONE FROM CHROMIUM
2013/06/11 23:48:05
RGVDF is refcounted so returning a raw pointer to
Ami GONE FROM CHROMIUM
2013/06/11 23:48:05
Drop "virtual".
wuchengli
2013/06/13 10:28:07
Done.
wuchengli
2013/06/13 10:28:07
Done.
| |
65 | |
64 protected: | 66 protected: |
65 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; | 67 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; |
66 virtual ~RendererGpuVideoDecoderFactories(); | 68 virtual ~RendererGpuVideoDecoderFactories(); |
67 | 69 |
68 private: | 70 private: |
71 RendererGpuVideoDecoderFactories( | |
Ami GONE FROM CHROMIUM
2013/06/11 23:48:05
Since this is only called by Copy, which is a memb
wuchengli
2013/06/13 10:28:07
Done.
| |
72 scoped_refptr<base::MessageLoopProxy> message_loop, | |
73 scoped_refptr<GpuChannelHost> gpu_channel_host, | |
74 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context); | |
75 | |
69 // Helper for the constructor to acquire the ContentGLContext on the | 76 // Helper for the constructor to acquire the ContentGLContext on the |
70 // compositor thread (when it is enabled). | 77 // compositor thread (when it is enabled). |
71 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context); | 78 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context); |
72 | 79 |
73 // Async versions of the public methods. They use output parameters instead | 80 // Async versions of the public methods. They use output parameters instead |
74 // of return values and each takes a WaitableEvent* param to signal completion | 81 // of return values and each takes a WaitableEvent* param to signal completion |
75 // (except for DeleteTexture, which is fire-and-forget). | 82 // (except for DeleteTexture, which is fire-and-forget). |
76 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on | 83 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on |
77 // |message_loop_|. | 84 // |message_loop_|. |
78 // The AsyncCreateVideoDecodeAccelerator returns its output in the vda_ | 85 // The AsyncCreateVideoDecodeAccelerator returns its output in the vda_ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 | 123 |
117 // Textures returned by the CreateTexture() function. | 124 // Textures returned by the CreateTexture() function. |
118 std::vector<uint32> created_textures_; | 125 std::vector<uint32> created_textures_; |
119 | 126 |
120 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); | 127 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); |
121 }; | 128 }; |
122 | 129 |
123 } // namespace content | 130 } // namespace content |
124 | 131 |
125 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 132 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
OLD | NEW |