diff options
author | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-13 18:28:08 +0000 |
---|---|---|
committer | vrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-13 18:28:08 +0000 |
commit | 1357ae79b9d474da177632a85227efb676c6d98e (patch) | |
tree | 558938eb3df48430f3864efe2563c848745683cf /media/video | |
parent | 2e095c8217b83f2daab9f1b970e943790de6b794 (diff) | |
download | chromium_src-1357ae79b9d474da177632a85227efb676c6d98e.zip chromium_src-1357ae79b9d474da177632a85227efb676c6d98e.tar.gz chromium_src-1357ae79b9d474da177632a85227efb676c6d98e.tar.bz2 |
Implement VideoDecoder IPC hooks from plugin to GPU process
This implements the communciation layers from the Renderer process
to the GPU process and back for the AcceleratedVideoDecoder PPAPI
interfaces.
BUG=NONE
TEST=NONE
Review URL: http://codereview.chromium.org/6876004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r-- | media/video/picture.cc | 8 | ||||
-rw-r--r-- | media/video/picture.h | 11 | ||||
-rw-r--r-- | media/video/video_decode_accelerator.h | 36 |
3 files changed, 33 insertions, 22 deletions
diff --git a/media/video/picture.cc b/media/video/picture.cc index a312eea..581e3c9 100644 --- a/media/video/picture.cc +++ b/media/video/picture.cc @@ -27,4 +27,12 @@ SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data) info_(id, size) { } +Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id, + gfx::Size visible_size, gfx::Size decoded_size) + : picture_buffer_id_(picture_buffer_id), + bitstream_buffer_id_(bitstream_buffer_id), + visible_size_(visible_size), + decoded_size_(decoded_size) { +} + } // namespace media diff --git a/media/video/picture.h b/media/video/picture.h index 465f3f5..f9611bd 100644 --- a/media/video/picture.h +++ b/media/video/picture.h @@ -93,6 +93,8 @@ class SysmemBuffer { // This is the media-namespace equivalent of PP_Picture_Dev. class Picture { public: + Picture(int32 picture_buffer_id, int32 bitstream_buffer_id, + gfx::Size visible_size, gfx::Size decoded_size); Picture(const PP_Picture_Dev& picture); // Returns the id of the picture buffer where this picture is contained. @@ -100,11 +102,10 @@ class Picture { return picture_buffer_id_; } - // Returns the handle associated with the bitstream buffer from which this - // picture was decoded. + // Returns the id of the bitstream buffer from which this frame was decoded. // TODO(vrk): Handle the case where a picture can span multiple buffers. - void* user_handle() const { - return user_handle_; + int32 bitstream_buffer_id() const { + return bitstream_buffer_id_; } // Returns the visible size of the decoded picture in pixels. @@ -119,7 +120,7 @@ class Picture { private: int32 picture_buffer_id_; - void* user_handle_; + int32 bitstream_buffer_id_; gfx::Size visible_size_; gfx::Size decoded_size_; }; diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h index 20ebdd9..807f923 100644 --- a/media/video/video_decode_accelerator.h +++ b/media/video/video_decode_accelerator.h @@ -190,7 +190,7 @@ class VideoDecodeAccelerator { // buffer to the decoder. virtual void ProvidePictureBuffers( uint32 requested_num_of_buffers, - gfx::Size dimensions, + const gfx::Size& dimensions, MemoryType type) = 0; // Callback to dismiss picture buffer that was assigned earlier. @@ -203,6 +203,16 @@ class VideoDecodeAccelerator { // outputted all displayable pictures. virtual void NotifyEndOfStream() = 0; + // Callback to notify that decoded has decoded the end of the current + // bitstream buffer. + virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) = 0; + + // Callback to notify that the outstanding flush has finished. + virtual void NotifyFlushDone() = 0; + + // Callback to notify that the outstanding abort has finished. + virtual void NotifyAbortDone() = 0; + // Callback to notify about decoding errors. virtual void NotifyError(Error error) = 0; }; @@ -227,15 +237,13 @@ class VideoDecodeAccelerator { virtual bool Initialize(const std::vector<uint32>& config) = 0; // Decodes given bitstream buffer. Once decoder is done with processing - // |bitstream_buffer| is will call |callback|. + // |bitstream_buffer| it will call NotifyEndOfBitstreamBuffer() with the + // bitstream buffer id. // Parameters: // |bitstream_buffer| is the input bitstream that is sent for decoding. - // |callback| contains the callback function pointer for informing about - // finished processing for |bitstream_buffer|. // // Returns true when command successfully accepted. Otherwise false. - virtual bool Decode(const BitstreamBuffer& bitstream_buffer, - VideoDecodeAcceleratorCallback* callback) = 0; + virtual bool Decode(const BitstreamBuffer& bitstream_buffer) = 0; // Assigns a set of picture buffers to the video decoder. // AssignGLESBuffers assigns texture-backed buffers. @@ -257,29 +265,23 @@ class VideoDecodeAccelerator { // // Parameters: // |picture_buffer_id| id of the picture buffer that is to be reused. - virtual void ReusePictureBuffer(uint32 picture_buffer_id) = 0; + 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 the |callback|. - // - // Parameters: - // |callback| contains the callback function pointer. + // flushing, the decode will call NotifyFlushDone(). // // Returns true when command successfully accepted. Otherwise false. - virtual bool Flush(VideoDecodeAcceleratorCallback* callback) = 0; + virtual bool Flush() = 0; // Aborts the decoder. Decode will abort the decoding as soon as possible and - // will not output anything. |callback| will be called as soon as abort has + // 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. // - // Parameters: - // |callback| contains the callback function pointer. - // // Returns true when command successfully accepted. Otherwise false. - virtual bool Abort(VideoDecodeAcceleratorCallback* callback) = 0; + virtual bool Abort() = 0; }; } // namespace media |