OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ACCELERATOR_FACTORIES_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 6 #define CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
14 #include "content/child/thread_safe_sender.h" | 14 #include "content/child/thread_safe_sender.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "media/renderers/gpu_video_accelerator_factories.h" | 16 #include "media/renderers/gpu_video_accelerator_factories.h" |
17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class WaitableEvent; | 20 class WaitableEvent; |
21 } | 21 } |
22 | 22 |
23 namespace gpu { | |
24 class GpuMemoryBufferManager; | |
25 } | |
26 | |
23 namespace content { | 27 namespace content { |
24 class ContextProviderCommandBuffer; | 28 class ContextProviderCommandBuffer; |
25 class GLHelper; | 29 class GLHelper; |
26 class GpuChannelHost; | 30 class GpuChannelHost; |
27 class WebGraphicsContext3DCommandBufferImpl; | 31 class WebGraphicsContext3DCommandBufferImpl; |
28 | 32 |
29 // Glue code to expose functionality needed by media::GpuVideoAccelerator to | 33 // Glue code to expose functionality needed by media::GpuVideoAccelerator to |
30 // RenderViewImpl. This class is entirely an implementation detail of | 34 // RenderViewImpl. This class is entirely an implementation detail of |
31 // RenderViewImpl and only has its own header to allow extraction of its | 35 // RenderViewImpl and only has its own header to allow extraction of its |
32 // implementation from render_view_impl.cc which is already far too large. | 36 // implementation from render_view_impl.cc which is already far too large. |
(...skipping 18 matching lines...) Expand all Loading... | |
51 override; | 55 override; |
52 // Creates textures and produces them into mailboxes. Returns true on success | 56 // Creates textures and produces them into mailboxes. Returns true on success |
53 // or false on failure. | 57 // or false on failure. |
54 bool CreateTextures(int32 count, | 58 bool CreateTextures(int32 count, |
55 const gfx::Size& size, | 59 const gfx::Size& size, |
56 std::vector<uint32>* texture_ids, | 60 std::vector<uint32>* texture_ids, |
57 std::vector<gpu::Mailbox>* texture_mailboxes, | 61 std::vector<gpu::Mailbox>* texture_mailboxes, |
58 uint32 texture_target) override; | 62 uint32 texture_target) override; |
59 void DeleteTexture(uint32 texture_id) override; | 63 void DeleteTexture(uint32 texture_id) override; |
60 void WaitSyncPoint(uint32 sync_point) override; | 64 void WaitSyncPoint(uint32 sync_point) override; |
65 | |
66 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( | |
67 const gfx::Size& size, | |
68 gfx::GpuMemoryBuffer::Format format, | |
69 gfx::GpuMemoryBuffer::Usage usage) override; | |
70 | |
71 // Return or create a GLES2Interface. This method must be called from the | |
72 // thread associated with the 'task_runner' passed to the constructor. | |
reveman
2015/05/12 03:20:24
nit: think this is implied from the class descript
Daniele Castagna
2015/05/12 21:21:29
Removed the comment.
| |
73 gpu::gles2::GLES2Interface* GetGLES2Interface() override; | |
61 scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) override; | 74 scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) override; |
62 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; | 75 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; |
63 | 76 |
64 std::vector<media::VideoDecodeAccelerator::SupportedProfile> | 77 std::vector<media::VideoDecodeAccelerator::SupportedProfile> |
65 GetVideoDecodeAcceleratorSupportedProfiles() override; | 78 GetVideoDecodeAcceleratorSupportedProfiles() override; |
66 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 79 std::vector<media::VideoEncodeAccelerator::SupportedProfile> |
67 GetVideoEncodeAcceleratorSupportedProfiles() override; | 80 GetVideoEncodeAcceleratorSupportedProfiles() override; |
68 | 81 |
69 private: | 82 private: |
70 friend class base::RefCountedThreadSafe<RendererGpuVideoAcceleratorFactories>; | 83 friend class base::RefCountedThreadSafe<RendererGpuVideoAcceleratorFactories>; |
71 RendererGpuVideoAcceleratorFactories( | 84 RendererGpuVideoAcceleratorFactories( |
72 GpuChannelHost* gpu_channel_host, | 85 GpuChannelHost* gpu_channel_host, |
73 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 86 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
74 const scoped_refptr<ContextProviderCommandBuffer>& context_provider); | 87 const scoped_refptr<ContextProviderCommandBuffer>& context_provider); |
75 ~RendererGpuVideoAcceleratorFactories() override; | 88 ~RendererGpuVideoAcceleratorFactories() override; |
76 | 89 |
77 // Helper to bind |context_provider| to the |task_runner_| thread after | 90 // Helper to bind |context_provider| to the |task_runner_| thread after |
78 // construction. | 91 // construction. |
79 void BindContext(); | 92 void BindContext(); |
80 | 93 |
81 // Helper to get a pointer to the WebGraphicsContext3DCommandBufferImpl, | 94 // Helper to get a pointer to the WebGraphicsContext3DCommandBufferImpl, |
82 // if it has not been lost yet. | 95 // if it has not been lost yet. |
83 WebGraphicsContext3DCommandBufferImpl* GetContext3d(); | 96 WebGraphicsContext3DCommandBufferImpl* GetContext3d(); |
84 GLHelper* GetGLHelper(); | 97 GLHelper* GetGLHelper(); |
85 | 98 |
86 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 99 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
87 scoped_refptr<GpuChannelHost> gpu_channel_host_; | 100 scoped_refptr<GpuChannelHost> gpu_channel_host_; |
88 scoped_refptr<ContextProviderCommandBuffer> context_provider_; | 101 scoped_refptr<ContextProviderCommandBuffer> context_provider_; |
89 scoped_ptr<GLHelper> gl_helper_; | 102 scoped_ptr<GLHelper> gl_helper_; |
103 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | |
reveman
2015/05/12 03:20:24
nit: const pointer
Daniele Castagna
2015/05/12 21:21:29
Do you mean gpu::GpuMemoryBufferManager* const? Do
| |
90 | 104 |
91 // For sending requests to allocate shared memory in the Browser process. | 105 // For sending requests to allocate shared memory in the Browser process. |
92 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 106 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
93 | 107 |
94 DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories); | 108 DISALLOW_COPY_AND_ASSIGN(RendererGpuVideoAcceleratorFactories); |
95 }; | 109 }; |
96 | 110 |
97 } // namespace content | 111 } // namespace content |
98 | 112 |
99 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 113 #endif // CONTENT_RENDERER_MEDIA_RENDERER_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
OLD | NEW |