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 #include "media/base/video_frame.h" | 9 #include "media/base/video_frame.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
| 13 VideoCodec VideoCodecProfileToVideoCodec(VideoCodecProfile profile) { |
| 14 switch (profile) { |
| 15 case VIDEO_CODEC_PROFILE_UNKNOWN: |
| 16 return kUnknownVideoCodec; |
| 17 case H264PROFILE_BASELINE: |
| 18 case H264PROFILE_MAIN: |
| 19 case H264PROFILE_EXTENDED: |
| 20 case H264PROFILE_HIGH: |
| 21 case H264PROFILE_HIGH10PROFILE: |
| 22 case H264PROFILE_HIGH422PROFILE: |
| 23 case H264PROFILE_HIGH444PREDICTIVEPROFILE: |
| 24 case H264PROFILE_SCALABLEBASELINE: |
| 25 case H264PROFILE_SCALABLEHIGH: |
| 26 case H264PROFILE_STEREOHIGH: |
| 27 case H264PROFILE_MULTIVIEWHIGH: |
| 28 return kCodecH264; |
| 29 case VP8PROFILE_ANY: |
| 30 return kCodecVP8; |
| 31 case VP9PROFILE_ANY: |
| 32 return kCodecVP9; |
| 33 } |
| 34 NOTREACHED(); |
| 35 return kUnknownVideoCodec; |
| 36 } |
| 37 |
| 38 |
13 VideoDecoderConfig::VideoDecoderConfig() | 39 VideoDecoderConfig::VideoDecoderConfig() |
14 : codec_(kUnknownVideoCodec), | 40 : codec_(kUnknownVideoCodec), |
15 profile_(VIDEO_CODEC_PROFILE_UNKNOWN), | 41 profile_(VIDEO_CODEC_PROFILE_UNKNOWN), |
16 format_(PIXEL_FORMAT_UNKNOWN), | 42 format_(PIXEL_FORMAT_UNKNOWN), |
17 is_encrypted_(false) { | 43 is_encrypted_(false) { |
18 } | 44 } |
19 | 45 |
20 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec, | 46 VideoDecoderConfig::VideoDecoderConfig(VideoCodec codec, |
21 VideoCodecProfile profile, | 47 VideoCodecProfile profile, |
22 VideoPixelFormat format, | 48 VideoPixelFormat format, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 return ""; | 185 return ""; |
160 } | 186 } |
161 | 187 |
162 const uint8* VideoDecoderConfig::extra_data() const { | 188 const uint8* VideoDecoderConfig::extra_data() const { |
163 if (extra_data_.empty()) | 189 if (extra_data_.empty()) |
164 return NULL; | 190 return NULL; |
165 return &extra_data_[0]; | 191 return &extra_data_[0]; |
166 } | 192 } |
167 | 193 |
168 } // namespace media | 194 } // namespace media |
OLD | NEW |