Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/common/gpu_messages_internal.h

Issue 5526008: Simplify the magic required to create IPC message headers a bit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/gpu_messages.cc ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This header is meant to be included in multiple passes, hence no traditional
6 // header guard. It is included by backing_store_messages_internal.h
7 // See ipc_message_macros.h for explanation of the macros and passes.
8
9 // This file needs to be included again, even though we're actually included
10 // from it via utility_messages.h.
11
12 #include <vector> 5 #include <vector>
13 #include <string> 6 #include <string>
14 7
15 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
16 #include "chrome/common/gpu_video_common.h" 9 #include "chrome/common/gpu_video_common.h"
17 #include "ipc/ipc_message_macros.h" 10 #include "ipc/ipc_message_macros.h"
18 11
12 #define IPC_MESSAGE_START GpuMsgStart
13
19 namespace gfx { 14 namespace gfx {
20 class Size; 15 class Size;
21 } 16 }
22 17
23 namespace IPC { 18 namespace IPC {
24 struct ChannelHandle; 19 struct ChannelHandle;
25 } 20 }
26 21
27 struct GPUCreateCommandBufferConfig; 22 struct GPUCreateCommandBufferConfig;
28 class GPUInfo; 23 class GPUInfo;
29 24
30 //------------------------------------------------------------------------------ 25 //------------------------------------------------------------------------------
31 // GPU Messages 26 // GPU Messages
32 // These are messages from the browser to the GPU process. 27 // These are messages from the browser to the GPU process.
33 IPC_BEGIN_MESSAGES(Gpu) 28 // Tells the GPU process to create a new channel for communication with a
34 29 // given renderer. The channel name is returned in a
35 // Tells the GPU process to create a new channel for communication with a 30 // GpuHostMsg_ChannelEstablished message. The renderer ID is passed so that
36 // given renderer. The channel name is returned in a 31 // the GPU process reuses an existing channel to that process if it exists.
37 // GpuHostMsg_ChannelEstablished message. The renderer ID is passed so that 32 // This ID is a unique opaque identifier generated by the browser process.
38 // the GPU process reuses an existing channel to that process if it exists. 33 IPC_MESSAGE_CONTROL1(GpuMsg_EstablishChannel,
39 // This ID is a unique opaque identifier generated by the browser process. 34 int /* renderer_id */)
40 IPC_MESSAGE_CONTROL1(GpuMsg_EstablishChannel, 35
41 int /* renderer_id */) 36 // Provides a synchronization point to guarantee that the processing of
42 37 // previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has
43 // Provides a synchronization point to guarantee that the processing of 38 // completed. (This message can't be synchronous because the
44 // previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has 39 // GpuProcessHost uses an IPC::ChannelProxy, which sends all messages
45 // completed. (This message can't be synchronous because the 40 // asynchronously.) Results in a GpuHostMsg_SynchronizeReply.
46 // GpuProcessHost uses an IPC::ChannelProxy, which sends all messages 41 IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize)
47 // asynchronously.) Results in a GpuHostMsg_SynchronizeReply. 42
48 IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize) 43 // Tells the GPU process to create a context for collecting graphics card
49 44 // information.
50 // Tells the GPU process to create a context for collecting graphics card 45 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
51 // information.
52 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo)
53 46
54 #if defined(OS_MACOSX) 47 #if defined(OS_MACOSX)
55 // Tells the GPU process that the browser process handled the swap 48 // Tells the GPU process that the browser process handled the swap
56 // buffers request with the given number. Note that it is possible 49 // buffers request with the given number. Note that it is possible
57 // for the browser process to coalesce frames; it is not guaranteed 50 // for the browser process to coalesce frames; it is not guaranteed
58 // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message 51 // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message
59 // will result in a buffer swap on the browser side. 52 // will result in a buffer swap on the browser side.
60 IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, 53 IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK,
61 int /* renderer_id */, 54 int /* renderer_id */,
62 int32 /* route_id */, 55 int32 /* route_id */,
63 uint64 /* swap_buffers_count */) 56 uint64 /* swap_buffers_count */)
64 #endif 57 #endif
65 58
66 // Tells the GPU process to crash. 59 // Tells the GPU process to crash.
67 IPC_MESSAGE_CONTROL0(GpuMsg_Crash) 60 IPC_MESSAGE_CONTROL0(GpuMsg_Crash)
68 61
69 // Tells the GPU process to hang. 62 // Tells the GPU process to hang.
70 IPC_MESSAGE_CONTROL0(GpuMsg_Hang) 63 IPC_MESSAGE_CONTROL0(GpuMsg_Hang)
71
72 IPC_END_MESSAGES(Gpu)
73 64
74 //------------------------------------------------------------------------------ 65 //------------------------------------------------------------------------------
75 // GPU Host Messages 66 // GPU Host Messages
76 // These are messages from the GPU process to the browser. 67 // These are messages from the GPU process to the browser.
77 IPC_BEGIN_MESSAGES(GpuHost) 68 // Response to a GpuHostMsg_EstablishChannel message.
78 69 IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished,
79 // Response to a GpuHostMsg_EstablishChannel message. 70 IPC::ChannelHandle, /* channel_handle */
80 IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished, 71 GPUInfo /* GPU logging stats */)
81 IPC::ChannelHandle, /* channel_handle */ 72
82 GPUInfo /* GPU logging stats */) 73 // Response to a GpuMsg_Synchronize message.
83 74 IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply)
84 // Response to a GpuMsg_Synchronize message. 75
85 IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply) 76 // Response to a GpuMsg_CollectGraphicsInfo.
86 77 IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
87 // Response to a GpuMsg_CollectGraphicsInfo. 78 GPUInfo /* GPU logging stats */)
88 IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected,
89 GPUInfo /* GPU logging stats */)
90 79
91 #if defined(OS_LINUX) 80 #if defined(OS_LINUX)
92 // Get the XID for a view ID. 81 // Get the XID for a view ID.
93 IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID, 82 IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID,
94 gfx::NativeViewId, /* view */ 83 gfx::NativeViewId, /* view */
95 unsigned long /* xid */) 84 unsigned long /* xid */)
96 85
97 // Release the lock on the window. 86 // Release the lock on the window.
98 // If the associated view has been destroyed, destroy the window. 87 // If the associated view has been destroyed, destroy the window.
99 IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID, 88 IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID,
100 unsigned long /* xid */) 89 unsigned long /* xid */)
101 90
102 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID, 91 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID,
103 unsigned long, /* xid */ 92 unsigned long, /* xid */
104 gfx::Size, /* size */ 93 gfx::Size, /* size */
105 bool /* success */) 94 bool /* success */)
106 95
107 #elif defined(OS_MACOSX) 96 #elif defined(OS_MACOSX)
108 // This message, used on Mac OS X 10.6 and later (where IOSurface is 97 // This message, used on Mac OS X 10.6 and later (where IOSurface is
109 // supported), is sent from the GPU process to the browser to indicate that a 98 // supported), is sent from the GPU process to the browser to indicate that a
110 // new backing store was allocated for the given "window" (fake 99 // new backing store was allocated for the given "window" (fake
111 // PluginWindowHandle). The renderer ID and render view ID are needed in 100 // PluginWindowHandle). The renderer ID and render view ID are needed in
112 // order to uniquely identify the RenderWidgetHostView on the browser side. 101 // order to uniquely identify the RenderWidgetHostView on the browser side.
113 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, 102 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface,
114 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) 103 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params)
115 104
116 // This message notifies the browser process that the renderer 105 // This message notifies the browser process that the renderer
117 // swapped the buffers associated with the given "window", which 106 // swapped the buffers associated with the given "window", which
118 // should cause the browser to redraw the compositor's contents. 107 // should cause the browser to redraw the compositor's contents.
119 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 108 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
120 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) 109 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params)
121 #elif defined(OS_WIN) 110 #elif defined(OS_WIN)
122 // Get the HWND for the compositor window and if necessary, create it 111 // Get the HWND for the compositor window and if necessary, create it
123 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow, 112 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow,
124 int32, /* renderer_id */ 113 int32, /* renderer_id */
125 int32, /* render_view_id */ 114 int32, /* render_view_id */
126 gfx::PluginWindowHandle /* compositor_host_id */) 115 gfx::PluginWindowHandle /* compositor_host_id */)
127 116
128 IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite, 117 IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite,
129 int32, /* renderer_id */ 118 int32, /* renderer_id */
130 int32 /* render_view_id */) 119 int32 /* render_view_id */)
131 #endif 120 #endif
132 121
133 IPC_END_MESSAGES(GpuHost)
134
135 //------------------------------------------------------------------------------ 122 //------------------------------------------------------------------------------
136 // GPU Channel Messages 123 // GPU Channel Messages
137 // These are messages from a renderer process to the GPU process. 124 // These are messages from a renderer process to the GPU process.
138 IPC_BEGIN_MESSAGES(GpuChannel) 125 // Tells the GPU process to create a new command buffer that renders directly
139 126 // to a native view. The |render_view_id| is currently needed only on Mac OS
140 // Tells the GPU process to create a new command buffer that renders directly 127 // X in order to identify the window on the browser side into which the
141 // to a native view. The |render_view_id| is currently needed only on Mac OS 128 // rendering results go. A corresponding GpuCommandBufferStub is created.
142 // X in order to identify the window on the browser side into which the 129 IPC_SYNC_MESSAGE_CONTROL3_1(GpuChannelMsg_CreateViewCommandBuffer,
143 // rendering results go. A corresponding GpuCommandBufferStub is created. 130 gfx::NativeViewId, /* view */
144 IPC_SYNC_MESSAGE_CONTROL3_1(GpuChannelMsg_CreateViewCommandBuffer, 131 int32, /* render_view_id */
145 gfx::NativeViewId, /* view */ 132 GPUCreateCommandBufferConfig, /* init_params */
146 int32, /* render_view_id */ 133 int32 /* route_id */)
147 GPUCreateCommandBufferConfig, /* init_params */ 134
148 int32 /* route_id */) 135 // Tells the GPU process to create a new command buffer that renders to an
149 136 // offscreen frame buffer. If parent_route_id is not zero, the texture backing
150 // Tells the GPU process to create a new command buffer that renders to an 137 // the frame buffer is mapped into the corresponding parent command buffer's
151 // offscreen frame buffer. If parent_route_id is not zero, the texture backing 138 // namespace, with the name of parent_texture_id. This ID is in the parent's
152 // the frame buffer is mapped into the corresponding parent command buffer's 139 // namespace.
153 // namespace, with the name of parent_texture_id. This ID is in the parent's 140 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer,
154 // namespace. 141 int32, /* parent_route_id */
155 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer, 142 gfx::Size, /* size */
156 int32, /* parent_route_id */ 143 GPUCreateCommandBufferConfig, /* init_params */
157 gfx::Size, /* size */ 144 uint32, /* parent_texture_id */
158 GPUCreateCommandBufferConfig, /* init_params */ 145 int32 /* route_id */)
159 uint32, /* parent_texture_id */ 146
160 int32 /* route_id */) 147 // The CommandBufferProxy sends this to the GpuCommandBufferStub in its
161 148 // destructor, so that the stub deletes the actual CommandBufferService
162 // The CommandBufferProxy sends this to the GpuCommandBufferStub in its 149 // object that it's hosting.
163 // destructor, so that the stub deletes the actual CommandBufferService 150 // TODO(apatrick): Implement this.
164 // object that it's hosting. 151 IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer,
165 // TODO(apatrick): Implement this. 152 int32 /* instance_id */)
166 IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer, 153
167 int32 /* instance_id */) 154 // Create hardware video decoder && associate it with the output |decoder_id|;
168 155 // We need this to be control message because we had to map the GpuChannel and
169 // Create hardware video decoder && associate it with the output |decoder_id|; 156 // |decoder_id|.
170 // We need this to be control message because we had to map the GpuChannel and 157 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateVideoDecoder,
171 // |decoder_id|. 158 int32, /* context_route_id */
172 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateVideoDecoder, 159 int32) /* decoder_id */
173 int32, /* context_route_id */ 160
174 int32) /* decoder_id */ 161 // Release all resource of the hardware video decoder which was assocaited
175 162 // with the input |decoder_id|.
176 // Release all resource of the hardware video decoder which was assocaited 163 // TODO(hclam): This message needs to be asynchronous.
177 // with the input |decoder_id|. 164 IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyVideoDecoder,
178 // TODO(hclam): This message needs to be asynchronous. 165 int32 /* decoder_id */)
179 IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyVideoDecoder,
180 int32 /* decoder_id */)
181
182 IPC_END_MESSAGES(GpuChannel)
183 166
184 //------------------------------------------------------------------------------ 167 //------------------------------------------------------------------------------
185 // GPU Command Buffer Messages 168 // GPU Command Buffer Messages
186 // These are messages between a renderer process to the GPU process relating to 169 // These are messages between a renderer process to the GPU process relating to
187 // a single OpenGL context. 170 // a single OpenGL context.
188 IPC_BEGIN_MESSAGES(GpuCommandBuffer) 171 // Initialize a command buffer with the given number of command entries.
189 // Initialize a command buffer with the given number of command entries. 172 // Returns the shared memory handle for the command buffer mapped to the
190 // Returns the shared memory handle for the command buffer mapped to the 173 // calling process.
191 // calling process. 174 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize,
192 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize, 175 int32 /* size */,
193 int32 /* size */, 176 base::SharedMemoryHandle /* ring_buffer */)
194 base::SharedMemoryHandle /* ring_buffer */) 177
195 178 // Get the current state of the command buffer.
196 // Get the current state of the command buffer. 179 IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState,
197 IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, 180 gpu::CommandBuffer::State /* state */)
198 gpu::CommandBuffer::State /* state */) 181
199 182 // Get the current state of the command buffer asynchronously. State is
200 // Get the current state of the command buffer asynchronously. State is 183 // returned via UpdateState message.
201 // returned via UpdateState message. 184 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_AsyncGetState)
202 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_AsyncGetState) 185
203 186 // Synchronize the put and get offsets of both processes. Caller passes its
204 // Synchronize the put and get offsets of both processes. Caller passes its 187 // current put offset. Current state (including get offset) is returned.
205 // current put offset. Current state (including get offset) is returned. 188 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Flush,
206 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Flush, 189 int32 /* put_offset */,
207 int32 /* put_offset */, 190 gpu::CommandBuffer::State /* state */)
208 gpu::CommandBuffer::State /* state */) 191
209 192 // Asynchronously synchronize the put and get offsets of both processes.
210 // Asynchronously synchronize the put and get offsets of both processes. 193 // Caller passes its current put offset. Current state (including get offset)
211 // Caller passes its current put offset. Current state (including get offset) 194 // is returned via an UpdateState message.
212 // is returned via an UpdateState message. 195 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AsyncFlush,
213 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AsyncFlush, 196 int32 /* put_offset */)
214 int32 /* put_offset */) 197
215 198 // Return the current state of the command buffer following a request via
216 // Return the current state of the command buffer following a request via 199 // an AsyncGetState or AsyncFlush message. (This message is sent from the
217 // an AsyncGetState or AsyncFlush message. (This message is sent from the 200 // GPU process to the renderer process.)
218 // GPU process to the renderer process.) 201 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_UpdateState,
219 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_UpdateState, 202 gpu::CommandBuffer::State /* state */)
220 gpu::CommandBuffer::State /* state */) 203
221 204 // Indicates that a SwapBuffers call has been issued.
222 // Indicates that a SwapBuffers call has been issued. 205 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_SwapBuffers)
223 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_SwapBuffers) 206
224 207 // Create a shared memory transfer buffer. Returns an id that can be used to
225 // Create a shared memory transfer buffer. Returns an id that can be used to 208 // identify the transfer buffer from a comment.
226 // identify the transfer buffer from a comment. 209 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateTransferBuffer,
227 IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateTransferBuffer, 210 int32 /* size */,
228 int32 /* size */, 211 int32 /* id */)
229 int32 /* id */) 212
230 213 // Destroy a previously created transfer buffer.
231 // Destroy a previously created transfer buffer. 214 IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_DestroyTransferBuffer,
232 IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_DestroyTransferBuffer, 215 int32 /* id */)
233 int32 /* id */) 216
234 217 // Get the shared memory handle for a transfer buffer mapped to the callers
235 // Get the shared memory handle for a transfer buffer mapped to the callers 218 // process.
236 // process. 219 IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer,
237 IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer, 220 int32 /* id */,
238 int32 /* id */, 221 base::SharedMemoryHandle /* transfer_buffer */,
239 base::SharedMemoryHandle /* transfer_buffer */, 222 uint32 /* size */)
240 uint32 /* size */) 223
241 224 // Send from command buffer stub to proxy when window is invalid and must be
242 // Send from command buffer stub to proxy when window is invalid and must be 225 // repainted.
243 // repainted. 226 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_NotifyRepaint)
244 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_NotifyRepaint) 227
245 228 // Tells the GPU process to resize an offscreen frame buffer.
246 // Tells the GPU process to resize an offscreen frame buffer. 229 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer,
247 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer, 230 gfx::Size /* size */)
248 gfx::Size /* size */)
249 231
250 #if defined(OS_MACOSX) 232 #if defined(OS_MACOSX)
251 // On Mac OS X the GPU plugin must be offscreen, because there is no 233 // On Mac OS X the GPU plugin must be offscreen, because there is no
252 // true cross-process window hierarchy. For this reason we must send 234 // true cross-process window hierarchy. For this reason we must send
253 // resize events explicitly to the command buffer stub so it can 235 // resize events explicitly to the command buffer stub so it can
254 // reallocate its backing store and send the new one back to the 236 // reallocate its backing store and send the new one back to the
255 // browser. This message is currently used only on 10.6 and later. 237 // browser. This message is currently used only on 10.6 and later.
256 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetWindowSize, 238 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetWindowSize,
257 gfx::Size /* size */) 239 gfx::Size /* size */)
258 #endif 240 #endif
259 241
260 IPC_END_MESSAGES(GpuCommandBuffer)
261
262 //------------------------------------------------------------------------------ 242 //------------------------------------------------------------------------------
263 // GPU Video Decoder Messages 243 // GPU Video Decoder Messages
264 // These messages are sent from Renderer process to GPU process. 244 // These messages are sent from Renderer process to GPU process.
265 IPC_BEGIN_MESSAGES(GpuVideoDecoder) 245 // Initialize and configure GpuVideoDecoder asynchronously.
266 // Initialize and configure GpuVideoDecoder asynchronously. 246 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_Initialize,
267 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_Initialize, 247 GpuVideoDecoderInitParam)
268 GpuVideoDecoderInitParam) 248
269 249 // Destroy and release GpuVideoDecoder asynchronously.
270 // Destroy and release GpuVideoDecoder asynchronously. 250 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Destroy)
271 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Destroy) 251
272 252 // Start decoder flushing operation.
273 // Start decoder flushing operation. 253 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Flush)
274 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Flush) 254
275 255 // Tell the decoder to start prerolling.
276 // Tell the decoder to start prerolling. 256 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Preroll)
277 IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Preroll) 257
278 258 // Send input buffer to GpuVideoDecoder.
279 // Send input buffer to GpuVideoDecoder. 259 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_EmptyThisBuffer,
280 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_EmptyThisBuffer, 260 GpuVideoDecoderInputBufferParam)
281 GpuVideoDecoderInputBufferParam) 261
282 262 // Ask the GPU process to produce a video frame with the ID.
283 // Ask the GPU process to produce a video frame with the ID. 263 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_ProduceVideoFrame,
284 IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_ProduceVideoFrame, 264 int32) /* Video Frame ID */
285 int32) /* Video Frame ID */ 265
286 266 // Sent from Renderer process to the GPU process to notify that textures are
287 // Sent from Renderer process to the GPU process to notify that textures are 267 // generated for a video frame.
288 // generated for a video frame. 268 IPC_MESSAGE_ROUTED2(GpuVideoDecoderMsg_VideoFrameAllocated,
289 IPC_MESSAGE_ROUTED2(GpuVideoDecoderMsg_VideoFrameAllocated, 269 int32, /* Video Frame ID */
290 int32, /* Video Frame ID */ 270 std::vector<uint32>) /* Textures for video frame */
291 std::vector<uint32>) /* Textures for video frame */
292
293 IPC_END_MESSAGES(GpuVideoDecoder)
294 271
295 //------------------------------------------------------------------------------ 272 //------------------------------------------------------------------------------
296 // GPU Video Decoder Host Messages 273 // GPU Video Decoder Host Messages
297 // These messages are sent from GPU process to Renderer process. 274 // These messages are sent from GPU process to Renderer process.
298 IPC_BEGIN_MESSAGES(GpuVideoDecoderHost) 275 // Inform GpuVideoDecoderHost that a GpuVideoDecoder is created.
299 // Inform GpuVideoDecoderHost that a GpuVideoDecoder is created. 276 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_CreateVideoDecoderDone,
300 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_CreateVideoDecoderDone, 277 int32) /* decoder_id */
301 int32) /* decoder_id */ 278
302 279 // Confirm GpuVideoDecoder had been initialized or failed to initialize.
303 // Confirm GpuVideoDecoder had been initialized or failed to initialize. 280 // TODO(hclam): Change this to Done instead of ACK.
304 // TODO(hclam): Change this to Done instead of ACK. 281 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_InitializeACK,
305 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_InitializeACK, 282 GpuVideoDecoderInitDoneParam)
306 GpuVideoDecoderInitDoneParam) 283
307 284 // Confrim GpuVideoDecoder had been destroyed properly.
308 // Confrim GpuVideoDecoder had been destroyed properly. 285 // TODO(hclam): Change this to Done instead of ACK.
309 // TODO(hclam): Change this to Done instead of ACK. 286 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_DestroyACK)
310 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_DestroyACK) 287
311 288 // Confirm decoder had been flushed.
312 // Confirm decoder had been flushed. 289 // TODO(hclam): Change this to Done instead of ACK.
313 // TODO(hclam): Change this to Done instead of ACK. 290 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_FlushACK)
314 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_FlushACK) 291
315 292 // Confirm preroll operation is done.
316 // Confirm preroll operation is done. 293 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_PrerollDone)
317 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_PrerollDone) 294
318 295 // GpuVideoDecoder has consumed input buffer from transfer buffer.
319 // GpuVideoDecoder has consumed input buffer from transfer buffer. 296 // TODO(hclam): Change this to Done instead of ACK.
320 // TODO(hclam): Change this to Done instead of ACK. 297 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferACK)
321 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferACK) 298
322 299 // GpuVideoDecoder require new input buffer.
323 // GpuVideoDecoder require new input buffer. 300 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferDone)
324 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferDone) 301
325 302 // GpuVideoDecoder reports that a video frame is ready to be consumed.
326 // GpuVideoDecoder reports that a video frame is ready to be consumed. 303 IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_ConsumeVideoFrame,
327 IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_ConsumeVideoFrame, 304 int32, /* Video Frame ID */
328 int32, /* Video Frame ID */ 305 int64, /* Timestamp in microseconds */
329 int64, /* Timestamp in microseconds */ 306 int64, /* Duration in microseconds */
330 int64, /* Duration in microseconds */ 307 int32) /* Flags */
331 int32) /* Flags */ 308
332 309 // Allocate video frames for output of the hardware video decoder.
333 // Allocate video frames for output of the hardware video decoder. 310 IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames,
334 IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames, 311 int32, /* Number of video frames to generate */
335 int32, /* Number of video frames to generate */ 312 uint32, /* Width of the video frame */
336 uint32, /* Width of the video frame */ 313 uint32, /* Height of the video frame */
337 uint32, /* Height of the video frame */ 314 int32 /* Format of the video frame */)
338 int32 /* Format of the video frame */) 315
339 316 // Release all video frames allocated for a hardware video decoder.
340 // Release all video frames allocated for a hardware video decoder. 317 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames)
341 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames) 318
342 319 // GpuVideoDecoder report output format change.
343 // GpuVideoDecoder report output format change. 320 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange,
344 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange, 321 GpuVideoDecoderFormatChangeParam)
345 GpuVideoDecoderFormatChangeParam) 322
346 323 // GpuVideoDecoder report error.
347 // GpuVideoDecoder report error. 324 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification,
348 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification, 325 GpuVideoDecoderErrorInfoParam)
349 GpuVideoDecoderErrorInfoParam)
350
351 IPC_END_MESSAGES(GpuVideoDecoderHost)
OLDNEW
« no previous file with comments | « chrome/common/gpu_messages.cc ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698