| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 42 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
| 43 media::VideoCodecProfile profile, | 43 media::VideoCodecProfile profile, |
| 44 media::VideoDecodeAccelerator::Client* client) OVERRIDE; | 44 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
| 45 | 45 |
| 46 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 46 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
| 47 std::vector<uint32>* texture_ids, | 47 std::vector<uint32>* texture_ids, |
| 48 uint32 texture_target) OVERRIDE; | 48 uint32 texture_target) OVERRIDE; |
| 49 | 49 |
| 50 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; | 50 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; |
| 51 | 51 |
| 52 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, |
| 53 const gfx::Size& size, void* pixels) OVERRIDE; |
| 54 |
| 52 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; | 55 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; |
| 53 | 56 |
| 54 protected: | 57 protected: |
| 55 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; | 58 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; |
| 56 virtual ~RendererGpuVideoDecoderFactories(); | 59 virtual ~RendererGpuVideoDecoderFactories(); |
| 57 | 60 |
| 58 private: | 61 private: |
| 59 // Helper for the constructor to acquire the ContentGLContext on the | 62 // Helper for the constructor to acquire the ContentGLContext on the |
| 60 // compositor thread (when it is enabled). | 63 // compositor thread (when it is enabled). |
| 61 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context, | 64 void AsyncGetContext(WebGraphicsContext3DCommandBufferImpl* context, |
| 62 base::WaitableEvent* waiter); | 65 base::WaitableEvent* waiter); |
| 63 | 66 |
| 64 // Async versions of the public methods. They use output parameters instead | 67 // Async versions of the public methods. They use output parameters instead |
| 65 // of return values and each takes a WaitableEvent* param to signal completion | 68 // of return values and each takes a WaitableEvent* param to signal completion |
| 66 // (except for DeleteTexture, which is fire-and-forget). | 69 // (except for DeleteTexture, which is fire-and-forget). |
| 67 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on | 70 // AsyncCreateSharedMemory runs on the renderer thread and the rest run on |
| 68 // |message_loop_|. | 71 // |message_loop_|. |
| 69 void AsyncCreateVideoDecodeAccelerator( | 72 void AsyncCreateVideoDecodeAccelerator( |
| 70 media::VideoCodecProfile profile, | 73 media::VideoCodecProfile profile, |
| 71 media::VideoDecodeAccelerator::Client* client, | 74 media::VideoDecodeAccelerator::Client* client, |
| 72 media::VideoDecodeAccelerator** vda, | 75 media::VideoDecodeAccelerator** vda, |
| 73 base::WaitableEvent* waiter); | 76 base::WaitableEvent* waiter); |
| 74 void AsyncCreateTextures( | 77 void AsyncCreateTextures( |
| 75 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, | 78 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, |
| 76 uint32 texture_target, bool* success, base::WaitableEvent* waiter); | 79 uint32 texture_target, bool* success, base::WaitableEvent* waiter); |
| 77 void AsyncDeleteTexture(uint32 texture_id); | 80 void AsyncDeleteTexture(uint32 texture_id); |
| 81 void AsyncReadPixels(uint32 texture_id, uint32 texture_target, |
| 82 const gfx::Size& size, |
| 83 void* pixels, base::WaitableEvent* waiter); |
| 78 void AsyncCreateSharedMemory( | 84 void AsyncCreateSharedMemory( |
| 79 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); | 85 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); |
| 80 | 86 |
| 81 scoped_refptr<base::MessageLoopProxy> message_loop_; | 87 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 82 scoped_refptr<GpuChannelHost> gpu_channel_host_; | 88 scoped_refptr<GpuChannelHost> gpu_channel_host_; |
| 83 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context_; | 89 base::WeakPtr<WebGraphicsContext3DCommandBufferImpl> context_; |
| 84 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); |
| 85 }; | 91 }; |
| 86 | 92 |
| 87 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 93 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
| OLD | NEW |