| 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> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "media/base/mime_util.h" | 15 #include "media/base/mime_util.h" |
| 16 #include "media/base/video_codecs.h" |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 namespace internal { | 19 namespace internal { |
| 19 | 20 |
| 20 // Internal utility class for handling mime types. Should only be invoked by | 21 // Internal utility class for handling mime types. Should only be invoked by |
| 21 // tests and the functions within mime_util.cc -- NOT for direct use by others. | 22 // tests and the functions within mime_util.cc -- NOT for direct use by others. |
| 22 class MEDIA_EXPORT MimeUtil { | 23 class MEDIA_EXPORT MimeUtil { |
| 23 public: | 24 public: |
| 24 MimeUtil(); | 25 MimeUtil(); |
| 25 ~MimeUtil(); | 26 ~MimeUtil(); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 // Converts a codec ID into an Codec enum value and indicates | 113 // Converts a codec ID into an Codec enum value and indicates |
| 113 // whether the conversion was ambiguous. | 114 // whether the conversion was ambiguous. |
| 114 // Returns true if this method was able to map |codec_id| with | 115 // Returns true if this method was able to map |codec_id| with |
| 115 // |mime_type_lower_case| to a specific Codec enum value. |codec| and | 116 // |mime_type_lower_case| to a specific Codec enum value. |codec| and |
| 116 // |is_ambiguous| are only valid if true is returned. Otherwise their value is | 117 // |is_ambiguous| are only valid if true is returned. Otherwise their value is |
| 117 // undefined after the call. | 118 // undefined after the call. |
| 118 // |is_ambiguous| is true if |codec_id| did not have enough information to | 119 // |is_ambiguous| is true if |codec_id| did not have enough information to |
| 119 // unambiguously determine the proper Codec enum value. If |is_ambiguous| | 120 // unambiguously determine the proper Codec enum value. If |is_ambiguous| |
| 120 // is true |codec| contains the best guess for the intended Codec enum value. | 121 // is true |codec| contains the best guess for the intended Codec enum value. |
| 122 // |profile| and |level| indicate video codec profile and level (unused for |
| 123 // audio codecs). |
| 121 // |is_encrypted| means the codec will be used with encrypted blocks. | 124 // |is_encrypted| means the codec will be used with encrypted blocks. |
| 122 bool StringToCodec(const std::string& mime_type_lower_case, | 125 bool StringToCodec(const std::string& mime_type_lower_case, |
| 123 const std::string& codec_id, | 126 const std::string& codec_id, |
| 124 Codec* codec, | 127 Codec* codec, |
| 125 bool* is_ambiguous, | 128 bool* is_ambiguous, |
| 129 VideoCodecProfile* out_profile, |
| 130 uint8_t* out_level, |
| 126 bool is_encrypted) const; | 131 bool is_encrypted) const; |
| 127 | 132 |
| 128 // Returns true if |codec| is supported when contained in | 133 // Returns true if |codec| is supported when contained in |
| 129 // |mime_type_lower_case|. Note: This method will always return false for | 134 // |mime_type_lower_case|. Note: This method will always return false for |
| 130 // proprietary codecs if |allow_proprietary_codecs_| is set to false. | 135 // proprietary codecs if |allow_proprietary_codecs_| is set to false. |
| 131 // |is_encrypted| means the codec will be used with encrypted blocks. | 136 // |is_encrypted| means the codec will be used with encrypted blocks. |
| 132 bool IsCodecSupported(Codec codec, | 137 bool IsCodecSupported(Codec codec, |
| 133 const std::string& mime_type_lower_case, | 138 const std::string& mime_type_lower_case, |
| 134 bool is_encrypted) const; | 139 bool is_encrypted) const; |
| 135 | 140 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 // Lookup table for string compare based string -> Codec mappings. | 169 // Lookup table for string compare based string -> Codec mappings. |
| 165 StringToCodecMappings string_to_codec_map_; | 170 StringToCodecMappings string_to_codec_map_; |
| 166 | 171 |
| 167 DISALLOW_COPY_AND_ASSIGN(MimeUtil); | 172 DISALLOW_COPY_AND_ASSIGN(MimeUtil); |
| 168 }; | 173 }; |
| 169 | 174 |
| 170 } // namespace internal | 175 } // namespace internal |
| 171 } // namespace media | 176 } // namespace media |
| 172 | 177 |
| 173 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ | 178 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ |
| OLD | NEW |