| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_KEY_SYSTEMS_H_ | 5 #ifndef MEDIA_BASE_KEY_SYSTEMS_H_ |
| 6 #define MEDIA_BASE_KEY_SYSTEMS_H_ | 6 #define MEDIA_BASE_KEY_SYSTEMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // TODO(sandersd): Remove this essentially internal detail if the spec is | 84 // TODO(sandersd): Remove this essentially internal detail if the spec is |
| 85 // updated to not convolve the two in a single method call. | 85 // updated to not convolve the two in a single method call. |
| 86 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440 | 86 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440 |
| 87 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer( | 87 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer( |
| 88 const std::string& init_data_type, | 88 const std::string& init_data_type, |
| 89 const std::string& container); | 89 const std::string& container); |
| 90 | 90 |
| 91 // Use for unprefixed EME only! | 91 // Use for unprefixed EME only! |
| 92 // Returns whether |key_system| is a supported key system. | 92 // Returns whether |key_system| is a supported key system. |
| 93 // Note: Shouldn't be used for prefixed API as the original | 93 // Note: Shouldn't be used for prefixed API as the original |
| 94 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does | |
| 95 // not. | |
| 96 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); | 94 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); |
| 97 | 95 |
| 98 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( | 96 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( |
| 99 const std::string& key_system, | 97 const std::string& key_system, |
| 100 const std::string& init_data_type); | 98 const std::string& init_data_type); |
| 101 | 99 |
| 102 // Use for prefixed EME only! | 100 // Use for prefixed EME only! |
| 103 // Returns whether |key_system| is a real supported key system that can be | 101 // Returns whether |key_system| is a real supported key system that can be |
| 104 // instantiated. | 102 // instantiated. |
| 105 // Abstract parent |key_system| strings will return false. | 103 // Abstract parent |key_system| strings will return false. |
| 106 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | |
| 107 // |key_system| supports a specific type of media or to check parent key | |
| 108 // systems. | |
| 109 MEDIA_EXPORT bool PrefixedIsSupportedConcreteKeySystem( | 104 MEDIA_EXPORT bool PrefixedIsSupportedConcreteKeySystem( |
| 110 const std::string& key_system); | 105 const std::string& key_system); |
| 111 | 106 |
| 112 // Use for unprefixed EME only! | |
| 113 // Returns whether |key_system| supports the specified media type and codec(s). | |
| 114 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | |
| 115 const std::string& mime_type, | |
| 116 const std::vector<std::string>& codecs, | |
| 117 const std::string& key_system); | |
| 118 | |
| 119 // Use for prefixed EME only! | 107 // Use for prefixed EME only! |
| 120 // Returns whether |key_system| supports the specified media type and codec(s). | 108 // Returns whether |key_system| supports the specified media type and codec(s). |
| 121 // To be used with prefixed EME only as it generates UMAs based on the query. | 109 // To be used with prefixed EME only as it generates UMAs based on the query. |
| 122 MEDIA_EXPORT bool PrefixedIsSupportedKeySystemWithMediaMimeType( | 110 MEDIA_EXPORT bool PrefixedIsSupportedKeySystemWithMediaMimeType( |
| 123 const std::string& mime_type, | 111 const std::string& mime_type, |
| 124 const std::vector<std::string>& codecs, | 112 const std::vector<std::string>& codecs, |
| 125 const std::string& key_system); | 113 const std::string& key_system); |
| 126 | 114 |
| 127 // Returns a name for |key_system| suitable to UMA logging. | 115 // Returns a name for |key_system| suitable to UMA logging. |
| 128 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); | 116 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); |
| 129 | 117 |
| 130 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. | 118 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. |
| 131 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); | 119 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); |
| 132 | 120 |
| 133 #if defined(ENABLE_PEPPER_CDMS) | 121 #if defined(ENABLE_PEPPER_CDMS) |
| 134 // Returns the Pepper MIME type for |concrete_key_system|. | 122 // Returns the Pepper MIME type for |concrete_key_system|. |
| 135 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. | 123 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. |
| 136 MEDIA_EXPORT std::string GetPepperType( | 124 MEDIA_EXPORT std::string GetPepperType( |
| 137 const std::string& concrete_key_system); | 125 const std::string& concrete_key_system); |
| 138 #endif | 126 #endif |
| 139 | 127 |
| 140 #if defined(UNIT_TEST) | 128 #if defined(UNIT_TEST) |
| 141 // Helper functions to add container/codec types for testing purposes. | 129 // Helper functions to add container/codec types for testing purposes. |
| 142 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 130 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
| 143 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 131 MEDIA_EXPORT void AddCodecMask( |
| 132 EmeMediaType media_type, |
| 133 const std::string& codec, |
| 134 uint32 mask); |
| 144 #endif // defined(UNIT_TEST) | 135 #endif // defined(UNIT_TEST) |
| 145 | 136 |
| 146 } // namespace media | 137 } // namespace media |
| 147 | 138 |
| 148 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 139 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
| OLD | NEW |