From f535217b5fc3d569ac2f18fd2a5177a85e934239 Mon Sep 17 00:00:00 2001 From: "michaeln@google.com" Date: Thu, 2 Jun 2011 03:15:28 +0000 Subject: Revert 87578 - Respect pixel aspect ratio of video if it contains one. BUG=18941 TEST=Check correct AR on http://people.xiph.org/~giles/2009/celt-aspect.html Alternately, fix 59412 and run media/video-display-aspect-ratio layout test Review URL: http://codereview.chromium.org/7086002 TBR=scottfr@chromium.org Review URL: http://codereview.chromium.org/7109002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87579 0039d316-1c4b-4281-b951-d872f2087c98 --- media/ffmpeg/ffmpeg_common.cc | 21 --------------------- media/ffmpeg/ffmpeg_common.h | 6 ------ 2 files changed, 27 deletions(-) (limited to 'media/ffmpeg') diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc index 2ccd4eb..dedc40c 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc @@ -185,25 +185,4 @@ bool GetStreamByteCountOverRange(AVStream* stream, return true; } -int GetSurfaceHeight(AVStream* stream) { - return stream->codec->coded_height; -} - -int GetSurfaceWidth(AVStream* stream) { - double aspect_ratio; - - if (stream->sample_aspect_ratio.num) - aspect_ratio = av_q2d(stream->sample_aspect_ratio); - else if (stream->codec->sample_aspect_ratio.num) - aspect_ratio = av_q2d(stream->codec->sample_aspect_ratio); - else - aspect_ratio = 1.0; - - int width = floor(stream->codec->coded_width * aspect_ratio + 0.5); - - // An even width makes things easier for YV12 and appears to be the behavior - // expected by WebKit layout tests. - return width & ~1; -} - } // namespace media diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h index 07daae1..3d39d52 100644 --- a/media/ffmpeg/ffmpeg_common.h +++ b/media/ffmpeg/ffmpeg_common.h @@ -103,12 +103,6 @@ bool GetStreamByteCountOverRange(AVStream* stream, int64* bytes, base::TimeDelta* range_start, base::TimeDelta* range_end); - -// Calculates the width and height of the video surface using the video's -// encoded dimensions and sample_aspect_ratio. -int GetSurfaceHeight(AVStream* stream); -int GetSurfaceWidth(AVStream* stream); - } // namespace media #endif // MEDIA_FFMPEG_FFMPEG_COMMON_H_ -- cgit v1.1