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

Side by Side Diff: ppapi/c/dev/pp_video_dev.h

Issue 6901036: Update VideoDecode PPAPI structs to be consistent with media structures, part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months 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
OLDNEW
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2011 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 PPAPI_C_DEV_PP_VIDEO_DEV_H_ 5 #ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_
6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_ 6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_
7 7
8 #include "ppapi/c/dev/ppb_opengles_dev.h" 8 #include "ppapi/c/dev/ppb_opengles_dev.h"
9 #include "ppapi/c/pp_bool.h" 9 #include "ppapi/c/pp_bool.h"
10 #include "ppapi/c/pp_instance.h" 10 #include "ppapi/c/pp_instance.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // The data structure for video bitstream buffer. 264 // The data structure for video bitstream buffer.
265 struct PP_VideoBitstreamBuffer_Dev { 265 struct PP_VideoBitstreamBuffer_Dev {
266 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer 266 // Buffer to hold the bitstream data. Should be allocated using the PPB_Buffer
267 // interface for consistent interprocess behaviour. 267 // interface for consistent interprocess behaviour.
268 PP_Resource bitstream; 268 PP_Resource bitstream;
269 269
270 // Size of the bitstream contained in buffer (in bytes). 270 // Size of the bitstream contained in buffer (in bytes).
271 int32_t bitstream_size; 271 int32_t bitstream_size;
272 272
273 // Optional pointer for application to associate information with a sample. 273 // Handle to identify the bitstream buffer.
274 // The pointer will be associated with the resulting decoded picture.
275 // Typically applications associate timestamps with buffers.
276 void* user_handle; 274 void* user_handle;
277
278 // TODO(vmr): Add information about access unit boundaries.
279 }; 275 };
280 276
281 // Union for specifying picture data. 277 // Struct for specifiying picture buffers.
282 union PP_PictureData_Dev { 278 struct PP_PictureBuffer_Dev {
283 // Resource representing system memory from shared memory address space. 279 // Client-specified id for the picture buffer.
284 // Use PPB_Buffer_Dev interface to handle this resource.
285 PP_Resource sysmem;
286 // Structure to define explicitly a GLES2 context.
287 struct {
288 // Context allocated using PPB_Context3D_Dev.
289 PP_Resource context;
290 // Texture ID in the given context where picture is stored.
291 GLuint texture_id;
292 } gles2_texture;
293 // Client-specified id for the picture buffer. By using this value client can
294 // keep track of the buffers it has assigned to the video decoder and how they
295 // are passed back to it.
296 int32_t id; 280 int32_t id;
281
282 union {
283 // Resource representing system memory from shared memory address space.
284 // Use PPB_Buffer_Dev interface to handle this resource.
285 PP_Resource sysmem;
286 // Structure to define explicitly a GLES2 context.
287 struct {
288 // Context allocated using PPB_Context3D_Dev.
289 PP_Resource context;
290 // Texture ID in the given context where picture is stored.
291 GLuint texture_id;
292 } gles2_texture;
293 } storage;
294
295 PP_PictureBufferType_Dev storage_type;
296
297 // Pixel width and height of the buffer.
298 uint32_t width;
Ami GONE FROM CHROMIUM 2011/04/26 23:01:57 WDYT, worth using PP_Size?
vrk (LEFT CHROMIUM) 2011/04/27 00:40:33 Good catch! Yes, I think so. I changed this and th
299 uint32_t height;
297 }; 300 };
298 301
299 // Structure to describe the decoded output picture for the plug-in along with 302 // Structure to describe the decoded output picture for the plug-in along with
300 // optional metadata associated with the picture. 303 // optional metadata associated with the picture.
301 struct PP_Picture_Dev { 304 struct PP_Picture_Dev {
302 // Resource that represents the buffer where the picture data is stored. 305 // ID for the picture buffer where the picture is stored.
303 // Actual implementation style of the picture buffer may be OpenGL ES texture 306 int32_t picture_buffer_id;
304 // (allocated using PPB_OpenGLES2_Dev) or system memory (allocated using
305 // PPB_Buffer_Dev).
306 union PP_PictureData_Dev picture_data;
307 307
308 // Optional pointer to associated metadata with the picture. Typical 308 // Handle to identify the bitstream buffer from which this picture was
309 // information carried over metadata includes timestamps. If there is 309 // decoded.
310 // multiple NAL units each with their own respective metadata, only the 310 void* bitstream_user_handle;
311 // metadata from the latest call to Decode will be carried over. 311
312 void* user_handle; 312 // Visible width and height of the picture.
313 uint32_t visible_width;
314 uint32_t visible_height;
315
316 // Decoded width and height of the picture.
317 uint32_t decoded_width;
318 uint32_t decoded_height;
313 }; 319 };
314 320
315 // Enumeration for error events that may be reported through 321 // Enumeration for error events that may be reported through
316 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default 322 // PP_VideoDecodeErrorHandler_Func_Dev callback function to the plugin. Default
317 // error handling functionality expected from the plugin is to Flush and Destroy 323 // error handling functionality expected from the plugin is to Flush and Destroy
318 // the decoder. 324 // the decoder.
319 enum PP_VideoDecodeError_Dev { 325 enum PP_VideoDecodeError_Dev {
320 PP_VIDEODECODEERROR_NONE = 0, 326 PP_VIDEODECODEERROR_NONE = 0,
321 // Decoder has not been initialized and configured properly. 327 // Decoder has not been initialized and configured properly.
322 PP_VIDEODECODEERROR_UNINITIALIZED, 328 PP_VIDEODECODEERROR_UNINITIALIZED,
323 // Decoder does not support feature of configuration or bitstream. 329 // Decoder does not support feature of configuration or bitstream.
324 PP_VIDEODECODEERROR_UNSUPPORTED, 330 PP_VIDEODECODEERROR_UNSUPPORTED,
325 // Decoder did not get valid input. 331 // Decoder did not get valid input.
326 PP_VIDEODECODERERROR_INVALIDINPUT, 332 PP_VIDEODECODERERROR_INVALIDINPUT,
327 // Failure in memory allocation or mapping. 333 // Failure in memory allocation or mapping.
328 PP_VIDEODECODERERROR_MEMFAILURE, 334 PP_VIDEODECODERERROR_MEMFAILURE,
329 // Decoder was given bitstream that would result in output pictures but it 335 // Decoder was given bitstream that would result in output pictures but it
330 // has not been provided buffers to do all this. 336 // has not been provided buffers to do all this.
331 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS, 337 PP_VIDEODECODEERROR_INSUFFICIENT_BUFFERS,
332 // Decoder cannot continue operation due to insufficient resources for the 338 // Decoder cannot continue operation due to insufficient resources for the
333 // current configuration. 339 // current configuration.
334 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, 340 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES,
335 // Decoder hardware has reported hardware error. 341 // Decoder hardware has reported hardware error.
336 PP_VIDEODECODEERROR_HARDWARE 342 PP_VIDEODECODEERROR_HARDWARE
337 }; 343 };
338 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); 344 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4);
339 345
340 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */ 346 #endif /* PPAPI_C_DEV_PP_VIDEO_DEV_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698