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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const std::string& init_data_type); | 45 const std::string& init_data_type); |
46 | 46 |
47 // Returns whether |key_system| is a real supported key system that can be | 47 // Returns whether |key_system| is a real supported key system that can be |
48 // instantiated. | 48 // instantiated. |
49 // Abstract parent |key_system| strings will return false. | 49 // Abstract parent |key_system| strings will return false. |
50 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a | 50 // Call IsSupportedKeySystemWithMediaMimeType() to determine whether a |
51 // |key_system| supports a specific type of media or to check parent key | 51 // |key_system| supports a specific type of media or to check parent key |
52 // systems. | 52 // systems. |
53 MEDIA_EXPORT bool IsConcreteSupportedKeySystem(const std::string& key_system); | 53 MEDIA_EXPORT bool IsConcreteSupportedKeySystem(const std::string& key_system); |
54 | 54 |
55 // Returns whether |key_sytem| supports the specified media type and codec(s). | 55 // Returns whether |key_system| supports the specified media type and codec(s). |
56 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | 56 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( |
57 const std::string& mime_type, | 57 const std::string& mime_type, |
58 const std::vector<std::string>& codecs, | 58 const std::vector<std::string>& codecs, |
59 const std::string& key_system); | 59 const std::string& key_system); |
60 | 60 |
| 61 // 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. |
| 63 MEDIA_EXPORT bool PrefixedIsSupportedKeySystemWithMediaMimeType( |
| 64 const std::string& mime_type, |
| 65 const std::vector<std::string>& codecs, |
| 66 const std::string& key_system); |
| 67 |
61 // Returns a name for |key_system| suitable to UMA logging. | 68 // Returns a name for |key_system| suitable to UMA logging. |
62 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); | 69 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); |
63 | 70 |
64 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. | 71 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. |
65 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); | 72 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); |
66 | 73 |
67 #if defined(ENABLE_PEPPER_CDMS) | 74 #if defined(ENABLE_PEPPER_CDMS) |
68 // Returns the Pepper MIME type for |concrete_key_system|. | 75 // Returns the Pepper MIME type for |concrete_key_system|. |
69 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. | 76 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. |
70 MEDIA_EXPORT std::string GetPepperType( | 77 MEDIA_EXPORT std::string GetPepperType( |
71 const std::string& concrete_key_system); | 78 const std::string& concrete_key_system); |
72 #endif | 79 #endif |
73 | 80 |
74 #if defined(UNIT_TEST) | 81 #if defined(UNIT_TEST) |
75 // Helper functions to add container/codec types for testing purposes. | 82 // Helper functions to add container/codec types for testing purposes. |
76 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 83 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
77 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 84 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); |
78 #endif // defined(UNIT_TEST) | 85 #endif // defined(UNIT_TEST) |
79 | 86 |
80 } // namespace media | 87 } // namespace media |
81 | 88 |
82 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 89 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
OLD | NEW |