summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/gpu/gpu_video_decoder.cc2
-rw-r--r--media/base/video_frame.h16
-rw-r--r--media/filters/video_renderer_base.h5
-rw-r--r--media/tools/player_x11/gles_video_renderer.cc5
-rw-r--r--media/video/omx_video_decode_engine.cc7
-rw-r--r--webkit/glue/webvideoframe_impl.cc6
6 files changed, 17 insertions, 24 deletions
diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc
index d62d8043..9c948aa 100644
--- a/chrome/gpu/gpu_video_decoder.cc
+++ b/chrome/gpu/gpu_video_decoder.cc
@@ -110,8 +110,6 @@ void GpuVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) {
param.surface_type_ =
GpuVideoDecoderInitDoneParam::SurfaceTypeSystemMemory;
break;
- case VideoFrame::TYPE_DIRECT3DSURFACE:
- case VideoFrame::TYPE_EGL_IMAGE:
default:
NOTREACHED();
}
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index cc54bba..0eb38fb 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -39,16 +39,20 @@ class VideoFrame : public StreamSample {
};
enum SurfaceType {
+ // Video frame is backed by system memory. The memory can be allocated by
+ // this object or be provided externally.
TYPE_SYSTEM_MEMORY,
- TYPE_OMXBUFFERHEAD,
- TYPE_EGL_IMAGE,
- TYPE_MFBUFFER,
- TYPE_DIRECT3DSURFACE
+
+ // Video frame is stored in GL texture(s).
+ TYPE_GL_TEXTURE,
+
+ // Video frame is stored in Direct3D texture(s).
+ TYPE_D3D_TEXTURE,
};
public:
- // Creates a new frame with given parameters. Buffers for the frame are
- // allocated but not initialized.
+ // Creates a new frame in system memory with given parameters. Buffers for
+ // the frame are allocated but not initialized.
static void CreateFrame(Format format,
size_t width,
size_t height,
diff --git a/media/filters/video_renderer_base.h b/media/filters/video_renderer_base.h
index f27955f7..6df61b9 100644
--- a/media/filters/video_renderer_base.h
+++ b/media/filters/video_renderer_base.h
@@ -102,11 +102,6 @@ class VideoRendererBase : public VideoRenderer,
VideoFrame::Format surface_format() { return surface_format_; }
VideoFrame::SurfaceType surface_type() { return surface_type_; }
- // TODO(jiesun): move this to gles_video_render.cc.
- inline bool uses_egl_image() {
- return surface_type_ == media::VideoFrame::TYPE_EGL_IMAGE;
- }
-
void ReadInput(scoped_refptr<VideoFrame> frame);
private:
diff --git a/media/tools/player_x11/gles_video_renderer.cc b/media/tools/player_x11/gles_video_renderer.cc
index 724efa4..d3b8051 100644
--- a/media/tools/player_x11/gles_video_renderer.cc
+++ b/media/tools/player_x11/gles_video_renderer.cc
@@ -181,8 +181,7 @@ void GlesVideoRenderer::Paint() {
}
if (uses_egl_image()) {
- if (media::VideoFrame::TYPE_EGL_IMAGE == video_frame->type()) {
-
+ if (media::VideoFrame::TYPE_GL_TEXTURE == video_frame->type()) {
GLuint texture = FindTexture(video_frame);
if (texture) {
glActiveTexture(GL_TEXTURE0);
@@ -438,7 +437,7 @@ void GlesVideoRenderer::CreateTextureAndProgramEgl() {
memset(data, 0, sizeof(data));
memset(strides, 0, sizeof(strides));
media::VideoFrame:: CreateFrameExternal(
- media::VideoFrame::TYPE_EGL_IMAGE,
+ media::VideoFrame::TYPE_GL_TEXTURE,
media::VideoFrame::RGB565,
width(), height(), 3,
data, strides,
diff --git a/media/video/omx_video_decode_engine.cc b/media/video/omx_video_decode_engine.cc
index 3aa8101..b953cfa 100644
--- a/media/video/omx_video_decode_engine.cc
+++ b/media/video/omx_video_decode_engine.cc
@@ -110,7 +110,7 @@ void OmxVideoDecodeEngine::Initialize(
info.success_ = true;
info.provides_buffers_ = !uses_egl_image_;
info.stream_info_.surface_type_ =
- uses_egl_image_ ? VideoFrame::TYPE_EGL_IMAGE
+ uses_egl_image_ ? VideoFrame::TYPE_GL_TEXTURE
: VideoFrame::TYPE_SYSTEM_MEMORY;
info.stream_info_.surface_format_ = GetSurfaceFormat();
info.stream_info_.surface_width_ = config.width_;
@@ -919,7 +919,7 @@ scoped_refptr<VideoFrame> OmxVideoDecodeEngine::CreateOmxBufferVideoFrame(
strides[1] = strides[2] = width_ >> 1;
VideoFrame::CreateFrameExternal(
- VideoFrame::TYPE_OMXBUFFERHEAD,
+ VideoFrame::TYPE_SYSTEM_MEMORY,
VideoFrame::YV12,
width_, height_, 3,
data, strides,
@@ -1121,8 +1121,7 @@ void OmxVideoDecodeEngine::ChangePort(OMX_COMMANDTYPE cmd, int port_index) {
OMX_BUFFERHEADERTYPE* OmxVideoDecodeEngine::FindOmxBuffer(
scoped_refptr<VideoFrame> video_frame) {
for (size_t i = 0; i < output_frames_.size(); ++i) {
- scoped_refptr<VideoFrame> frame = output_frames_[i].first;
- if (video_frame->private_buffer() == frame->private_buffer())
+ if (video_frame == output_frames_[i].first)
return output_frames_[i].second;
}
return NULL;
diff --git a/webkit/glue/webvideoframe_impl.cc b/webkit/glue/webvideoframe_impl.cc
index 0cb9de7..e1195a7 100644
--- a/webkit/glue/webvideoframe_impl.cc
+++ b/webkit/glue/webvideoframe_impl.cc
@@ -42,10 +42,8 @@ COMPILE_ASSERT_MATCHING_ENUM(FormatEmpty, EMPTY);
COMPILE_ASSERT_MATCHING_ENUM(FormatASCII, ASCII);
COMPILE_ASSERT_MATCHING_ENUM(SurfaceTypeSystemMemory, TYPE_SYSTEM_MEMORY);
-COMPILE_ASSERT_MATCHING_ENUM(SurfaceTypeOMXBufferHead, TYPE_OMXBUFFERHEAD);
-COMPILE_ASSERT_MATCHING_ENUM(SurfaceTypeEGLImage, TYPE_EGL_IMAGE);
-COMPILE_ASSERT_MATCHING_ENUM(SurfaceTypeMFBuffer, TYPE_MFBUFFER);
-COMPILE_ASSERT_MATCHING_ENUM(SurfaceTypeDirect3DSurface, TYPE_DIRECT3DSURFACE);
+// TODO(hclam): Add checks for newly added surface types like GL texture and
+// D3D texture.
WebVideoFrame::SurfaceType WebVideoFrameImpl::surfaceType() const {
if (video_frame_.get())