Chromium Code Reviews| Index: ppapi/api/ppb_video_decoder.idl |
| diff --git a/ppapi/api/ppb_video_decoder.idl b/ppapi/api/ppb_video_decoder.idl |
| index 90a3520fe754c5e00bb036481fb7d703d1b6c9fd..ab38e9fea06f0c6e4c46015a6db8514a468e6f0c 100644 |
| --- a/ppapi/api/ppb_video_decoder.idl |
| +++ b/ppapi/api/ppb_video_decoder.idl |
| @@ -91,9 +91,8 @@ interface PPB_VideoDecoder { |
| /** |
| * Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
| - * |buffer|. The plugin should maintain the buffer and not call Decode() again |
| - * until the decoder signals completion by returning PP_OK or by running |
| - * |callback|. |
| + * |buffer|. The plugin should wait until the decoder signals completion by |
| + * returning PP_OK or by running |callback| before calling Decode() again. |
|
igorc
2014/05/21 20:34:29
And another one - why do we need two ways to succe
|
| * |
| * In general, each bitstream buffer should contain a demuxed bitstream frame |
| * for the selected video codec. For example, H264 decoders expect to receive |
| @@ -117,6 +116,11 @@ interface PPB_VideoDecoder { |
| * completion. |
| * |
| * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Flush() |
| + * or Reset() call is pending. |
| + * Returns PP_ERROR_INPROGRESS if there is another Decode() call pending. |
| + * Returns PP_ERROR_NOMEMORY if a bitstream buffer can't be created. |
| + * Returns PP_ERROR_ABORTED when Reset() is called while Decode() is pending. |
| */ |
| int32_t Decode( |
| [in] PP_Resource video_decoder, |
| @@ -140,7 +144,9 @@ interface PPB_VideoDecoder { |
| * completion. |
| * |
| * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| - * Returns PP_OK if a picture is available. |
| + * Returns PP_ERROR_FAILED if the decoder isn't initialized or if a Reset() |
| + * call is pending. |
| + * Returns PP_ERROR_INPROGRESS if there is another GetPicture() call pending. |
| * Returns PP_ERROR_ABORTED when Reset() is called, or if a call to Flush() |
| * completes while GetPicture() is pending. |
| */ |
| @@ -164,13 +170,15 @@ interface PPB_VideoDecoder { |
| [in] PP_VideoPicture picture); |
|
igorc
2014/05/21 19:44:37
Could you clarify which fields need to be filled o
|
| /** |
| - * Flushes the decoder. The plugin should call this when it reaches the end of |
| - * its video stream in order to stop cleanly. The decoder will run all pending |
| - * calls to completion. The plugin should make no further calls to the decoder |
| - * other than GetPicture() and RecyclePicture() until the decoder signals |
| - * completion by running the callback. Just before completion, any pending |
| - * GetPicture() call will complete by running the callback with result |
| - * PP_ERROR_ABORTED to signal that no more pictures are available. |
| + * Flushes the decoder. The plugin should call Flush() when it reaches the |
| + * end of its video stream in order to stop cleanly. The decoder will run any |
| + * pending Decode() call to completion. The plugin should make no further |
| + * calls to the decoder other than GetPicture() and RecyclePicture() until |
|
igorc
2014/05/21 19:07:05
Just to clarify - am I not allowed to call Reset()
|
| + * the decoder signals completion by running |callback|. Just before |
| + * completion, any pending GetPicture() call will complete by running its |
| + * callback with result PP_ERROR_ABORTED to signal that no more pictures are |
| + * available. The plugin should recycle any pictures it is using before |
| + * resuming decoding. |
| * |
| * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
| * decoder. |
| @@ -178,6 +186,7 @@ interface PPB_VideoDecoder { |
| * completion. |
| * |
| * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| + * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
| */ |
| int32_t Flush( |
|
igorc
2014/05/21 20:15:47
Could you also clarify the difference between PP_O
|
| [in] PP_Resource video_decoder, |
| @@ -185,10 +194,12 @@ interface PPB_VideoDecoder { |
| /** |
| * Resets the decoder as quickly as possible. The plugin can call Reset() to |
| - * skip to another position in the video stream. Pending calls to Decode() and |
| - * GetPicture()) are immediately aborted, causing their callbacks to run with |
| - * PP_ERROR_ABORTED. The plugin should not make any further calls to the |
| - * decoder until the decoder signals completion by running |callback|. |
| + * skip to another position in the video stream. After Reset() returns, any |
| + * pending calls to Decode() and GetPicture()) abort, causing their callbacks |
| + * to run with PP_ERROR_ABORTED. The plugin should not make further calls to |
| + * the decoder until the decoder signals completion by running |callback|. |
| + * The pictures in use by the plugin remain valid until decoding is resumed, |
| + * but need not be recycled. |
| * |
| * @param[in] video_decoder A <code>PP_Resource</code> identifying the video |
| * decoder. |
| @@ -196,6 +207,7 @@ interface PPB_VideoDecoder { |
| * completion. |
| * |
| * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| + * Returns PP_ERROR_FAILED if the decoder isn't initialized. |
| */ |
| int32_t Reset( |
| [in] PP_Resource video_decoder, |