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 // |reportToUma| should only be true for prefixed calls. |
56 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( | 57 MEDIA_EXPORT bool IsSupportedKeySystemWithMediaMimeType( |
57 const std::string& mime_type, | 58 const std::string& mime_type, |
58 const std::vector<std::string>& codecs, | 59 const std::vector<std::string>& codecs, |
59 const std::string& key_system); | 60 const std::string& key_system, |
| 61 bool reportToUma); |
60 | 62 |
61 // Returns a name for |key_system| suitable to UMA logging. | 63 // Returns a name for |key_system| suitable to UMA logging. |
62 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); | 64 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); |
63 | 65 |
64 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. | 66 // Returns whether AesDecryptor can be used for the given |concrete_key_system|. |
65 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); | 67 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& concrete_key_system); |
66 | 68 |
67 #if defined(ENABLE_PEPPER_CDMS) | 69 #if defined(ENABLE_PEPPER_CDMS) |
68 // Returns the Pepper MIME type for |concrete_key_system|. | 70 // Returns the Pepper MIME type for |concrete_key_system|. |
69 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. | 71 // Returns empty string if |concrete_key_system| is unknown or not Pepper-based. |
70 MEDIA_EXPORT std::string GetPepperType( | 72 MEDIA_EXPORT std::string GetPepperType( |
71 const std::string& concrete_key_system); | 73 const std::string& concrete_key_system); |
72 #endif | 74 #endif |
73 | 75 |
74 #if defined(UNIT_TEST) | 76 #if defined(UNIT_TEST) |
75 // Helper functions to add container/codec types for testing purposes. | 77 // Helper functions to add container/codec types for testing purposes. |
76 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); | 78 MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask); |
77 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); | 79 MEDIA_EXPORT void AddCodecMask(const std::string& codec, uint32 mask); |
78 #endif // defined(UNIT_TEST) | 80 #endif // defined(UNIT_TEST) |
79 | 81 |
80 } // namespace media | 82 } // namespace media |
81 | 83 |
82 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 84 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
OLD | NEW |