OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef MEDIA_BASE_MIME_UTIL_INTERNAL_H_ | 5 #ifndef MEDIA_BASE_MIME_UTIL_INTERNAL_H_ |
6 #define MEDIA_BASE_MIME_UTIL_INTERNAL_H_ | 6 #define MEDIA_BASE_MIME_UTIL_INTERNAL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 // Returns true if this method was able to map |codec_id| with | 106 // Returns true if this method was able to map |codec_id| with |
107 // |mime_type_lower_case| to a specific Codec enum value. |codec| is only | 107 // |mime_type_lower_case| to a specific Codec enum value. |codec| is only |
108 // valid if true is returned. | 108 // valid if true is returned. |
109 // |ambiguous_codec_string| will be set to true when the codec string matches | 109 // |ambiguous_codec_string| will be set to true when the codec string matches |
110 // one of a small number of non-RFC compliant strings (e.g. "avc"). | 110 // one of a small number of non-RFC compliant strings (e.g. "avc"). |
111 // |profile| and |level| indicate video codec profile and level (unused for | 111 // |profile| and |level| indicate video codec profile and level (unused for |
112 // audio codecs). These will be VIDEO_CODEC_PROFILE_UNKNOWN and 0 respectively | 112 // audio codecs). These will be VIDEO_CODEC_PROFILE_UNKNOWN and 0 respectively |
113 // whenever |codec_id| is incomplete/invalid, or in some cases when | 113 // whenever |codec_id| is incomplete/invalid, or in some cases when |
114 // |ambiguous_codec_string| is set to true. | 114 // |ambiguous_codec_string| is set to true. |
115 // |is_encrypted| means the codec will be used with encrypted blocks. | 115 // |is_encrypted| means the codec will be used with encrypted blocks. |
116 // |out_eotf| is the electro-optical transfer function described by the | |
117 // |codec_id|. Will be gfx::ColorSpace::TransferID::INVALID for many codec | |
118 // strings where EOTF is not described. | |
servolk
2017/03/02 18:56:36
Yes, VP9 is the only codec that will have eotf in
chcunningham
2017/03/02 23:13:08
Ack. This comment is actually stale. I'm planning
| |
116 bool ParseCodecString(const std::string& mime_type_lower_case, | 119 bool ParseCodecString(const std::string& mime_type_lower_case, |
117 const std::string& codec_id, | 120 const std::string& codec_id, |
118 Codec* codec, | 121 Codec* codec, |
119 bool* ambiguous_codec_string, | 122 bool* ambiguous_codec_string, |
120 VideoCodecProfile* out_profile, | 123 VideoCodecProfile* out_profile, |
121 uint8_t* out_level) const; | 124 uint8_t* out_level, |
125 gfx::ColorSpace::TransferID* out_eotf) const; | |
122 | 126 |
123 // Returns IsSupported if |codec| when platform supports codec contained in | 127 // Returns IsSupported if |codec| when platform supports codec contained in |
124 // |mime_type_lower_case|. Returns MayBeSupported when platform support is | 128 // |mime_type_lower_case|. Returns MayBeSupported when platform support is |
125 // unclear. Otherwise returns NotSupported. Note: This method will always | 129 // unclear. Otherwise returns NotSupported. Note: This method will always |
126 // return NotSupported for proprietary codecs if |allow_proprietary_codecs_| | 130 // return NotSupported for proprietary codecs if |allow_proprietary_codecs_| |
127 // is set to false. |is_encrypted| means the codec will be used with encrypted | 131 // is set to false. |is_encrypted| means the codec will be used with encrypted |
128 // blocks. | 132 // blocks. |
129 // TODO(chcunningham): Make this method return a bool. Platform support should | 133 // TODO(chcunningham): Make this method return a bool. Platform support should |
130 // always be knowable for a fully specified codec. | 134 // always be knowable for a fully specified codec. |
131 SupportsType IsCodecSupported(const std::string& mime_type_lower_case, | 135 SupportsType IsCodecSupported(const std::string& mime_type_lower_case, |
132 Codec codec, | 136 Codec codec, |
133 VideoCodecProfile video_profile, | 137 VideoCodecProfile video_profile, |
134 uint8_t video_level, | 138 uint8_t video_level, |
139 gfx::ColorSpace::TransferID eotf, | |
135 bool is_encrypted) const; | 140 bool is_encrypted) const; |
136 | 141 |
137 // Wrapper around IsCodecSupported for simple codecs that are entirely | 142 // Wrapper around IsCodecSupported for simple codecs that are entirely |
138 // described (or implied) by the container mime-type. | 143 // described (or implied) by the container mime-type. |
139 SupportsType IsSimpleCodecSupported(const std::string& mime_type_lower_case, | 144 SupportsType IsSimpleCodecSupported(const std::string& mime_type_lower_case, |
140 Codec codec, | 145 Codec codec, |
141 bool is_encrypted) const; | 146 bool is_encrypted) const; |
142 | 147 |
143 // Returns true if |codec| refers to a proprietary codec. | 148 // Returns true if |codec| refers to a proprietary codec. |
144 bool IsCodecProprietary(Codec codec) const; | 149 bool IsCodecProprietary(Codec codec) const; |
(...skipping 24 matching lines...) Expand all Loading... | |
169 // Whether proprietary codec support should be advertised to callers. | 174 // Whether proprietary codec support should be advertised to callers. |
170 bool allow_proprietary_codecs_; | 175 bool allow_proprietary_codecs_; |
171 | 176 |
172 DISALLOW_COPY_AND_ASSIGN(MimeUtil); | 177 DISALLOW_COPY_AND_ASSIGN(MimeUtil); |
173 }; | 178 }; |
174 | 179 |
175 } // namespace internal | 180 } // namespace internal |
176 } // namespace media | 181 } // namespace media |
177 | 182 |
178 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ | 183 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ |
OLD | NEW |