Chromium Code Reviews| Index: ppapi/c/dev/ppb_video_decoder_dev.h |
| diff --git a/ppapi/c/dev/ppb_video_decoder_dev.h b/ppapi/c/dev/ppb_video_decoder_dev.h |
| index 1aed02db44c1aee4b424e917e0ee0ff3ddc44df0..af3d878f585f616a9f4e7ed8cddede5119d77f55 100644 |
| --- a/ppapi/c/dev/ppb_video_decoder_dev.h |
| +++ b/ppapi/c/dev/ppb_video_decoder_dev.h |
| @@ -9,8 +9,8 @@ |
| #include "ppapi/c/pp_completion_callback.h" |
| #include "ppapi/c/pp_var.h" |
| -#define PPB_VIDEODECODER_DEV_INTERFACE_0_5 "PPB_VideoDecoder(Dev);0.5" |
| -#define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_5 |
| +#define PPB_VIDEODECODER_DEV_INTERFACE_0_6 "PPB_VideoDecoder(Dev);0.6" |
| +#define PPB_VIDEODECODER_DEV_INTERFACE PPB_VIDEODECODER_DEV_INTERFACE_0_6 |
| // Video decoder interface. |
| // |
| @@ -70,10 +70,10 @@ struct PPB_VideoDecoder_Dev { |
| // |
| // Returns PP_TRUE on success, PP_FALSE otherwise. |
| PP_Bool (*GetConfigs)(PP_Instance instance, |
| - struct PP_VideoDecoderConfig_Dev* proto_config, |
| - struct PP_VideoDecoderConfig_Dev* matching_configs, |
| - int32_t matching_configs_size, |
| - int32_t* num_of_matching_configs); |
| + PP_VideoConfigElement* proto_config, |
| + PP_VideoConfigElement* matching_configs, |
| + uint32_t matching_configs_size, |
| + uint32_t* num_of_matching_configs); |
| // Creates a video decoder with requested |decoder_config|. |
| // |input_format| in |decoder_config| specifies the format of input access |
| @@ -88,7 +88,7 @@ struct PPB_VideoDecoder_Dev { |
| // |
| // The created decoder is returned as PP_Resource. NULL means failure. |
| PP_Resource (*Create)(PP_Instance instance, |
| - struct PP_VideoDecoderConfig_Dev* dec_config); |
| + PP_VideoConfigElement* dec_config); |
| // Tests whether |resource| is a video decoder created through Create |
| // function of this interface. |
| @@ -114,37 +114,48 @@ struct PPB_VideoDecoder_Dev { |
| struct PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| struct PP_CompletionCallback callback); |
| - // Provides the decoder with picture buffers for video decoding. This |
| - // function should be called when decoder has issued ProvidePictureBuffers |
| - // callback to the plugin with buffer requirements. |
| + // Provides the decoder with texture-backed picture buffers for video |
| + // decoding. |
| // |
| - // If the plugin is can determine how many and what kind of buffers are |
| - // needed by the decoder it can provide them in advance. For this purpose |
| - // the configuration map can provide how many extra buffers the decoder |
| - // implementation requires for seamless operation. |
| + // This function should be called when decoder has issued the |
| + // ProvidePictureBuffers callback to the plugin with buffer requirements. |
| // |
| - // The decoder will pause if AssignPictureBuffer hasn't been called with |
| - // sufficient buffers. |
| + // It can also be called in advance or outside of ProvidePictureBuffers calls |
| + // to provide the decoder with additional buffers. Additional buffers will be |
| + // added to the decoder's buffer pool. |
| // |
| - // If the decoder rejects the buffers it will return the buffers and issue |
| + // The decoder will pause in decoding if it has not received enough buffers. |
| + // |
| + // If the buffer is invalid, the decoder will return the buffer and will issue |
| // ProvidePictureBuffers again. |
| // |
| - // If AssignPictureBuffer is called multiple times the decoder will add them |
| - // to its pool of output pictures. |
| + // TODO(vmr/vrk): Decide if the API is too flexible, i.e. stricter rules on |
| + // errors/duplicates or requiring Assign*Buffers to only be called in response |
| + // to ProvidePictureBuffers. |
|
Ami GONE FROM CHROMIUM
2011/05/03 23:34:47
...in which case they should just be callback para
vrk (LEFT CHROMIUM)
2011/05/05 05:57:12
Good point. Added this almost verbatim to the comm
|
| + // |
| + // Parameters: |
| + // |video_decoder| is the previously created handle to the decoder instance. |
| + // |no_of_buffers| how many buffers are behind picture buffer pointer. |
| + // |buffers| contains the reference to the picture buffer that was |
| + // allocated. |
| + void (*AssignGLESBuffers)(PP_Resource video_decoder, |
| + uint32_t no_of_buffers, |
| + struct PP_GLESBuffer_Dev* buffers); |
| + |
| + // Provides the decoder with system memory-backed picture buffers for video |
|
Ami GONE FROM CHROMIUM
2011/05/03 23:34:47
I think this comment & the newline preceding it ca
vrk (LEFT CHROMIUM)
2011/05/05 05:57:12
Done. I did a similar thing with the comments for
|
| + // decoding. |
| // |
| - // TODO(vmr): this API feels too flexible... should we make it more strict |
| - // where the decoder errors on bad buffers/duplicate buffers? Perhaps |
| - // AssignPictureBuffer should only get called in response to |
| - // ProvidePictureBuffer? |
| + // Please see comment in AssignGLESBuffers for usage; it is the same as |
| + // AssignGLES except it is for buffers in system memory, not GPU. |
| // |
| // Parameters: |
| // |video_decoder| is the previously created handle to the decoder instance. |
| // |no_of_buffers| how many buffers are behind picture buffer pointer. |
| - // |picture_buffer| contains the reference to the picture buffer that was |
| - // processed. |
| - void (*AssignPictureBuffer)(PP_Resource video_decoder, |
| + // |buffers| contains the reference to the picture buffer that was |
| + // allocated. |
| + void (*AssignSysmemBuffers)(PP_Resource video_decoder, |
| uint32_t no_of_buffers, |
| - union PP_PictureData_Dev* picture_buffer); |
| + struct PP_SysmemBuffer_Dev* buffers); |
| // Tells the decoder to reuse given picture buffer. Typical use of this |
| // function is to call from PictureReady callback to recycle picture buffer |
| @@ -164,7 +175,7 @@ struct PPB_VideoDecoder_Dev { |
| // |picture_buffer| contains the reference to the picture buffer that was |
| // processed. |
| void (*ReusePictureBuffer)(PP_Resource video_decoder, |
| - union PP_PictureData_Dev* picture_buffer); |
| + int32_t picture_buffer_id); |
| // Dispatches flushing request to the decoder to flush both input and output |
| // buffers. Successful flushing will result in output of the pictures and |