summaryrefslogtreecommitdiffstats
path: root/media/video
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 19:57:49 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-25 19:57:49 +0000
commit5cd02a973830086a36ec7ef766bab1c84042a645 (patch)
tree7b434e9e3f7ba33226223af8703cd77352c9a534 /media/video
parent11f764bbe5614c7973203308235d907fd275f1f6 (diff)
downloadchromium_src-5cd02a973830086a36ec7ef766bab1c84042a645.zip
chromium_src-5cd02a973830086a36ec7ef766bab1c84042a645.tar.gz
chromium_src-5cd02a973830086a36ec7ef766bab1c84042a645.tar.bz2
Updated OMX decoder for recent PPAPI changes, and added to the build.
Had to move from content/gpu to content/common/gpu to allow gpu_video_service.cc to depend on the decoder. Removed some dead code and did some random cleanup while I was in there. BUG=none TEST=chrome compiles on cros/arm! Review URL: http://codereview.chromium.org/7057027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r--media/video/picture.cc13
-rw-r--r--media/video/picture.h29
-rw-r--r--media/video/video_decode_accelerator.h2
3 files changed, 15 insertions, 29 deletions
diff --git a/media/video/picture.cc b/media/video/picture.cc
index 581e3c9..f2d6632 100644
--- a/media/video/picture.cc
+++ b/media/video/picture.cc
@@ -6,25 +6,22 @@
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/.
-BufferInfo::BufferInfo(int32 id, gfx::Size size)
- : id_(id),
- size_(size) {
+BaseBuffer::BaseBuffer(int32 id, gfx::Size size) : id_(id), size_(size) {
}
GLESBuffer::GLESBuffer(
int32 id, gfx::Size size, uint32 texture_id, uint32 context_id)
- : texture_id_(texture_id),
- context_id_(context_id),
- info_(id, size) {
+ : BaseBuffer(id, size), texture_id_(texture_id), context_id_(context_id) {
}
SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data)
- : data_(data),
- info_(id, size) {
+ : BaseBuffer(id, size), data_(data) {
}
Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id,
diff --git a/media/video/picture.h b/media/video/picture.h
index f9611bd..860a4ee 100644
--- a/media/video/picture.h
+++ b/media/video/picture.h
@@ -15,12 +15,13 @@ struct PP_SysmemBuffer_Dev;
namespace media {
-// Information about the picture buffer.
+// Common information about GLES & Sysmem picture buffers.
// This is the media-namespace equivalent of PP_BufferInfo_Dev.
-class BufferInfo {
+class BaseBuffer {
public:
- BufferInfo(int32 id, gfx::Size size);
- BufferInfo(const PP_BufferInfo_Dev& info);
+ BaseBuffer(int32 id, gfx::Size size);
+ BaseBuffer(const PP_BufferInfo_Dev& info);
+ virtual ~BaseBuffer();
// Returns the client-specified id of the buffer.
int32 id() const {
@@ -39,7 +40,7 @@ class BufferInfo {
// A picture buffer that is composed of a GLES2 texture and context.
// This is the media-namespace equivalent of PP_GLESBuffer_Dev.
-class GLESBuffer {
+class GLESBuffer : public BaseBuffer {
public:
GLESBuffer(int32 id, gfx::Size size, uint32 texture_id, uint32 context_id);
GLESBuffer(const PP_GLESBuffer_Dev& buffer);
@@ -56,20 +57,14 @@ class GLESBuffer {
return context_id_;
}
- // Returns information regarding the buffer.
- const BufferInfo& buffer_info() const {
- return info_;
- }
-
private:
uint32 texture_id_;
uint32 context_id_;
- BufferInfo info_;
};
// A picture buffer that lives in system memory.
// This is the media-namespace equivalent of PP_SysmemBuffer_Dev.
-class SysmemBuffer {
+class SysmemBuffer : public BaseBuffer {
public:
SysmemBuffer(int32 id, gfx::Size size, void* data);
SysmemBuffer(const PP_SysmemBuffer_Dev&);
@@ -79,14 +74,8 @@ class SysmemBuffer {
return data_;
}
- // Returns information regarding the buffer.
- const BufferInfo& buffer_info() const {
- return info_;
- }
-
private:
void* data_;
- BufferInfo info_;
};
// A decoded picture frame.
@@ -103,7 +92,9 @@ class Picture {
}
// 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.
+ // TODO(fischman,vrk): Remove this field; pictures can span arbitrarily many
+ // BitstreamBuffers, and it's not clear what clients would do with this
+ // information, anyway.
int32 bitstream_buffer_id() const {
return bitstream_buffer_id_;
}
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 807f923..115315a 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -15,8 +15,6 @@
namespace media {
-typedef Callback0::Type VideoDecodeAcceleratorCallback;
-
// Enumeration defining global dictionary ranges for various purposes that are
// used to handle the configurations of the video decoder.
enum VideoAttributeKey {