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

Side by Side Diff: media/ffmpeg/ffmpeg_common.cc

Issue 2506533002: Use width,height for coded_{width,height} in AVStreamToVideoDecoderConfig (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | media/filters/ffmpeg_demuxer.cc » ('j') | media/filters/ffmpeg_demuxer.cc » ('J')
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/ffmpeg/ffmpeg_common.h" 5 #include "media/ffmpeg/ffmpeg_common.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE)); 434 av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE));
435 memcpy(codec_context->extradata, &config.extra_data()[0], 435 memcpy(codec_context->extradata, &config.extra_data()[0],
436 config.extra_data().size()); 436 config.extra_data().size());
437 memset(codec_context->extradata + config.extra_data().size(), '\0', 437 memset(codec_context->extradata + config.extra_data().size(), '\0',
438 FF_INPUT_BUFFER_PADDING_SIZE); 438 FF_INPUT_BUFFER_PADDING_SIZE);
439 } 439 }
440 } 440 }
441 441
442 bool AVStreamToVideoDecoderConfig(const AVStream* stream, 442 bool AVStreamToVideoDecoderConfig(const AVStream* stream,
443 VideoDecoderConfig* config) { 443 VideoDecoderConfig* config) {
444 gfx::Size coded_size(stream->codec->coded_width, stream->codec->coded_height); 444 // Anticipating AVStream.codec.coded_{width,height} will be inaccessible in
DaleCurtis 2016/11/15 19:18:22 Mark VideoDecoderConfig coded_{width,height} as de
wolenetz 2016/11/15 20:03:01 Done.
445 // ffmpeg soon, just use the width and height, padded below, as hints of the
446 // coded size.
447 gfx::Size coded_size(stream->codec->width, stream->codec->height);
445 448
446 // TODO(vrk): This assumes decoded frame data starts at (0, 0), which is true 449 // TODO(vrk): This assumes decoded frame data starts at (0, 0), which is true
447 // for now, but may not always be true forever. Fix this in the future. 450 // for now, but may not always be true forever. Fix this in the future.
448 gfx::Rect visible_rect(stream->codec->width, stream->codec->height); 451 gfx::Rect visible_rect(stream->codec->width, stream->codec->height);
449 452
450 AVRational aspect_ratio = { 1, 1 }; 453 AVRational aspect_ratio = { 1, 1 };
451 if (stream->sample_aspect_ratio.num) 454 if (stream->sample_aspect_ratio.num)
452 aspect_ratio = stream->sample_aspect_ratio; 455 aspect_ratio = stream->sample_aspect_ratio;
453 else if (stream->codec->sample_aspect_ratio.num) 456 else if (stream->codec->sample_aspect_ratio.num)
454 aspect_ratio = stream->codec->sample_aspect_ratio; 457 aspect_ratio = stream->codec->sample_aspect_ratio;
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 TEST_COLORSPACE(RESERVED); 831 TEST_COLORSPACE(RESERVED);
829 TEST_COLORSPACE(FCC); 832 TEST_COLORSPACE(FCC);
830 TEST_COLORSPACE(BT470BG); 833 TEST_COLORSPACE(BT470BG);
831 TEST_COLORSPACE(SMPTE170M); 834 TEST_COLORSPACE(SMPTE170M);
832 TEST_COLORSPACE(SMPTE240M); 835 TEST_COLORSPACE(SMPTE240M);
833 TEST_COLORSPACE(YCOCG); 836 TEST_COLORSPACE(YCOCG);
834 TEST_COLORSPACE(BT2020_NCL); 837 TEST_COLORSPACE(BT2020_NCL);
835 TEST_COLORSPACE(BT2020_CL); 838 TEST_COLORSPACE(BT2020_CL);
836 839
837 } // namespace media 840 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/ffmpeg_demuxer.cc » ('j') | media/filters/ffmpeg_demuxer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698