diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-25 22:31:29 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-25 22:31:29 +0000 |
commit | e56f88c794704ff587fb7a0a3fdf8f7b85489cd3 (patch) | |
tree | 72854709cc97c58a8540c609776548818c78ea42 /media/video | |
parent | d30268aa9bd90bd8dd885124cd1eb8f45053c08b (diff) | |
download | chromium_src-e56f88c794704ff587fb7a0a3fdf8f7b85489cd3.zip chromium_src-e56f88c794704ff587fb7a0a3fdf8f7b85489cd3.tar.gz chromium_src-e56f88c794704ff587fb7a0a3fdf8f7b85489cd3.tar.bz2 |
Send hardware video frames with mailboxes.
Change media::VideoFrame from holding a raw texture id to
instead hold a gpu::Mailbox. The hardware video decoders
produce a mailbox on their context from the texture id
before putting it in the VideoFrame, and consume the
mailbox again when they receive the texture id back.
In the compositor, we hold onto the VideoFrame::MailboxHolder
as long as the mailboxed texture is in use in the compositor
(or its parent). This keeps the video decoders from writing
to the texture id, as they register a callback in the
VideoFrame to be called when it is destroyed.
BUG=179729
Review URL: https://chromiumcodereview.appspot.com/14199002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r-- | media/video/picture.cc | 10 | ||||
-rw-r--r-- | media/video/picture.h | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/media/video/picture.cc b/media/video/picture.cc index 54e4a23..7b32563 100644 --- a/media/video/picture.cc +++ b/media/video/picture.cc @@ -12,6 +12,16 @@ PictureBuffer::PictureBuffer(int32 id, gfx::Size size, uint32 texture_id) texture_id_(texture_id) { } +PictureBuffer::PictureBuffer(int32 id, + gfx::Size size, + uint32 texture_id, + const gpu::Mailbox& texture_mailbox) + : id_(id), + size_(size), + texture_id_(texture_id), + texture_mailbox_(texture_mailbox) { +} + Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id) : picture_buffer_id_(picture_buffer_id), bitstream_buffer_id_(bitstream_buffer_id) { diff --git a/media/video/picture.h b/media/video/picture.h index 5d3b775..d5be227 100644 --- a/media/video/picture.h +++ b/media/video/picture.h @@ -6,6 +6,7 @@ #define MEDIA_VIDEO_PICTURE_H_ #include "base/basictypes.h" +#include "gpu/command_buffer/common/mailbox.h" #include "media/base/media_export.h" #include "ui/gfx/size.h" @@ -16,6 +17,10 @@ namespace media { class MEDIA_EXPORT PictureBuffer { public: PictureBuffer(int32 id, gfx::Size size, uint32 texture_id); + PictureBuffer(int32 id, + gfx::Size size, + uint32 texture_id, + const gpu::Mailbox& texture_mailbox); // Returns the client-specified id of the buffer. int32 id() const { @@ -34,10 +39,15 @@ class MEDIA_EXPORT PictureBuffer { return texture_id_; } + const gpu::Mailbox& texture_mailbox() const { + return texture_mailbox_; + } + private: int32 id_; gfx::Size size_; uint32 texture_id_; + gpu::Mailbox texture_mailbox_; }; // A decoded picture frame. |