diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:17:30 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:17:30 +0000 |
commit | 436fd41df6378a81cbd8706eb9b1daed95cc7cab (patch) | |
tree | d40cbe4296f2b39dc9221e48a90ff7d53140003e /media | |
parent | 67351452e1e16cb9b01c609ce185a9e819cf2254 (diff) | |
download | chromium_src-436fd41df6378a81cbd8706eb9b1daed95cc7cab.zip chromium_src-436fd41df6378a81cbd8706eb9b1daed95cc7cab.tar.gz chromium_src-436fd41df6378a81cbd8706eb9b1daed95cc7cab.tar.bz2 |
Overhauled OmxVideoDecodeAccelerator's state machine implementation and related code.
This implementation makes explicit the transitions being effected and the states
expected to be involved in each transition, instead of the previous
implementation's use of implicit information (e.g. "we just went from Idle to
Loaded, therefore we must be Abort()'ing"). This is not only much more readable
but also enables implementation of Reset() (for Seek) and replaces Abort()
(which never had a well-defined purpose that was consistent in documentation and
implementation, nor a customer use-case).
DID some TODOs in OmxVideoDecodeAccelerator:
- Replaced error-code checking boilerplate w/ a failure-handling macro.
- Simplified the component-name-getting dance in CreateComponent().
Updated the PPAPI interface:
- Removed GetConfigs & AssignSysmemBuffers (neither of which ever came into its own)
- Replaced Abort with Reset, and added Destroy (which still nobody calls, but
that'll change shortly).
- Cleaned up the interface's documentation.
BUG=86122
TEST=OVDATest, gles2 sample plugin
Review URL: http://codereview.chromium.org/7338010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/video/picture.h | 4 | ||||
-rw-r--r-- | media/video/video_decode_accelerator.h | 54 |
2 files changed, 28 insertions, 30 deletions
diff --git a/media/video/picture.h b/media/video/picture.h index e0ac773..0126002 100644 --- a/media/video/picture.h +++ b/media/video/picture.h @@ -50,6 +50,10 @@ class GLESBuffer : public BaseBuffer { uint32 texture_id_; }; +// TODO(fischman,vrk): rip out SysmemBuffer and all its vestiges (such as +// BaseBuffer's existence, VideoDecodeAccelerator::MemoryType, their ppapi +// equivalents, etc). Rename GLESBuffer to PictureBuffer. + // A picture buffer that lives in system memory. // This is the media-namespace equivalent of PP_SysmemBuffer_Dev. class SysmemBuffer : public BaseBuffer { diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h index ab0d471..85eef24 100644 --- a/media/video/video_decode_accelerator.h +++ b/media/video/video_decode_accelerator.h @@ -166,6 +166,8 @@ class VideoDecodeAccelerator { virtual ~VideoDecodeAccelerator(); // Enumeration of potential errors generated by the API. + // TODO(fischman): these errors are a bad match for both what OMX generates + // and for what the plugin wants. Overhaul this list with a more useful set. enum Error { VIDEODECODERERROR_NONE = 0, VIDEODECODERERROR_UNINITIALIZED, @@ -218,11 +220,14 @@ class VideoDecodeAccelerator { // bitstream buffer. virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) = 0; - // Callback to notify that the outstanding flush has finished. + // Flush completion callback. virtual void NotifyFlushDone() = 0; - // Callback to notify that the outstanding abort has finished. - virtual void NotifyAbortDone() = 0; + // Reset completion callback. + virtual void NotifyResetDone() = 0; + + // Destroy completion callback. + virtual void NotifyDestroyDone() = 0; // Callback to notify about decoding errors. virtual void NotifyError(Error error) = 0; @@ -230,19 +235,6 @@ class VideoDecodeAccelerator { // Video decoder functions. - // GetConfigs returns the supported configurations that is a subset of the - // given |requested_configs|. Unrecognized or malformed |requested_configs| - // elements return false and represent a failure; the client must not pass - // unknown request elements to Initialize. - // Parameters: - // |requested_configs| is the set of configurations the plugin is querying - // for support. - // |matched_configs| is the subset of |requested_configs| that the decoder - // supports. - virtual bool GetConfigs( - const std::vector<uint32>& requested_configs, - std::vector<uint32>* matched_configs) = 0; - // Initializes the video decoder with specific configuration. // Parameters: // |config| is the configuration on which the decoder should be initialized. @@ -257,9 +249,7 @@ class VideoDecodeAccelerator { // |bitstream_buffer| is the input bitstream that is sent for decoding. virtual void Decode(const BitstreamBuffer& bitstream_buffer) = 0; - // Assigns a set of picture buffers to the video decoder. - // AssignGLESBuffers assigns texture-backed buffers. - // AssignSysmemBuffers assigns system memory-backed buffers. + // Assigns a set of texture-backed picture buffers to the video decoder. // // Ownership of each picture buffer remains with the client, but the client // is not allowed to deallocate the buffer before the DismissPictureBuffer @@ -268,8 +258,6 @@ class VideoDecodeAccelerator { // Parameters: // |buffers| contains the allocated picture buffers for the output. virtual void AssignGLESBuffers(const std::vector<GLESBuffer>& buffers) = 0; - virtual void AssignSysmemBuffers( - const std::vector<SysmemBuffer>& buffers) = 0; // Sends picture buffers to be reused by the decoder. This needs to be called // for each buffer that has been processed so that decoder may know onto which @@ -279,17 +267,23 @@ class VideoDecodeAccelerator { // |picture_buffer_id| id of the picture buffer that is to be reused. virtual void ReusePictureBuffer(int32 picture_buffer_id) = 0; - // Flushes the decoder. Flushing will result in output of the - // pictures and buffers held inside the decoder and returning of bitstream - // buffers using the callbacks implemented by the plug-in. Once done with - // flushing, the decode will call NotifyFlushDone(). + // Flushes the decoder: all pending inputs will be decoded and pictures handed + // back to the client, followed by NotifyFlushDone() being called on the + // client. Can be used to implement "end of stream" notification. virtual void Flush() = 0; - // Aborts the decoder. Decode will abort the decoding as soon as possible and - // will not output anything. NotifyAbortDone() is called as soon as abort has - // been finished. After abort all buffers can be considered dismissed, even - // when there has not been callbacks to dismiss them. - virtual void Abort() = 0; + // Resets the decoder: all pending inputs are dropped immediately and the + // decoder returned to a state ready for further Decode()s, followed by + // NotifyResetDone() being called on the client. Can be used to implement + // "seek". + virtual void Reset() = 0; + + // Destroys the decoder: all pending inputs are dropped immediately and the + // component is freed, followed by NotifyDestroyDone being called on the + // client. After this is called no other calls may be made on the decoder, + // and after NotifyDestroyDone is called no callbacks will be made by the + // decoder on the client. + virtual void Destroy() = 0; }; } // namespace media |