summaryrefslogtreecommitdiffstats
path: root/media/base/video_frame.h
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 20:35:35 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 20:35:35 +0000
commit629b32899929cc043154ee54a4bf6364eccf5ce6 (patch)
tree77fb9a472f5b8302d20b836b21992e7e753968bb /media/base/video_frame.h
parent77d7aeebd314325c40d602bdaffe9342e3f4e29e (diff)
downloadchromium_src-629b32899929cc043154ee54a4bf6364eccf5ce6.zip
chromium_src-629b32899929cc043154ee54a4bf6364eccf5ce6.tar.gz
chromium_src-629b32899929cc043154ee54a4bf6364eccf5ce6.tar.bz2
Add a private opaque pointer option to VideoFrame.
This will allow using types such as EGLImageKHR for decoding and rendering. Patch by wjia@google.com: http://codereview.chromium.org/2008005/show BUG=none TEST=compiles Review URL: http://codereview.chromium.org/2137001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47307 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/video_frame.h')
-rw-r--r--media/base/video_frame.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index e5cb8ba..77563a9 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -61,7 +61,17 @@ class VideoFrame : public StreamSample {
static void CreateBlackFrame(int width, int height,
scoped_refptr<VideoFrame>* frame_out);
- virtual BufferType type() const { return TYPE_SYSTEM_MEMORY; }
+ // Creates a new frame of |type| with given parameters.
+ static void CreatePrivateFrame(VideoFrame::BufferType type,
+ VideoFrame::Format format,
+ size_t width,
+ size_t height,
+ base::TimeDelta timestamp,
+ base::TimeDelta duration,
+ void* private_buffer,
+ scoped_refptr<VideoFrame>* frame_out);
+
+ virtual BufferType type() const { return type_; }
Format format() const { return format_; }
@@ -77,12 +87,15 @@ class VideoFrame : public StreamSample {
// VideoFrame object and must not be freed by the caller.
uint8* data(size_t plane) const { return data_[plane]; }
+ void* private_buffer() const { return private_buffer_; }
+
// StreamSample interface.
virtual bool IsEndOfStream() const;
protected:
// Clients must use the static CreateFrame() method to create a new frame.
- VideoFrame(Format format,
+ VideoFrame(BufferType type,
+ Format format,
size_t video_width,
size_t video_height);
@@ -95,6 +108,9 @@ class VideoFrame : public StreamSample {
// Frame format.
Format format_;
+ // Buffer type.
+ BufferType type_;
+
// Width and height of surface.
size_t width_;
size_t height_;
@@ -111,6 +127,9 @@ class VideoFrame : public StreamSample {
// Array of data pointers to each plane.
uint8* data_[kMaxPlanes];
+ // Private buffer pointer, can be used for EGLImage.
+ void* private_buffer_;
+
DISALLOW_COPY_AND_ASSIGN(VideoFrame);
};