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

Side by Side Diff: media/filters/ffmpeg_video_decoder.cc

Issue 289373011: Support for YUV 4:4:4 subsampling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try that again. Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/ffmpeg_video_decoder.h" 5 #include "media/filters/ffmpeg_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 int flags) { 75 int flags) {
76 // Don't use |codec_context_| here! With threaded decoding, 76 // Don't use |codec_context_| here! With threaded decoding,
77 // it will contain unsynchronized width/height/pix_fmt values, 77 // it will contain unsynchronized width/height/pix_fmt values,
78 // whereas |codec_context| contains the current threads's 78 // whereas |codec_context| contains the current threads's
79 // updated width/height/pix_fmt, which can change for adaptive 79 // updated width/height/pix_fmt, which can change for adaptive
80 // content. 80 // content.
81 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context->pix_fmt); 81 VideoFrame::Format format = PixelFormatToVideoFormat(codec_context->pix_fmt);
82 if (format == VideoFrame::UNKNOWN) 82 if (format == VideoFrame::UNKNOWN)
83 return AVERROR(EINVAL); 83 return AVERROR(EINVAL);
84 DCHECK(format == VideoFrame::YV12 || format == VideoFrame::YV16 || 84 DCHECK(format == VideoFrame::YV12 || format == VideoFrame::YV16 ||
85 format == VideoFrame::YV12J); 85 format == VideoFrame::YV12J || format == VideoFrame::YV24);
86 86
87 gfx::Size size(codec_context->width, codec_context->height); 87 gfx::Size size(codec_context->width, codec_context->height);
88 const int ret = av_image_check_size(size.width(), size.height(), 0, NULL); 88 const int ret = av_image_check_size(size.width(), size.height(), 0, NULL);
89 if (ret < 0) 89 if (ret < 0)
90 return ret; 90 return ret;
91 91
92 gfx::Size natural_size; 92 gfx::Size natural_size;
93 if (codec_context->sample_aspect_ratio.num > 0) { 93 if (codec_context->sample_aspect_ratio.num > 0) {
94 natural_size = GetNaturalSize(size, 94 natural_size = GetNaturalSize(size,
95 codec_context->sample_aspect_ratio.num, 95 codec_context->sample_aspect_ratio.num,
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { 364 if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
365 ReleaseFFmpegResources(); 365 ReleaseFFmpegResources();
366 return false; 366 return false;
367 } 367 }
368 368
369 av_frame_.reset(av_frame_alloc()); 369 av_frame_.reset(av_frame_alloc());
370 return true; 370 return true;
371 } 371 }
372 372
373 } // namespace media 373 } // namespace media
OLDNEW
« no previous file with comments | « media/ffmpeg/ffmpeg_common.cc ('k') | media/filters/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698