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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 NOTREACHED(); | 94 NOTREACHED(); |
95 return ""; | 95 return ""; |
96 } | 96 } |
97 | 97 |
98 bool ParseNewStyleVp9CodecID(const std::string& codec_id, | 98 bool ParseNewStyleVp9CodecID(const std::string& codec_id, |
99 VideoCodecProfile* profile, | 99 VideoCodecProfile* profile, |
100 uint8_t* level_idc, | 100 uint8_t* level_idc, |
101 VideoColorSpace* color_space) { | 101 VideoColorSpace* color_space) { |
102 // Initialize optional fields to their defaults. | 102 // Initialize optional fields to their defaults. |
103 *color_space = VideoColorSpace::BT709(); | 103 *color_space = VideoColorSpace::REC709(); |
104 | 104 |
105 std::vector<std::string> fields = base::SplitString( | 105 std::vector<std::string> fields = base::SplitString( |
106 codec_id, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); | 106 codec_id, ".", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); |
107 | 107 |
108 // First four fields are mandatory. No more than 9 fields are expected. | 108 // First four fields are mandatory. No more than 9 fields are expected. |
109 if (fields.size() < 4 || fields.size() > 9) { | 109 if (fields.size() < 4 || fields.size() > 9) { |
110 DVLOG(3) << __func__ << " Invalid number of fields (" << fields.size() | 110 DVLOG(3) << __func__ << " Invalid number of fields (" << fields.size() |
111 << ")"; | 111 << ")"; |
112 return false; | 112 return false; |
113 } | 113 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 return kCodecHEVC; | 624 return kCodecHEVC; |
625 #endif | 625 #endif |
626 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) | 626 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
627 if (ParseDolbyVisionCodecId(codec_id, &profile, &level)) | 627 if (ParseDolbyVisionCodecId(codec_id, &profile, &level)) |
628 return kCodecDolbyVision; | 628 return kCodecDolbyVision; |
629 #endif | 629 #endif |
630 return kUnknownVideoCodec; | 630 return kUnknownVideoCodec; |
631 } | 631 } |
632 | 632 |
633 } // namespace media | 633 } // namespace media |
OLD | NEW |