OLD | NEW |
---|---|
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/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 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
132 } | 132 } |
133 | 133 |
134 VideoCodecProfile VideoDecoderConfig::profile() const { | 134 VideoCodecProfile VideoDecoderConfig::profile() const { |
135 return profile_; | 135 return profile_; |
136 } | 136 } |
137 | 137 |
138 VideoFrame::Format VideoDecoderConfig::format() const { | 138 VideoFrame::Format VideoDecoderConfig::format() const { |
139 return format_; | 139 return format_; |
140 } | 140 } |
141 | 141 |
142 std::string VideoDecoderConfig::FormatName() const { | |
scherkus (not reviewing)
2013/08/02 21:53:48
fix indenting
Ty Overby
2013/08/02 23:04:27
Done.
| |
143 std::string format_name; | |
scherkus (not reviewing)
2013/08/02 21:53:48
you don't need this -- instead just return string
Ty Overby
2013/08/02 23:04:27
Done.
| |
144 switch(format()){ | |
scherkus (not reviewing)
2013/08/02 21:53:48
since this is a VideoFrame::Format, it should be a
Ty Overby
2013/08/02 23:04:27
Done.
| |
145 case VideoFrame::Format::INVALID: | |
146 format_name = "INVALID"; | |
147 break; | |
148 case VideoFrame::Format::RGB32: | |
149 format_name = "RGB32"; | |
150 break; | |
151 case VideoFrame::Format::YV12: | |
152 format_name = "YV12"; | |
153 break; | |
154 case VideoFrame::Format::YV16: | |
155 format_name = "YV16"; | |
156 break; | |
157 case VideoFrame::Format::EMPTY: | |
158 format_name = "EMPTY"; | |
159 break; | |
160 case VideoFrame::Format::I420: | |
161 format_name = "I420"; | |
162 break; | |
163 case VideoFrame::Format::YV12A: | |
164 format_name = "YV12A"; | |
165 break; | |
166 default: | |
scherkus (not reviewing)
2013/08/02 21:53:48
we don't like default cases -- it's better to leav
Ty Overby
2013/08/02 23:04:27
Done.
| |
167 format_name = "INVALID"; | |
168 break; | |
169 } | |
170 return format_name; | |
171 } | |
172 | |
142 gfx::Size VideoDecoderConfig::coded_size() const { | 173 gfx::Size VideoDecoderConfig::coded_size() const { |
143 return coded_size_; | 174 return coded_size_; |
144 } | 175 } |
145 | 176 |
146 gfx::Rect VideoDecoderConfig::visible_rect() const { | 177 gfx::Rect VideoDecoderConfig::visible_rect() const { |
147 return visible_rect_; | 178 return visible_rect_; |
148 } | 179 } |
149 | 180 |
150 gfx::Size VideoDecoderConfig::natural_size() const { | 181 gfx::Size VideoDecoderConfig::natural_size() const { |
151 return natural_size_; | 182 return natural_size_; |
152 } | 183 } |
153 | 184 |
154 const uint8* VideoDecoderConfig::extra_data() const { | 185 const uint8* VideoDecoderConfig::extra_data() const { |
155 if (extra_data_.empty()) | 186 if (extra_data_.empty()) |
156 return NULL; | 187 return NULL; |
157 return &extra_data_[0]; | 188 return &extra_data_[0]; |
158 } | 189 } |
159 | 190 |
160 size_t VideoDecoderConfig::extra_data_size() const { | 191 size_t VideoDecoderConfig::extra_data_size() const { |
161 return extra_data_.size(); | 192 return extra_data_.size(); |
162 } | 193 } |
163 | 194 |
164 bool VideoDecoderConfig::is_encrypted() const { | 195 bool VideoDecoderConfig::is_encrypted() const { |
165 return is_encrypted_; | 196 return is_encrypted_; |
166 } | 197 } |
167 | 198 |
168 } // namespace media | 199 } // namespace media |
OLD | NEW |