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_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/atomic_sequence_num.h" | 11 #include "base/atomic_sequence_num.h" |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/common/gpu/gpu_process_launch_causes.h" | 19 #include "content/common/gpu/gpu_process_launch_causes.h" |
20 #include "content/common/message_router.h" | 20 #include "content/common/message_router.h" |
21 #include "gpu/config/gpu_info.h" | 21 #include "gpu/config/gpu_info.h" |
22 #include "ipc/ipc_channel_handle.h" | 22 #include "ipc/ipc_channel_handle.h" |
23 #include "ipc/ipc_channel_proxy.h" | 23 #include "ipc/ipc_channel_proxy.h" |
24 #include "ipc/ipc_sync_channel.h" | 24 #include "ipc/ipc_sync_channel.h" |
25 #include "media/video/video_decode_accelerator.h" | |
26 #include "media/video/video_encode_accelerator.h" | |
27 #include "ui/gfx/gpu_memory_buffer.h" | 25 #include "ui/gfx/gpu_memory_buffer.h" |
28 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
29 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
30 #include "ui/gl/gpu_preference.h" | 28 #include "ui/gl/gpu_preference.h" |
31 | 29 |
32 class GURL; | 30 class GURL; |
33 class TransportTextureService; | 31 class TransportTextureService; |
34 struct GPUCreateCommandBufferConfig; | 32 struct GPUCreateCommandBufferConfig; |
35 | 33 |
36 namespace base { | 34 namespace base { |
37 class MessageLoop; | 35 class MessageLoop; |
38 class MessageLoopProxy; | 36 class MessageLoopProxy; |
39 class WaitableEvent; | 37 class WaitableEvent; |
40 } | 38 } |
41 | 39 |
42 namespace IPC { | 40 namespace IPC { |
43 class SyncMessageFilter; | 41 class SyncMessageFilter; |
44 } | 42 } |
45 | 43 |
| 44 namespace media { |
| 45 class VideoDecodeAccelerator; |
| 46 class VideoEncodeAccelerator; |
| 47 } |
| 48 |
46 namespace content { | 49 namespace content { |
47 class CommandBufferProxyImpl; | 50 class CommandBufferProxyImpl; |
48 class GpuChannelHost; | 51 class GpuChannelHost; |
49 | 52 |
50 struct GpuListenerInfo { | 53 struct GpuListenerInfo { |
51 GpuListenerInfo(); | 54 GpuListenerInfo(); |
52 ~GpuListenerInfo(); | 55 ~GpuListenerInfo(); |
53 | 56 |
54 base::WeakPtr<IPC::Listener> listener; | 57 base::WeakPtr<IPC::Listener> listener; |
55 scoped_refptr<base::MessageLoopProxy> loop; | 58 scoped_refptr<base::MessageLoopProxy> loop; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Create and connect to a command buffer in the GPU process. | 121 // Create and connect to a command buffer in the GPU process. |
119 CommandBufferProxyImpl* CreateOffscreenCommandBuffer( | 122 CommandBufferProxyImpl* CreateOffscreenCommandBuffer( |
120 const gfx::Size& size, | 123 const gfx::Size& size, |
121 CommandBufferProxyImpl* share_group, | 124 CommandBufferProxyImpl* share_group, |
122 const std::vector<int32>& attribs, | 125 const std::vector<int32>& attribs, |
123 const GURL& active_url, | 126 const GURL& active_url, |
124 gfx::GpuPreference gpu_preference); | 127 gfx::GpuPreference gpu_preference); |
125 | 128 |
126 // Creates a video decoder in the GPU process. | 129 // Creates a video decoder in the GPU process. |
127 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder( | 130 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder( |
128 int command_buffer_route_id, | 131 int command_buffer_route_id); |
129 media::VideoCodecProfile profile); | |
130 | 132 |
131 // Creates a video encoder in the GPU process. | 133 // Creates a video encoder in the GPU process. |
132 scoped_ptr<media::VideoEncodeAccelerator> CreateVideoEncoder(); | 134 scoped_ptr<media::VideoEncodeAccelerator> CreateVideoEncoder( |
| 135 int command_buffer_route_id); |
133 | 136 |
134 // Destroy a command buffer created by this channel. | 137 // Destroy a command buffer created by this channel. |
135 void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); | 138 void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); |
136 | 139 |
137 // Add a route for the current message loop. | 140 // Add a route for the current message loop. |
138 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); | 141 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); |
139 void RemoveRoute(int route_id); | 142 void RemoveRoute(int route_id); |
140 | 143 |
141 GpuChannelHostFactory* factory() const { return factory_; } | 144 GpuChannelHostFactory* factory() const { return factory_; } |
142 | 145 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // Used to look up a proxy from its routing id. | 234 // Used to look up a proxy from its routing id. |
232 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 235 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
233 ProxyMap proxies_; | 236 ProxyMap proxies_; |
234 | 237 |
235 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 238 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
236 }; | 239 }; |
237 | 240 |
238 } // namespace content | 241 } // namespace content |
239 | 242 |
240 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 243 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |