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