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

Side by Side Diff: media/base/video_decoder_config.cc

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base/video_decoder_config.h" 5 #include "media/base/video_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
11 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec, 11 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec,
12 int width, 12 const gfx::Size& coded_size,
13 int height, 13 const gfx::Rect& visible_rect,
14 int surface_width, 14 const gfx::Size& natural_size,
15 int surface_height,
16 int frame_rate_numerator, 15 int frame_rate_numerator,
17 int frame_rate_denominator, 16 int frame_rate_denominator,
18 const uint8* extra_data, 17 const uint8* extra_data,
19 size_t extra_data_size) 18 size_t extra_data_size)
20 : codec_(codec), 19 : codec_(codec),
21 width_(width), 20 coded_size_(coded_size),
22 height_(height), 21 visible_rect_(visible_rect),
23 surface_width_(surface_width), 22 natural_size_(natural_size),
24 surface_height_(surface_height),
25 frame_rate_numerator_(frame_rate_numerator), 23 frame_rate_numerator_(frame_rate_numerator),
26 frame_rate_denominator_(frame_rate_denominator), 24 frame_rate_denominator_(frame_rate_denominator),
27 extra_data_size_(extra_data_size) { 25 extra_data_size_(extra_data_size) {
28 CHECK(extra_data_size_ == 0 || extra_data); 26 CHECK(extra_data_size_ == 0 || extra_data);
29 if (extra_data_size_ > 0) { 27 if (extra_data_size_ > 0) {
30 extra_data_.reset(new uint8[extra_data_size_]); 28 extra_data_.reset(new uint8[extra_data_size_]);
31 memcpy(extra_data_.get(), extra_data, extra_data_size_); 29 memcpy(extra_data_.get(), extra_data, extra_data_size_);
32 } 30 }
33 } 31 }
34 32
35 VideoDecoderConfig::~VideoDecoderConfig() {} 33 VideoDecoderConfig::~VideoDecoderConfig() {}
36 34
37 VideoCodec VideoDecoderConfig::codec() const { 35 VideoCodec VideoDecoderConfig::codec() const {
38 return codec_; 36 return codec_;
39 } 37 }
40 38
41 int VideoDecoderConfig::width() const { 39 gfx::Size VideoDecoderConfig::coded_size() const {
42 return width_; 40 return coded_size_;
43 } 41 }
44 42
45 int VideoDecoderConfig::height() const { 43 gfx::Rect VideoDecoderConfig::visible_rect() const {
46 return height_; 44 return visible_rect_;
47 } 45 }
48 46
49 int VideoDecoderConfig::surface_width() const { 47 gfx::Size VideoDecoderConfig::natural_size() const {
50 return surface_width_; 48 return natural_size_;
51 }
52
53 int VideoDecoderConfig::surface_height() const {
54 return surface_height_;
55 } 49 }
56 50
57 int VideoDecoderConfig::frame_rate_numerator() const { 51 int VideoDecoderConfig::frame_rate_numerator() const {
58 return frame_rate_numerator_; 52 return frame_rate_numerator_;
59 } 53 }
60 54
61 int VideoDecoderConfig::frame_rate_denominator() const { 55 int VideoDecoderConfig::frame_rate_denominator() const {
62 return frame_rate_denominator_; 56 return frame_rate_denominator_;
63 } 57 }
64 58
65 uint8* VideoDecoderConfig::extra_data() const { 59 uint8* VideoDecoderConfig::extra_data() const {
66 return extra_data_.get(); 60 return extra_data_.get();
67 } 61 }
68 62
69 size_t VideoDecoderConfig::extra_data_size() const { 63 size_t VideoDecoderConfig::extra_data_size() const {
70 return extra_data_size_; 64 return extra_data_size_;
71 } 65 }
72 66
73 } // namespace media 67 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/ffmpeg/ffmpeg_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698