summaryrefslogtreecommitdiffstats
path: root/media/video
diff options
context:
space:
mode:
authorvrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 16:29:07 +0000
committervrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 16:29:07 +0000
commit6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2 (patch)
tree32cf752999123875fac24b27da13d2d78cd4eddc /media/video
parent5818639c6c590be2290e72706064a6ab4b3b6aad (diff)
downloadchromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.zip
chromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.tar.gz
chromium_src-6ceb1207c32f4ecdd9d693e77c4e9ec5eda5efa2.tar.bz2
Remove redundant size and type information from VideoDecode PPAPI
The visible size of the video frame is determined at Create stage. The type of buffer (from system memory or texture-backed via GLES) is decided by the plugin when it calls AssignGLESBuffers or AssignSysmemBuffers in response to ProvidePictureBuffers. The decoded size will be the same as the size requested in ProvidePictureBuffers. Thus these values specified anywhere else is redundant, and introduces a place to have inconsistency. BUG=NONE TEST=ovda unittest passes; gles2 runs w/o crashing Review URL: http://codereview.chromium.org/7021020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r--media/video/picture.cc25
-rw-r--r--media/video/picture.h56
-rw-r--r--media/video/video_decode_accelerator.h17
3 files changed, 16 insertions, 82 deletions
diff --git a/media/video/picture.cc b/media/video/picture.cc
index 60fd3f5..54e4a23 100644
--- a/media/video/picture.cc
+++ b/media/video/picture.cc
@@ -6,30 +6,15 @@
namespace media {
-BaseBuffer::~BaseBuffer() {}
-
-// Implementations for the other constructors are found in
-// webkit/plugins/ppapi/ppb_video_decoder_impl.cc.
-// They are not included in this file because it would require
-// media/ to depend on files in ppapi/.
-BaseBuffer::BaseBuffer(int32 id, gfx::Size size) : id_(id), size_(size) {
-}
-
-GLESBuffer::GLESBuffer(int32 id, gfx::Size size, uint32 texture_id)
- : BaseBuffer(id, size),
+PictureBuffer::PictureBuffer(int32 id, gfx::Size size, uint32 texture_id)
+ : id_(id),
+ size_(size),
texture_id_(texture_id) {
}
-SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data)
- : BaseBuffer(id, size), data_(data) {
-}
-
-Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id,
- gfx::Size visible_size, gfx::Size decoded_size)
+Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id)
: picture_buffer_id_(picture_buffer_id),
- bitstream_buffer_id_(bitstream_buffer_id),
- visible_size_(visible_size),
- decoded_size_(decoded_size) {
+ bitstream_buffer_id_(bitstream_buffer_id) {
}
} // namespace media
diff --git a/media/video/picture.h b/media/video/picture.h
index 0126002..10cf47c 100644
--- a/media/video/picture.h
+++ b/media/video/picture.h
@@ -11,12 +11,11 @@
namespace media {
-// Common information about GLES & Sysmem picture buffers.
-// This is the media-namespace equivalent of PP_BufferInfo_Dev.
-class BaseBuffer {
+// A picture buffer that is composed of a GLES2 texture.
+// This is the media-namespace equivalent of PP_PictureBuffer_Dev.
+class PictureBuffer {
public:
- BaseBuffer(int32 id, gfx::Size size);
- virtual ~BaseBuffer();
+ PictureBuffer(int32 id, gfx::Size size, uint32 texture_id);
// Returns the client-specified id of the buffer.
int32 id() const {
@@ -28,17 +27,6 @@ class BaseBuffer {
return size_;
}
- private:
- int32 id_;
- gfx::Size size_;
-};
-
-// A picture buffer that is composed of a GLES2 texture and context.
-// This is the media-namespace equivalent of PP_GLESBuffer_Dev.
-class GLESBuffer : public BaseBuffer {
- public:
- GLESBuffer(int32 id, gfx::Size size, uint32 texture_id);
-
// Returns the id of the texture.
// NOTE: The texture id in the renderer process corresponds to a different
// texture id in the GPU process.
@@ -47,34 +35,16 @@ class GLESBuffer : public BaseBuffer {
}
private:
+ int32 id_;
+ gfx::Size size_;
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 {
- public:
- SysmemBuffer(int32 id, gfx::Size size, void* data);
-
- // Returns a pointer to the buffer data.
- void* data() const {
- return data_;
- }
-
- private:
- void* data_;
-};
-
// A decoded picture frame.
// 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(int32 picture_buffer_id, int32 bitstream_buffer_id);
// Returns the id of the picture buffer where this picture is contained.
int32 picture_buffer_id() const {
@@ -90,21 +60,9 @@ class Picture {
bitstream_buffer_id_ = bitstream_buffer_id;
}
- // Returns the visible size of the decoded picture in pixels.
- gfx::Size visible_size() const {
- return visible_size_;
- }
-
- // Returns the decoded size of the decoded picture in pixels.
- gfx::Size decoded_size() const {
- return decoded_size_;
- }
-
private:
int32 picture_buffer_id_;
int32 bitstream_buffer_id_;
- gfx::Size visible_size_;
- gfx::Size decoded_size_;
};
} // namespace media
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 55d1ad1..718f1ec 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -182,13 +182,6 @@ class VideoDecodeAccelerator
VIDEODECODERERROR_UNEXPECTED_FLUSH,
};
- // Represents the type of data buffer to be used by the decoder.
- enum MemoryType {
- PICTUREBUFFER_MEMORYTYPE_NONE = 0,
- PICTUREBUFFER_MEMORYTYPE_SYSTEM,
- PICTUREBUFFER_MEMORYTYPE_GL_TEXTURE,
- };
-
// Interface for collaborating with picture interface to provide memory for
// output picture and blitting them.
// This interface is extended by the various layers that relay messages back
@@ -201,12 +194,9 @@ class VideoDecodeAccelerator
// Callback to notify client that decoder has been initialized.
virtual void NotifyInitializeDone() = 0;
- // Callback to tell the information needed by the client to provide decoding
- // buffer to the decoder.
+ // Callback to tell client how many and what size of buffers to provide.
virtual void ProvidePictureBuffers(
- uint32 requested_num_of_buffers,
- const gfx::Size& dimensions,
- MemoryType type) = 0;
+ uint32 requested_num_of_buffers, const gfx::Size& dimensions) = 0;
// Callback to dismiss picture buffer that was assigned earlier.
virtual void DismissPictureBuffer(int32 picture_buffer_id) = 0;
@@ -256,7 +246,8 @@ class VideoDecodeAccelerator
//
// Parameters:
// |buffers| contains the allocated picture buffers for the output.
- virtual void AssignGLESBuffers(const std::vector<GLESBuffer>& buffers) = 0;
+ virtual void AssignPictureBuffers(
+ const std::vector<PictureBuffer>& 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