Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 10824141: Remove VideoDecoder::natural_size() & added VideoFrame::natural_size(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index c2d34c28d0b77d57d31f5a8121c75ca587c6ef7e..159ace648e13c27ef93a49b10a574dce143f3008 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -81,8 +81,15 @@ int FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext* codec_context,
if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
return ret;
+ gfx::Size natural_size = natural_size_;
+ if (codec_context->sample_aspect_ratio.num > 0) {
+ natural_size = GetNaturalSize(gfx::Size(width, height),
+ codec_context->sample_aspect_ratio.num,
+ codec_context->sample_aspect_ratio.den);
+ }
scoped_refptr<VideoFrame> video_frame =
- VideoFrame::CreateFrame(format, width, height, kNoTimestamp());
+ VideoFrame::CreateFrame(format, width, height, natural_size,
+ kNoTimestamp());
for (int i = 0; i < 3; i++) {
frame->base[i] = video_frame->data(i);
@@ -243,10 +250,6 @@ void FFmpegVideoDecoder::DoStop() {
base::ResetAndReturn(&stop_cb_).Run();
}
-const gfx::Size& FFmpegVideoDecoder::natural_size() {
- return natural_size_;
-}
-
void FFmpegVideoDecoder::set_decryptor(Decryptor* decryptor) {
DCHECK_EQ(state_, kUninitialized);
decryptor_ = decryptor;

Powered by Google App Engine
This is Rietveld 408576698