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 22 matching lines...) Expand all Loading... |
33 // Takes a ref on |gpu_channel_host| and tests |context| for NULL before each | 33 // Takes a ref on |gpu_channel_host| and tests |context| for NULL before each |
34 // use. | 34 // use. |
35 RendererGpuVideoDecoderFactories(GpuChannelHost* gpu_channel_host, | 35 RendererGpuVideoDecoderFactories(GpuChannelHost* gpu_channel_host, |
36 base::WeakPtr<ContentGLContext> context); | 36 base::WeakPtr<ContentGLContext> context); |
37 | 37 |
38 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 38 virtual media::VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
39 media::VideoDecodeAccelerator::Profile profile, | 39 media::VideoDecodeAccelerator::Profile profile, |
40 media::VideoDecodeAccelerator::Client* client) OVERRIDE; | 40 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
41 | 41 |
42 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 42 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
43 std::vector<uint32>* texture_ids) OVERRIDE; | 43 std::vector<uint32>* texture_ids, |
| 44 uint32* texture_target) OVERRIDE; |
44 | 45 |
45 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; | 46 virtual void DeleteTexture(uint32 texture_id) OVERRIDE; |
46 | 47 |
47 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; | 48 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; |
48 | 49 |
49 protected: | 50 protected: |
50 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; | 51 friend class base::RefCountedThreadSafe<RendererGpuVideoDecoderFactories>; |
51 virtual ~RendererGpuVideoDecoderFactories(); | 52 virtual ~RendererGpuVideoDecoderFactories(); |
52 | 53 |
53 private: | 54 private: |
54 // Async versions of the public methods. These all run on |message_loop_| | 55 // Async versions of the public methods. These all run on |message_loop_| |
55 // exclusively, and use output parameters instead of return values. Finally, | 56 // exclusively, and use output parameters instead of return values. Finally, |
56 // each takes a WaitableEvent* param to signal completion (except for | 57 // each takes a WaitableEvent* param to signal completion (except for |
57 // DeleteTexture, which is fire-and-forget). | 58 // DeleteTexture, which is fire-and-forget). |
58 void AsyncCreateVideoDecodeAccelerator( | 59 void AsyncCreateVideoDecodeAccelerator( |
59 media::VideoDecodeAccelerator::Profile profile, | 60 media::VideoDecodeAccelerator::Profile profile, |
60 media::VideoDecodeAccelerator::Client* client, | 61 media::VideoDecodeAccelerator::Client* client, |
61 media::VideoDecodeAccelerator** vda, | 62 media::VideoDecodeAccelerator** vda, |
62 base::WaitableEvent* waiter); | 63 base::WaitableEvent* waiter); |
63 void AsyncCreateTextures( | 64 void AsyncCreateTextures( |
64 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, | 65 int32 count, const gfx::Size& size, std::vector<uint32>* texture_ids, |
65 bool* success, base::WaitableEvent* waiter); | 66 uint32* texture_target, bool* success, base::WaitableEvent* waiter); |
66 void AsyncDeleteTexture(uint32 texture_id); | 67 void AsyncDeleteTexture(uint32 texture_id); |
67 void AsyncCreateSharedMemory( | 68 void AsyncCreateSharedMemory( |
68 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); | 69 size_t size, base::SharedMemory** shm, base::WaitableEvent* waiter); |
69 | 70 |
70 MessageLoop* message_loop_; | 71 MessageLoop* message_loop_; |
71 scoped_refptr<GpuChannelHost> gpu_channel_host_; | 72 scoped_refptr<GpuChannelHost> gpu_channel_host_; |
72 base::WeakPtr<ContentGLContext> context_; | 73 base::WeakPtr<ContentGLContext> context_; |
73 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); | 74 DISALLOW_IMPLICIT_CONSTRUCTORS(RendererGpuVideoDecoderFactories); |
74 }; | 75 }; |
75 | 76 |
76 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ | 77 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_DECODER_FACTORIES_H_ |
OLD | NEW |