| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // Returns false if a container-specific |init_data_type| is specified with an | 29 // Returns false if a container-specific |init_data_type| is specified with an |
| 30 // inappropriate container. | 30 // inappropriate container. |
| 31 // TODO(sandersd): Remove this essentially internal detail if the spec is | 31 // TODO(sandersd): Remove this essentially internal detail if the spec is |
| 32 // updated to not convolve the two in a single method call. | 32 // updated to not convolve the two in a single method call. |
| 33 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440 | 33 // TODO(sandersd): Use enum values instead of strings. http://crbug.com/417440 |
| 34 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer( | 34 MEDIA_EXPORT bool IsSaneInitDataTypeWithContainer( |
| 35 const std::string& init_data_type, | 35 const std::string& init_data_type, |
| 36 const std::string& container); | 36 const std::string& container); |
| 37 | 37 |
| 38 // Use for unprefixed EME only! |
| 39 // Returns whether |key_system| is a supported key system. |
| 38 // Note: Shouldn't be used for prefixed API as the original | 40 // Note: Shouldn't be used for prefixed API as the original |
| 39 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does | 41 // IsSupportedKeySystemWithMediaMimeType() path reports UMAs, but this path does |
| 40 // not. | 42 // not. |
| 41 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); | 43 MEDIA_EXPORT bool IsSupportedKeySystem(const std::string& key_system); |
| 42 | 44 |
| 43 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( | 45 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( |
| 44 const std::string& key_system, | 46 const std::string& key_system, |
| 45 const std::string& init_data_type); | 47 const std::string& init_data_type); |
| 46 | 48 |
| 49 // Use for prefixed EME only! |
| 47 // Returns whether |key_system| is a real supported key system that can be | 50 // Returns whether |key_system| is a real supported key system that can be |
| 48 // instantiated. | 51 // instantiated. |
| 49 // Abstract parent |key_system| strings will return false. | 52 // Abstract parent |key_system| strings will return false. |
| 50 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | 53 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a |
| 51 // |key_system| supports a specific type of media or to check parent key | 54 // |key_system| supports a specific type of media or to check parent key |
| 52 // systems. | 55 // systems. |
| 53 MEDIA_EXPORT bool IsConcreteSupportedKeySystem(const std::string& key_system); | 56 MEDIA_EXPORT bool PrefixedIsSupportedConcreteKeySystem( |
| 57 const std::string& key_system); |
| 54 | 58 |
| 59 // Use for unprefixed EME only! |
| 55 // Returns whether |key_system| supports the specified media type and codec(s). | 60 // Returns whether |key_system| supports the specified media type and codec(s). |
| 56 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | 61 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( |
| 57 const std::string& mime_type, | 62 const std::string& mime_type, |
| 58 const std::vector<std::string>& codecs, | 63 const std::vector<std::string>& codecs, |
| 59 const std::string& key_system); | 64 const std::string& key_system); |
| 60 | 65 |
| 66 // Use for prefixed EME only! |
| 61 // Returns whether |key_system| supports the specified media type and codec(s). | 67 // Returns whether |key_system| supports the specified media type and codec(s). |
| 62 // To be used with prefixed EME only as it generates UMAs based on the query. | 68 // To be used with prefixed EME only as it generates UMAs based on the query. |
| 63 MEDIA_EXPORT bool PrefixedIsSupportedKeySystemWithMediaMimeType( | 69 MEDIA_EXPORT bool PrefixedIsSupportedKeySystemWithMediaMimeType( |
| 64 const std::string& mime_type, | 70 const std::string& mime_type, |
| 65 const std::vector<std::string>& codecs, | 71 const std::vector<std::string>& codecs, |
| 66 const std::string& key_system); | 72 const std::string& key_system); |
| 67 | 73 |
| 68 // Returns a name for |key_system| suitable to UMA logging. | 74 // Returns a name for |key_system| suitable to UMA logging. |
| 69 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); | 75 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); |
| 70 | 76 |
| 71 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. | 77 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. |
| 72 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); | 78 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); |
| 73 | 79 |
| 74 #if defined(ENABLE_PEPPER_CDMS) | 80 #if defined(ENABLE_PEPPER_CDMS) |
| 75 // Returns the Pepper MIME type for |concrete_key_system|. | 81 // Returns the Pepper MIME type for |concrete_key_system|. |
| 76 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. | 82 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. |
| 77 MEDIA_EXPORT std::string GetPepperType( | 83 MEDIA_EXPORT std::string GetPepperType( |
| 78 const std::string& concrete_key_system); | 84 const std::string& concrete_key_system); |
| 79 #endif | 85 #endif |
| 80 | 86 |
| 81 #if defined(UNIT_TEST) | 87 #if defined(UNIT_TEST) |
| 82 // Helper functions to add container/codec types for testing purposes. | 88 // Helper functions to add container/codec types for testing purposes. |
| 83 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 89 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
| 84 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 90 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); |
| 85 #endif // defined(UNIT_TEST) | 91 #endif // defined(UNIT_TEST) |
| 86 | 92 |
| 87 } // namespace media | 93 } // namespace media |
| 88 | 94 |
| 89 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 95 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
| OLD | NEW |