OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_codecs.h" | 5 #include "media/base/video_codecs.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ? gfx::ColorSpace::RangeID::FULL | 230 ? gfx::ColorSpace::RangeID::FULL |
231 : gfx::ColorSpace::RangeID::LIMITED; | 231 : gfx::ColorSpace::RangeID::LIMITED; |
232 | 232 |
233 return true; | 233 return true; |
234 } | 234 } |
235 | 235 |
236 bool ParseLegacyVp9CodecID(const std::string& codec_id, | 236 bool ParseLegacyVp9CodecID(const std::string& codec_id, |
237 VideoCodecProfile* profile, | 237 VideoCodecProfile* profile, |
238 uint8_t* level_idc) { | 238 uint8_t* level_idc) { |
239 if (codec_id == "vp9" || codec_id == "vp9.0") { | 239 if (codec_id == "vp9" || codec_id == "vp9.0") { |
240 // Profile is not included in the codec string. Assuming profile 0 to be | 240 // Profile is not included in the codec string. Consumers of parsed codec |
241 // backward compatible. | 241 // should handle by rejecting ambiguous string or resolving to a default |
242 *profile = VP9PROFILE_PROFILE0; | 242 // profile. |
| 243 *profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
243 // Use 0 to indicate unknown level. | 244 // Use 0 to indicate unknown level. |
244 *level_idc = 0; | 245 *level_idc = 0; |
245 return true; | 246 return true; |
246 } | 247 } |
247 return false; | 248 return false; |
248 } | 249 } |
249 | 250 |
250 bool ParseAVCCodecId(const std::string& codec_id, | 251 bool ParseAVCCodecId(const std::string& codec_id, |
251 VideoCodecProfile* profile, | 252 VideoCodecProfile* profile, |
252 uint8_t* level_idc) { | 253 uint8_t* level_idc) { |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 return kCodecHEVC; | 625 return kCodecHEVC; |
625 #endif | 626 #endif |
626 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) | 627 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
627 if (ParseDolbyVisionCodecId(codec_id, &profile, &level)) | 628 if (ParseDolbyVisionCodecId(codec_id, &profile, &level)) |
628 return kCodecDolbyVision; | 629 return kCodecDolbyVision; |
629 #endif | 630 #endif |
630 return kUnknownVideoCodec; | 631 return kUnknownVideoCodec; |
631 } | 632 } |
632 | 633 |
633 } // namespace media | 634 } // namespace media |
OLD | NEW |