| 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_COMMAND_BUFFER_PROXY_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 typedef base::Callback<void( | 62 typedef base::Callback<void( |
| 63 const std::string& msg, int id)> GpuConsoleMessageCallback; | 63 const std::string& msg, int id)> GpuConsoleMessageCallback; |
| 64 | 64 |
| 65 CommandBufferProxyImpl(GpuChannelHost* channel, | 65 CommandBufferProxyImpl(GpuChannelHost* channel, |
| 66 int32 route_id, | 66 int32 route_id, |
| 67 int32 stream_id); | 67 int32 stream_id); |
| 68 ~CommandBufferProxyImpl() override; | 68 ~CommandBufferProxyImpl() override; |
| 69 | 69 |
| 70 void Destroy(); |
| 71 |
| 70 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and | 72 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and |
| 71 // returns it as an owned pointer to a media::VideoDecodeAccelerator. Returns | 73 // returns it as an owned pointer to a media::VideoDecodeAccelerator. Returns |
| 72 // NULL on failure to create the GpuVideoDecodeAcceleratorHost. | 74 // NULL on failure to create the GpuVideoDecodeAcceleratorHost. |
| 73 // Note that the GpuVideoDecodeAccelerator may still fail to be created in | 75 // Note that the GpuVideoDecodeAccelerator may still fail to be created in |
| 74 // the GPU process, even if this returns non-NULL. In this case the VDA client | 76 // the GPU process, even if this returns non-NULL. In this case the VDA client |
| 75 // is notified of an error later, after Initialize(). | 77 // is notified of an error later, after Initialize(). |
| 76 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder(); | 78 scoped_ptr<media::VideoDecodeAccelerator> CreateVideoDecoder(); |
| 77 | 79 |
| 78 // Sends an IPC message to create a GpuVideoEncodeAccelerator. Creates and | 80 // Sends an IPC message to create a GpuVideoEncodeAccelerator. Creates and |
| 79 // returns it as an owned pointer to a media::VideoEncodeAccelerator. Returns | 81 // returns it as an owned pointer to a media::VideoEncodeAccelerator. Returns |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 int32 route_id() const { return route_id_; } | 160 int32 route_id() const { return route_id_; } |
| 159 | 161 |
| 160 int32 stream_id() const { return stream_id_; } | 162 int32 stream_id() const { return stream_id_; } |
| 161 | 163 |
| 162 GpuChannelHost* channel() const { return channel_; } | 164 GpuChannelHost* channel() const { return channel_; } |
| 163 | 165 |
| 164 base::SharedMemoryHandle GetSharedStateHandle() const { | 166 base::SharedMemoryHandle GetSharedStateHandle() const { |
| 165 return shared_state_shm_->handle(); | 167 return shared_state_shm_->handle(); |
| 166 } | 168 } |
| 167 | 169 |
| 170 base::Lock* lock() { return lock_; } |
| 171 |
| 168 private: | 172 private: |
| 169 typedef std::map<int32, scoped_refptr<gpu::Buffer> > TransferBufferMap; | 173 typedef std::map<int32, scoped_refptr<gpu::Buffer> > TransferBufferMap; |
| 170 typedef base::hash_map<uint32, base::Closure> SignalTaskMap; | 174 typedef base::hash_map<uint32, base::Closure> SignalTaskMap; |
| 171 | 175 |
| 172 void CheckLock() { | 176 void CheckLock() { |
| 173 if (lock_) | 177 if (lock_) |
| 174 lock_->AssertAcquired(); | 178 lock_->AssertAcquired(); |
| 175 } | 179 } |
| 176 | 180 |
| 177 // Send an IPC message over the GPU channel. This is private to fully | 181 // Send an IPC message over the GPU channel. This is private to fully |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 237 |
| 234 SwapBuffersCompletionCallback swap_buffers_completion_callback_; | 238 SwapBuffersCompletionCallback swap_buffers_completion_callback_; |
| 235 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; | 239 UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_; |
| 236 | 240 |
| 237 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 241 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
| 238 }; | 242 }; |
| 239 | 243 |
| 240 } // namespace content | 244 } // namespace content |
| 241 | 245 |
| 242 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 246 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
| OLD | NEW |