Index: content/common/gpu/media/gpu_video_decode_accelerator.h |
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.h b/content/common/gpu/media/gpu_video_decode_accelerator.h |
index a7e5de33502e2ca235245e4357f08cef671d1311..96954ffd1b2629f27c9f6473cba98ae7c89a8b9c 100644 |
--- a/content/common/gpu/media/gpu_video_decode_accelerator.h |
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.h |
@@ -13,13 +13,22 @@ |
#include "ipc/ipc_message.h" |
#include "media/video/video_decode_accelerator.h" |
+namespace gpu { |
+class ReadWriteTokens; |
+} |
+ |
+class GpuCommandBufferStub; |
+ |
class GpuVideoDecodeAccelerator |
: public base::RefCountedThreadSafe<GpuVideoDecodeAccelerator>, |
public IPC::Channel::Listener, |
public IPC::Message::Sender, |
public media::VideoDecodeAccelerator::Client { |
public: |
- GpuVideoDecodeAccelerator(IPC::Message::Sender* sender, int32 host_route_id); |
+ GpuVideoDecodeAccelerator(IPC::Message::Sender* sender, |
+ int32 host_route_id, |
+ int32 decoder_route_id, |
+ GpuCommandBufferStub* stub); |
virtual ~GpuVideoDecodeAccelerator(); |
// IPC::Channel::Listener implementation. |
@@ -52,24 +61,56 @@ class GpuVideoDecodeAccelerator |
void AssignGLESBuffers(const std::vector<media::GLESBuffer>& buffers); |
+ // Callback to be fired when the underlying stub receives a new token. |
+ void OnSetToken(int32 token); |
+ |
private: |
+ // Defers |msg| for later processing if it specifies a write token that hasn't |
+ // come to pass yet, and set |*deferred| to true. Return false if the message |
+ // failed to parse. |
+ bool DeferMessageIfNeeded(const IPC::Message& msg, bool* deferred); |
+ |
// Handlers for IPC messages. |
- void OnGetConfigs(const std::vector<uint32>& config, |
- std::vector<uint32>* configs); |
- void OnInitialize(const std::vector<uint32>& configs); |
- void OnDecode(int32 id, base::SharedMemoryHandle handle, int32 size); |
- void OnAssignSysmemBuffers(const std::vector<int32>& buffer_ids, |
- const std::vector<base::SharedMemoryHandle>& data, |
- const std::vector<gfx::Size>& sizes); |
- void OnReusePictureBuffer(int32 picture_buffer_id); |
- void OnFlush(); |
- void OnAbort(); |
+ void OnGetConfigs( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ const std::vector<uint32>& config, |
+ std::vector<uint32>* configs); |
+ void OnInitialize( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ const std::vector<uint32>& configs); |
+ void OnDecode( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ base::SharedMemoryHandle handle, int32 id, int32 size); |
+ void OnAssignTextures( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ const std::vector<int32>& buffer_ids, |
+ const std::vector<uint32>& texture_ids, |
+ const std::vector<gfx::Size>& sizes); |
+ void OnAssignSysmemBuffers( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ const std::vector<int32> buffer_ids, |
+ const std::vector<base::SharedMemoryHandle> data, |
+ const std::vector<gfx::Size> sizes); |
+ void OnReusePictureBuffer( |
+ const gpu::ReadWriteTokens& /* tokens */, |
+ int32 picture_buffer_id); |
+ void OnFlush(const gpu::ReadWriteTokens& /* tokens */); |
+ void OnAbort(const gpu::ReadWriteTokens& /* tokens */); |
// Pointer to the IPC message sender. |
IPC::Message::Sender* sender_; |
// Route ID to communicate with the host. |
- int32 route_id_; |
+ int32 host_route_id_; |
+ |
+ // Route ID of the decoder. |
+ int32 decoder_route_id_; |
+ |
+ // Messages deferred for later processing when their tokens have come to pass. |
+ std::vector<IPC::Message*> deferred_messages_; |
+ |
+ // Unowned pointer to the underlying GpuCommandBufferStub. |
+ GpuCommandBufferStub* stub_; |
// Pointer to the underlying VideoDecodeAccelerator. |
scoped_ptr<media::VideoDecodeAccelerator> video_decode_accelerator_; |