Chromium Code Reviews| Index: content/common/gpu/gpu_messages.h |
| diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h |
| index eb6d6da2abf7933b5c4ab5d4e73fe6e92888f638..ef0df4c01e7ed92107be6f06aaecdf841087b733 100644 |
| --- a/content/common/gpu/gpu_messages.h |
| +++ b/content/common/gpu/gpu_messages.h |
| @@ -2,10 +2,12 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +// Multiply-included message file, hence no include guard here, but see below |
| +// for a much smaller-than-usual include guard section. |
| + |
| #include <vector> |
| #include <string> |
| - |
| #include "base/shared_memory.h" |
| #include "content/common/common_param_traits.h" |
| #include "content/common/gpu/gpu_info.h" |
| @@ -16,7 +18,14 @@ |
| #include "ipc/ipc_message_macros.h" |
| #include "ui/gfx/native_widget_types.h" |
| #include "ui/gfx/size.h" |
| -// Multiply-included message file, hence no include guard. |
| + |
| +// Singly-included section, not converted. |
|
jam
2011/06/27 18:21:35
nit: the ", not converted" part is not true.
Ami GONE FROM CHROMIUM
2011/06/27 18:43:49
Done. I don't know what that was talking about; I
|
| +#ifndef CONTENT_COMMON_GPU_GPU_MESSAGES_H_ |
| +#define CONTENT_COMMON_GPU_GPU_MESSAGES_H_ |
| +// typedef is required because commas confuse IPC_MESSAGE_* macro expansions. |
| +// Pair contains: first: last_token_read, second: last_token_written. |
| +typedef std::pair<int32, int32> ReadWriteTokens; |
| +#endif // CONTENT_COMMON_GPU_GPU_MESSAGES_H_ |
| #define IPC_MESSAGE_START GpuMsgStart |
| @@ -306,11 +315,12 @@ IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_CreateOffscreenSurface, |
| IPC_MESSAGE_CONTROL1(GpuChannelMsg_DestroySurface, |
| int /* route_id */) |
| -// Create hardware video decoder && associate it with the output |decoder_id|; |
| +// Create a hardware video decoder; the new route ID is returned through |
| +// AcceleratedVideoDecoderHostMsg_CreateDone. |
| // We need this to be control message because we had to map the GpuChannel and |
| // |decoder_id|. |
| IPC_MESSAGE_CONTROL3(GpuChannelMsg_CreateVideoDecoder, |
| - int32, /* decoder_id */ |
| + int32, /* decoder_host_id */ |
| uint32, /* command buffer route id*/ |
| std::vector<uint32>) /* configs */ |
| @@ -325,13 +335,6 @@ IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture, |
| int32, /* context_route_id */ |
| int32 /* host_id */) |
| -// Sent from Renderer process to the GPU process to give the texture IDs for |
| -// the textures the decoder will use for output. |
| -IPC_MESSAGE_CONTROL4(GpuChannelMsg_AssignTexturesToVideoDecoder, |
| - int32, /* Decoder ID */ |
| - std::vector<int32>, /* Picture buffer ID */ |
| - std::vector<uint32>, /* Texture ID */ |
| - std::vector<gfx::Size>) /* Size */ |
| //------------------------------------------------------------------------------ |
| // GPU Command Buffer Messages |
| // These are messages between a renderer process to the GPU process relating to |
| @@ -464,45 +467,66 @@ IPC_MESSAGE_ROUTED1(GpuTransportTextureHostMsg_TextureUpdated, |
| //------------------------------------------------------------------------------ |
| // Accelerated Video Decoder Messages |
| // These messages are sent from Renderer process to GPU process. |
| +// |
| +// Most of these messages defer execution until |tokens.second| is seen (using |
| +// |tokens.first| as a wrap-around indicator). |
| + |
| // Message to query configuration information from the GPU process. |
| -IPC_SYNC_MESSAGE_CONTROL1_1(AcceleratedVideoDecoderMsg_GetConfigs, |
| +IPC_SYNC_MESSAGE_CONTROL2_1(AcceleratedVideoDecoderMsg_GetConfigs, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| std::vector<uint32>, /* Proto config */ |
| std::vector<uint32>) /* Matching configs */ |
| // Message to initialize the accelerated video decoder. |
| -IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Initialize, |
| +IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_Initialize, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| std::vector<uint32>) /* Config */ |
| // Send input buffer for decoding. |
| -IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode, |
| - int32, /* bitstream_buffer_id */ |
| +IPC_MESSAGE_ROUTED4(AcceleratedVideoDecoderMsg_Decode, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| base::SharedMemoryHandle, /* input_buffer_handle */ |
| + int32, /* bitstream_buffer_id */ |
| int32) /* size */ |
| +// Sent from Renderer process to the GPU process to give the texture IDs for |
| +// the textures the decoder will use for output. Delays evaluation until |
| +// |token.second| is seen. |
| +IPC_MESSAGE_ROUTED4(AcceleratedVideoDecoderMsg_AssignTextures, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| + std::vector<int32>, /* Picture buffer ID */ |
| + std::vector<uint32>, /* Texture ID */ |
| + std::vector<gfx::Size>) /* Size */ |
| + |
| // Sent from Renderer process to the GPU process to give the system memory |
| // buffers that the decoder will use for output. |
| // |
| // The length of the list of SharedMemoryHandles cannot exceed |
| // FileDescriptorSet::MAX_DESCRIPTORS_PER_MESSAGE; see |
| // ipc/file_descriptor_set_posix. |
| -IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_AssignSysmemBuffers, |
| +IPC_MESSAGE_ROUTED4(AcceleratedVideoDecoderMsg_AssignSysmemBuffers, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| std::vector<int32>, /* Picture buffer ID */ |
| std::vector<base::SharedMemoryHandle>, /* Sysmem buffer */ |
| std::vector<gfx::Size>) /* Size */ |
| // Send from Renderer process to the GPU process to recycle the given picture |
| // buffer for further decoding. |
| -IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_ReusePictureBuffer, |
| +IPC_MESSAGE_ROUTED2(AcceleratedVideoDecoderMsg_ReusePictureBuffer, |
| + ReadWriteTokens, /* tokens: <read,write> */ |
| int32) /* Picture buffer ID */ |
| // Send flush request to the decoder. |
| -IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Flush) |
| +IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Flush, |
| + ReadWriteTokens) /* tokens: <read,write> */ |
| // Send abort request to the decoder. |
| -IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderMsg_Abort) |
| +IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderMsg_Abort, |
| + ReadWriteTokens) /* tokens: <read,write> */ |
| // Destroy and release decoder asynchronously. |
| -IPC_SYNC_MESSAGE_CONTROL0_0(AcceleratedVideoDecoderMsg_Destroy) |
| +IPC_SYNC_MESSAGE_CONTROL1_0(AcceleratedVideoDecoderMsg_Destroy, |
| + ReadWriteTokens) /* tokens: <read,write> */ |
| //------------------------------------------------------------------------------ |
| // Accelerated Video Decoder Host Messages |