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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "media/base/eme_constants.h" | 13 #include "media/base/eme_constants.h" |
14 #include "media/base/media_export.h" | 14 #include "media/base/media_export.h" |
| 15 #include "ppapi/features/features.h" |
15 | 16 |
16 namespace media { | 17 namespace media { |
17 | 18 |
18 // Provides an interface for querying registered key systems. | 19 // Provides an interface for querying registered key systems. |
19 // | 20 // |
20 // Many of the original static methods are still available, they should be | 21 // Many of the original static methods are still available, they should be |
21 // migrated into this interface over time (or removed). | 22 // migrated into this interface over time (or removed). |
22 // | 23 // |
23 // TODO(sandersd): Provide GetKeySystem() so that it is not necessary to pass | 24 // TODO(sandersd): Provide GetKeySystem() so that it is not necessary to pass |
24 // |key_system| to every method. http://crbug.com/457438 | 25 // |key_system| to every method. http://crbug.com/457438 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( | 76 MEDIA_EXPORT bool IsSupportedKeySystemWithInitDataType( |
76 const std::string& key_system, | 77 const std::string& key_system, |
77 EmeInitDataType init_data_type); | 78 EmeInitDataType init_data_type); |
78 | 79 |
79 // Returns a name for |key_system| suitable to UMA logging. | 80 // Returns a name for |key_system| suitable to UMA logging. |
80 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); | 81 MEDIA_EXPORT std::string GetKeySystemNameForUMA(const std::string& key_system); |
81 | 82 |
82 // Returns whether AesDecryptor can be used for the given |key_system|. | 83 // Returns whether AesDecryptor can be used for the given |key_system|. |
83 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& key_system); | 84 MEDIA_EXPORT bool CanUseAesDecryptor(const std::string& key_system); |
84 | 85 |
85 #if defined(ENABLE_PEPPER_CDMS) | 86 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
86 // Returns the Pepper MIME type for |key_system|. | 87 // Returns the Pepper MIME type for |key_system|. |
87 // Returns empty string if |key_system| is unknown or not Pepper-based. | 88 // Returns empty string if |key_system| is unknown or not Pepper-based. |
88 MEDIA_EXPORT std::string GetPepperType(const std::string& key_system); | 89 MEDIA_EXPORT std::string GetPepperType(const std::string& key_system); |
89 #endif | 90 #endif |
90 | 91 |
91 #if defined(UNIT_TEST) | 92 #if defined(UNIT_TEST) |
92 // Helper functions to add container/codec types for testing purposes. | 93 // Helper functions to add container/codec types for testing purposes. |
93 // Call AddCodecMask() first to ensure the mask values passed to | 94 // Call AddCodecMask() first to ensure the mask values passed to |
94 // AddMimeTypeCodecMask() already exist. | 95 // AddMimeTypeCodecMask() already exist. |
95 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, | 96 MEDIA_EXPORT void AddCodecMask(EmeMediaType media_type, |
96 const std::string& codec, | 97 const std::string& codec, |
97 uint32_t mask); | 98 uint32_t mask); |
98 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 99 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
99 uint32_t mask); | 100 uint32_t mask); |
100 #endif // defined(UNIT_TEST) | 101 #endif // defined(UNIT_TEST) |
101 | 102 |
102 } // namespace media | 103 } // namespace media |
103 | 104 |
104 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ | 105 #endif // MEDIA_BASE_KEY_SYSTEMS_H_ |
OLD | NEW |