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

Unified Diff: ppapi/cpp/video_decoder.h

Issue 291083003: Update PPB_VideoDecoder documentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify behavior of Flush, Reset. Created 6 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 side-by-side diff with in-line comments
Download patch
« ppapi/api/ppb_video_decoder.idl ('K') | « ppapi/c/ppb_video_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/video_decoder.h
diff --git a/ppapi/cpp/video_decoder.h b/ppapi/cpp/video_decoder.h
index f1f2d91fe4aff3c8b74695870048e8bb61560193..d1eded3059c1d17f645e1b9f06cc6ba67f6cd812 100644
--- a/ppapi/cpp/video_decoder.h
+++ b/ppapi/cpp/video_decoder.h
@@ -81,9 +81,8 @@ class VideoDecoder : public Resource {
const CompletionCallback& callback);
/// 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.
///
/// In general, each bitstream buffer should contain a demuxed bitstream frame
/// for the selected video codec. For example, H264 decoders expect to receive
@@ -105,6 +104,11 @@ class VideoDecoder : public Resource {
/// 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(uint32_t decode_id,
uint32_t size,
const void* buffer,
@@ -122,7 +126,9 @@ class VideoDecoder : public Resource {
/// called on completion, and on success, to hold the picture descriptor.
///
/// @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.
int32_t GetPicture(
@@ -136,31 +142,37 @@ class VideoDecoder : public Resource {
/// decoder.
void RecyclePicture(const PP_VideoPicture& picture);
- /// 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
+ /// 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] callback A <code>CompletionCallback</code> to be called on
/// 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(const CompletionCallback& callback);
/// 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] callback A <code>CompletionCallback</code> to be called on
/// completion.
///
/// @return An int32_t containing an error code from <code>pp_errors.h</code>.
- int32_t Reset(const CompletionCallback& callback);
+ /// Returns PP_ERROR_FAILED if the decoder isn't initialized.
+int32_t Reset(const CompletionCallback& callback);
};
} // namespace pp
« ppapi/api/ppb_video_decoder.idl ('K') | « ppapi/c/ppb_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698