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