diff options
author | vrk@chromium.org <vrk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 06:11:11 +0000 |
---|---|---|
committer | vrk@chromium.org <vrk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 06:11:11 +0000 |
commit | 8dd02cb229fc0736e9b354ac1cdfa27c5e77d6fb (patch) | |
tree | 9a6d2704abb023429859df32847f1f8ecbc16ef0 | |
parent | d8ef715b6145fb3bd9cc70fd051c71b84bb7715b (diff) | |
download | chromium_src-8dd02cb229fc0736e9b354ac1cdfa27c5e77d6fb.zip chromium_src-8dd02cb229fc0736e9b354ac1cdfa27c5e77d6fb.tar.gz chromium_src-8dd02cb229fc0736e9b354ac1cdfa27c5e77d6fb.tar.bz2 |
Reland r97895: Use surface_width/height instead of coded_width/coded_height for VideoFrame size
The media_unittests needed to be adjusted to reflect the change made in
the dimensions used to create VideoFrames in FFmpegVideoDecodeEngine.
BUG=91506
TEST=media_unittests
Review URL: http://codereview.chromium.org/7714016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98002 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/ffmpeg/ffmpeg_common.cc | 4 | ||||
-rw-r--r-- | media/video/ffmpeg_video_decode_engine.cc | 4 | ||||
-rw-r--r-- | media/video/ffmpeg_video_decode_engine_unittest.cc | 12 |
3 files changed, 10 insertions, 10 deletions
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<VideoFrame> 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); diff --git a/media/video/ffmpeg_video_decode_engine_unittest.cc b/media/video/ffmpeg_video_decode_engine_unittest.cc index 611bbfa..0368e63 100644 --- a/media/video/ffmpeg_video_decode_engine_unittest.cc +++ b/media/video/ffmpeg_video_decode_engine_unittest.cc @@ -25,8 +25,8 @@ namespace media { static const size_t kWidth = 320; static const size_t kHeight = 240; -static const int kSurfaceWidth = 522; -static const int kSurfaceHeight = 288; +static const size_t kSurfaceWidth = 522; +static const size_t kSurfaceHeight = 288; static const AVRational kFrameRate = { 100, 1 }; ACTION_P2(DemuxComplete, engine, buffer) { @@ -105,10 +105,10 @@ class FFmpegVideoDecodeEngineTest CallProduceVideoFrame(); CallProduceVideoFrame(); - EXPECT_EQ(kWidth, video_frame_a->width()); - EXPECT_EQ(kHeight, video_frame_a->height()); - EXPECT_EQ(kWidth, video_frame_b->width()); - EXPECT_EQ(kHeight, video_frame_b->height()); + EXPECT_EQ(kSurfaceWidth, video_frame_a->width()); + EXPECT_EQ(kSurfaceHeight, video_frame_a->height()); + EXPECT_EQ(kSurfaceWidth, video_frame_b->width()); + EXPECT_EQ(kSurfaceHeight, video_frame_b->height()); } // VideoDecodeEngine::EventHandler implementation. |