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/gpu/gpu_result_codes.h" | 20 #include "content/common/gpu/gpu_result_codes.h" |
21 #include "content/common/message_router.h" | 21 #include "content/common/message_router.h" |
22 #include "gpu/config/gpu_info.h" | 22 #include "gpu/config/gpu_info.h" |
23 #include "ipc/attachment_broker.h" | 23 #include "ipc/attachment_broker.h" |
24 #include "ipc/ipc_channel_handle.h" | 24 #include "ipc/ipc_channel_handle.h" |
25 #include "ipc/ipc_sync_channel.h" | 25 #include "ipc/ipc_sync_channel.h" |
26 #include "ipc/message_filter.h" | 26 #include "ipc/message_filter.h" |
| 27 #include "media/video/jpeg_decode_accelerator.h" |
27 #include "ui/events/latency_info.h" | 28 #include "ui/events/latency_info.h" |
28 #include "ui/gfx/geometry/size.h" | 29 #include "ui/gfx/geometry/size.h" |
29 #include "ui/gfx/gpu_memory_buffer.h" | 30 #include "ui/gfx/gpu_memory_buffer.h" |
30 #include "ui/gfx/native_widget_types.h" | 31 #include "ui/gfx/native_widget_types.h" |
31 #include "ui/gl/gpu_preference.h" | 32 #include "ui/gl/gpu_preference.h" |
32 | 33 |
33 class GURL; | 34 class GURL; |
34 class TransportTextureService; | 35 class TransportTextureService; |
35 struct GPUCreateCommandBufferConfig; | 36 struct GPUCreateCommandBufferConfig; |
36 | 37 |
37 namespace base { | 38 namespace base { |
38 class MessageLoop; | 39 class MessageLoop; |
39 class WaitableEvent; | 40 class WaitableEvent; |
40 } | 41 } |
41 | 42 |
42 namespace IPC { | 43 namespace IPC { |
43 class SyncMessageFilter; | 44 class SyncMessageFilter; |
44 } | 45 } |
45 | 46 |
46 namespace media { | 47 namespace media { |
| 48 class JpegDecodeAccelerator; |
47 class VideoDecodeAccelerator; | 49 class VideoDecodeAccelerator; |
48 class VideoEncodeAccelerator; | 50 class VideoEncodeAccelerator; |
49 } | 51 } |
50 | 52 |
51 namespace gpu { | 53 namespace gpu { |
52 class GpuMemoryBufferManager; | 54 class GpuMemoryBufferManager; |
53 } | 55 } |
54 | 56 |
55 namespace content { | 57 namespace content { |
56 class CommandBufferProxyImpl; | 58 class CommandBufferProxyImpl; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 gfx::GpuPreference gpu_preference); | 144 gfx::GpuPreference gpu_preference); |
143 | 145 |
144 // Creates a video decoder in the GPU process. | 146 // Creates a video decoder in the GPU process. |
145 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder( | 147 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder( |
146 int command_buffer_route_id); | 148 int command_buffer_route_id); |
147 | 149 |
148 // Creates a video encoder in the GPU process. | 150 // Creates a video encoder in the GPU process. |
149 scoped_ptr<media::VideoEncodeAccelerator> CreateVideoEncoder( | 151 scoped_ptr<media::VideoEncodeAccelerator> CreateVideoEncoder( |
150 int command_buffer_route_id); | 152 int command_buffer_route_id); |
151 | 153 |
| 154 // Creates a JPEG decoder in the GPU process. |
| 155 scoped_ptr<media::JpegDecodeAccelerator> CreateJpegDecoder( |
| 156 media::JpegDecodeAccelerator::Client* client); |
| 157 |
152 // Destroy a command buffer created by this channel. | 158 // Destroy a command buffer created by this channel. |
153 void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); | 159 void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); |
154 | 160 |
155 // Destroy this channel. Must be called on the main thread, before | 161 // Destroy this channel. Must be called on the main thread, before |
156 // destruction. | 162 // destruction. |
157 void DestroyChannel(); | 163 void DestroyChannel(); |
158 | 164 |
159 // Add a route for the current message loop. | 165 // Add a route for the current message loop. |
160 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); | 166 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); |
161 void RemoveRoute(int route_id); | 167 void RemoveRoute(int route_id); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 277 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
272 ProxyMap proxies_; | 278 ProxyMap proxies_; |
273 ProxyFlushInfo flush_info_; | 279 ProxyFlushInfo flush_info_; |
274 | 280 |
275 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 281 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
276 }; | 282 }; |
277 | 283 |
278 } // namespace content | 284 } // namespace content |
279 | 285 |
280 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 286 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
OLD | NEW |