From efa9aa8e051cd37223cbfb641462a7743aacacbb Mon Sep 17 00:00:00 2001 From: "vrk@google.com" Date: Tue, 23 Aug 2011 18:30:54 +0000 Subject: Use surface_width/height instead of coded_width/coded_height for VideoFrame size It appears that "surface" height/width refers to the visible height/width of the frame. FFmpegVideoDecodeEngine should use these dimensions to create VideoFrames rather than the coded width/height. BUG=91506 TEST=NONE Review URL: http://codereview.chromium.org/7624055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97892 0039d316-1c4b-4281-b951-d872f2087c98 --- media/ffmpeg/ffmpeg_common.cc | 4 ++-- media/video/ffmpeg_video_decode_engine.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'media') diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc index d03715e..65ab9bb 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc @@ -188,7 +188,7 @@ bool GetStreamByteCountOverRange(AVStream* stream, } int GetSurfaceHeight(AVStream* stream) { - return stream->codec->coded_height; + return stream->codec->height; } int GetSurfaceWidth(AVStream* stream) { @@ -201,7 +201,7 @@ int GetSurfaceWidth(AVStream* stream) { else aspect_ratio = 1.0; - int width = floor(stream->codec->coded_width * aspect_ratio + 0.5); + int width = floor(stream->codec->width * aspect_ratio + 0.5); // An even width makes things easier for YV12 and appears to be the behavior // expected by WebKit layout tests. diff --git a/media/video/ffmpeg_video_decode_engine.cc b/media/video/ffmpeg_video_decode_engine.cc index 0958516..ced1b60 100644 --- a/media/video/ffmpeg_video_decode_engine.cc +++ b/media/video/ffmpeg_video_decode_engine.cc @@ -114,8 +114,8 @@ void FFmpegVideoDecodeEngine::Initialize( for (size_t i = 0; i < Limits::kMaxVideoFrames; ++i) { scoped_refptr video_frame = VideoFrame::CreateFrame(VideoFrame::YV12, - config.width(), - config.height(), + config.surface_width(), + config.surface_height(), kNoTimestamp, kNoTimestamp); frame_queue_available_.push_back(video_frame); -- cgit v1.1