| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // IsNotSupported is returned if |mime_type_lower_case| is not supported or at | 100 // IsNotSupported is returned if |mime_type_lower_case| is not supported or at |
| 101 // least one is not supported in |mime_type_lower_case|. |is_encrypted| means | 101 // least one is not supported in |mime_type_lower_case|. |is_encrypted| means |
| 102 // the codec will be used with encrypted blocks. | 102 // the codec will be used with encrypted blocks. |
| 103 SupportsType AreSupportedCodecs(const CodecSet& supported_codecs, | 103 SupportsType AreSupportedCodecs(const CodecSet& supported_codecs, |
| 104 const std::vector<std::string>& codecs, | 104 const std::vector<std::string>& codecs, |
| 105 const std::string& mime_type_lower_case, | 105 const std::string& mime_type_lower_case, |
| 106 bool is_encrypted) const; | 106 bool is_encrypted) const; |
| 107 | 107 |
| 108 // Converts a codec ID into an Codec enum value and indicates | 108 // Converts a codec ID into an Codec enum value and indicates |
| 109 // whether the conversion was ambiguous. | 109 // whether the conversion was ambiguous. |
| 110 // Returns true if this method was able to map |codec_id| to a specific | 110 // Returns true if this method was able to map |codec_id| with |
| 111 // Codec enum value. |codec| and |is_ambiguous| are only valid if true | 111 // |mime_type_lower_case| to a specific Codec enum value. |codec| and |
| 112 // is returned. Otherwise their value is undefined after the call. | 112 // |is_ambiguous| are only valid if true is returned. Otherwise their value is |
| 113 // undefined after the call. |
| 113 // |is_ambiguous| is true if |codec_id| did not have enough information to | 114 // |is_ambiguous| is true if |codec_id| did not have enough information to |
| 114 // unambiguously determine the proper Codec enum value. If |is_ambiguous| | 115 // unambiguously determine the proper Codec enum value. If |is_ambiguous| |
| 115 // is true |codec| contains the best guess for the intended Codec enum value. | 116 // is true |codec| contains the best guess for the intended Codec enum value. |
| 116 bool StringToCodec(const std::string& codec_id, | 117 bool StringToCodec(const std::string& mime_type_lower_case, |
| 118 const std::string& codec_id, |
| 117 Codec* codec, | 119 Codec* codec, |
| 118 bool* is_ambiguous) const; | 120 bool* is_ambiguous) const; |
| 119 | 121 |
| 120 // Returns true if |codec| is supported when contained in | 122 // Returns true if |codec| is supported when contained in |
| 121 // |mime_type_lower_case|. Note: This method will always return false for | 123 // |mime_type_lower_case|. Note: This method will always return false for |
| 122 // proprietary codecs if |allow_proprietary_codecs_| is set to false. | 124 // proprietary codecs if |allow_proprietary_codecs_| is set to false. |
| 123 // |is_encrypted| means the codec will be used with encrypted blocks. | 125 // |is_encrypted| means the codec will be used with encrypted blocks. |
| 124 bool IsCodecSupported(Codec codec, | 126 bool IsCodecSupported(Codec codec, |
| 125 const std::string& mime_type_lower_case, | 127 const std::string& mime_type_lower_case, |
| 126 bool is_encrypted) const; | 128 bool is_encrypted) const; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 155 // Lookup table for string compare based string -> Codec mappings. | 157 // Lookup table for string compare based string -> Codec mappings. |
| 156 StringToCodecMappings string_to_codec_map_; | 158 StringToCodecMappings string_to_codec_map_; |
| 157 | 159 |
| 158 DISALLOW_COPY_AND_ASSIGN(MimeUtil); | 160 DISALLOW_COPY_AND_ASSIGN(MimeUtil); |
| 159 }; | 161 }; |
| 160 | 162 |
| 161 } // namespace internal | 163 } // namespace internal |
| 162 } // namespace media | 164 } // namespace media |
| 163 | 165 |
| 164 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ | 166 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ |
| OLD | NEW |