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

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

Issue 8052002: Fix support for yuv_422 pixel format. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed existing unit tests. Created 9 years, 2 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
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 VideoFrame::Format video_format,
12 const gfx::Size& coded_size, 13 const gfx::Size& coded_size,
13 const gfx::Rect& visible_rect, 14 const gfx::Rect& visible_rect,
14 const gfx::Size& natural_size, 15 const gfx::Size& natural_size,
15 int frame_rate_numerator, 16 int frame_rate_numerator,
16 int frame_rate_denominator, 17 int frame_rate_denominator,
17 const uint8* extra_data, 18 const uint8* extra_data,
18 size_t extra_data_size) 19 size_t extra_data_size)
19 : codec_(codec), 20 : codec_(codec),
21 video_format_(video_format),
20 coded_size_(coded_size), 22 coded_size_(coded_size),
21 visible_rect_(visible_rect), 23 visible_rect_(visible_rect),
22 natural_size_(natural_size), 24 natural_size_(natural_size),
23 frame_rate_numerator_(frame_rate_numerator), 25 frame_rate_numerator_(frame_rate_numerator),
24 frame_rate_denominator_(frame_rate_denominator), 26 frame_rate_denominator_(frame_rate_denominator),
25 extra_data_size_(extra_data_size) { 27 extra_data_size_(extra_data_size) {
26 CHECK(extra_data_size_ == 0 || extra_data); 28 CHECK(extra_data_size_ == 0 || extra_data);
27 if (extra_data_size_ > 0) { 29 if (extra_data_size_ > 0) {
28 extra_data_.reset(new uint8[extra_data_size_]); 30 extra_data_.reset(new uint8[extra_data_size_]);
29 memcpy(extra_data_.get(), extra_data, extra_data_size_); 31 memcpy(extra_data_.get(), extra_data, extra_data_size_);
30 } 32 }
31 } 33 }
32 34
33 VideoDecoderConfig::~VideoDecoderConfig() {} 35 VideoDecoderConfig::~VideoDecoderConfig() {}
34 36
35 VideoCodec VideoDecoderConfig::codec() const { 37 VideoCodec VideoDecoderConfig::codec() const {
36 return codec_; 38 return codec_;
37 } 39 }
38 40
41 VideoFrame::Format VideoDecoderConfig::video_format() const {
42 return video_format_;
43 }
44
39 gfx::Size VideoDecoderConfig::coded_size() const { 45 gfx::Size VideoDecoderConfig::coded_size() const {
40 return coded_size_; 46 return coded_size_;
41 } 47 }
42 48
43 gfx::Rect VideoDecoderConfig::visible_rect() const { 49 gfx::Rect VideoDecoderConfig::visible_rect() const {
44 return visible_rect_; 50 return visible_rect_;
45 } 51 }
46 52
47 gfx::Size VideoDecoderConfig::natural_size() const { 53 gfx::Size VideoDecoderConfig::natural_size() const {
48 return natural_size_; 54 return natural_size_;
49 } 55 }
50 56
51 int VideoDecoderConfig::frame_rate_numerator() const { 57 int VideoDecoderConfig::frame_rate_numerator() const {
52 return frame_rate_numerator_; 58 return frame_rate_numerator_;
53 } 59 }
54 60
55 int VideoDecoderConfig::frame_rate_denominator() const { 61 int VideoDecoderConfig::frame_rate_denominator() const {
56 return frame_rate_denominator_; 62 return frame_rate_denominator_;
57 } 63 }
58 64
59 uint8* VideoDecoderConfig::extra_data() const { 65 uint8* VideoDecoderConfig::extra_data() const {
60 return extra_data_.get(); 66 return extra_data_.get();
61 } 67 }
62 68
63 size_t VideoDecoderConfig::extra_data_size() const { 69 size_t VideoDecoderConfig::extra_data_size() const {
64 return extra_data_size_; 70 return extra_data_size_;
65 } 71 }
66 72
67 } // namespace media 73 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698