summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorjiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 00:54:59 +0000
committerjiesun@google.com <jiesun@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 00:54:59 +0000
commit36bfbcb2eeca4ad0c72525fb8469d5214679d626 (patch)
tree01a35b1c24e3a0a5e32586da97c23c6fb06a6faf /media/base
parent69e248cdb27c449d37ddac21058751c322c38dd2 (diff)
downloadchromium_src-36bfbcb2eeca4ad0c72525fb8469d5214679d626.zip
chromium_src-36bfbcb2eeca4ad0c72525fb8469d5214679d626.tar.gz
chromium_src-36bfbcb2eeca4ad0c72525fb8469d5214679d626.tar.bz2
code cleanup for media code for video renerers.
add more generic surface format and surface type signalling from video decoder to video renderer. if we want to allocate buffer in renderer, we had to know these kind of information. remove redundant ParseMediaFormat and duplicated width,height, egl_image_supports in derived class of VideoRenderBase. Review URL: http://codereview.chromium.org/2829009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/media_format.cc10
-rw-r--r--media/base/media_format.h1
-rw-r--r--media/base/video_frame.cc4
-rw-r--r--media/base/video_frame.h12
4 files changed, 10 insertions, 17 deletions
diff --git a/media/base/media_format.cc b/media/base/media_format.cc
index fca4f89..37371c5 100644
--- a/media/base/media_format.cc
+++ b/media/base/media_format.cc
@@ -44,15 +44,6 @@ const char kUncompressedAudio[] = "audio/x-uncompressed";
// kHeight Integer Display height of the surface
const char kUncompressedVideo[] = "video/x-uncompressed";
-// Represents decoded video data in EGLImage, typically from OpenMAX video
-// decoder.
-// Other information, such as surface format (i.e., YV12), stride and planes are
-// included with the buffer itself and is not part of the MediaFormat.
-// Expected keys:
-// kWidth Integer Display width of the surface
-// kHeight Integer Display height of the surface
-const char kUncompressedVideoEglImage[] = "video/x-uncompressed-eglimage";
-
// Major types of media types begin with the prefix "audio/" or "video/".
const char kMajorTypeVideo[] = "video/";
const char kMajorTypeAudio[] = "audio/";
@@ -63,6 +54,7 @@ const char kMajorTypeAudio[] = "audio/";
const char MediaFormat::kMimeType[] = "MimeType";
const char MediaFormat::kURL[] = "URL";
const char MediaFormat::kSurfaceFormat[] = "SurfaceFormat";
+const char MediaFormat::kSurfaceType[] = "SurfaceType";
const char MediaFormat::kSampleRate[] = "SampleRate";
const char MediaFormat::kSampleBits[] = "SampleBits";
const char MediaFormat::kChannels[] = "Channels";
diff --git a/media/base/media_format.h b/media/base/media_format.h
index 3a7cb3d..8b9cdb0 100644
--- a/media/base/media_format.h
+++ b/media/base/media_format.h
@@ -47,6 +47,7 @@ class MediaFormat {
// Common keys.
static const char kMimeType[];
static const char kURL[];
+ static const char kSurfaceType[];
static const char kSurfaceFormat[];
static const char kSampleRate[];
static const char kSampleBits[];
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
index fd684e7..857af70 100644
--- a/media/base/video_frame.cc
+++ b/media/base/video_frame.cc
@@ -118,7 +118,7 @@ void VideoFrame::CreateBlackFrame(int width, int height,
}
// static
-void VideoFrame::CreatePrivateFrame(VideoFrame::BufferType type,
+void VideoFrame::CreatePrivateFrame(VideoFrame::SurfaceType type,
VideoFrame::Format format,
size_t width,
size_t height,
@@ -194,7 +194,7 @@ bool VideoFrame::AllocateYUV() {
return false;
}
-VideoFrame::VideoFrame(VideoFrame::BufferType type,
+VideoFrame::VideoFrame(VideoFrame::SurfaceType type,
VideoFrame::Format format,
size_t width,
size_t height) {
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 10e85b2..ddf6644 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -37,7 +37,7 @@ class VideoFrame : public StreamSample {
ASCII, // A frame with ASCII content. For testing only.
};
- enum BufferType {
+ enum SurfaceType {
TYPE_SYSTEM_MEMORY,
TYPE_OMX_BUFFER_HEAD,
TYPE_EGL_IMAGE,
@@ -75,7 +75,7 @@ class VideoFrame : public StreamSample {
scoped_refptr<VideoFrame>* frame_out);
// Creates a new frame of |type| with given parameters.
- static void CreatePrivateFrame(VideoFrame::BufferType type,
+ static void CreatePrivateFrame(VideoFrame::SurfaceType type,
VideoFrame::Format format,
size_t width,
size_t height,
@@ -84,7 +84,7 @@ class VideoFrame : public StreamSample {
void* private_buffer,
scoped_refptr<VideoFrame>* frame_out);
- virtual BufferType type() const { return type_; }
+ virtual SurfaceType type() const { return type_; }
Format format() const { return format_; }
@@ -107,7 +107,7 @@ class VideoFrame : public StreamSample {
protected:
// Clients must use the static CreateFrame() method to create a new frame.
- VideoFrame(BufferType type,
+ VideoFrame(SurfaceType type,
Format format,
size_t video_width,
size_t video_height);
@@ -121,8 +121,8 @@ class VideoFrame : public StreamSample {
// Frame format.
Format format_;
- // Buffer type.
- BufferType type_;
+ // Surface type.
+ SurfaceType type_;
// Width and height of surface.
size_t width_;