OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
6 #define WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace webkit_media { | 10 namespace webkit_media { |
11 | 11 |
12 struct MediaFormatAndKeySystem { | 12 struct MediaFormatAndKeySystem { |
13 const char* mime_type; | 13 const char* mime_type; |
14 const char* codecs_list; | 14 const char* codecs_list; |
15 const char* key_system; | 15 const char* key_system; |
16 }; | 16 }; |
17 | 17 |
18 struct KeySystemPluginTypePair { | 18 #if defined(ENABLE_PEPPER_CDMS) |
| 19 struct KeySystemPepperTypePair { |
19 const char* key_system; | 20 const char* key_system; |
20 const char* plugin_type; | 21 const char* type; |
21 }; | 22 }; |
| 23 #endif |
22 | 24 |
23 // Specifies the container and codec combinations supported by individual | 25 // Specifies the container and codec combinations supported by individual |
24 // key systems. Each line is a container-codecs combination and the key system | 26 // key systems. Each line is a container-codecs combination and the key system |
25 // that supports it. Multiple codecs can be listed. In all cases, the container | 27 // that supports it. Multiple codecs can be listed. In all cases, the container |
26 // without a codec is also supported. | 28 // without a codec is also supported. |
27 // This list is converted at runtime into individual container-codec-key system | 29 // This list is converted at runtime into individual container-codec-key system |
28 // entries in KeySystems::key_system_map_. | 30 // entries in KeySystems::key_system_map_. |
29 extern const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[]; | 31 extern const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[]; |
30 extern const int kNumSupportedFormatKeySystemCombinations; | 32 extern const int kNumSupportedFormatKeySystemCombinations; |
31 | 33 |
| 34 #if defined(ENABLE_PEPPER_CDMS) |
32 // There should be one entry for each key system. | 35 // There should be one entry for each key system. |
33 extern const KeySystemPluginTypePair kKeySystemToPluginTypeMapping[]; | 36 extern const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[]; |
34 extern const int kNumKeySystemToPluginTypeMapping; | 37 extern const int kNumKeySystemToPepperTypeMapping; |
| 38 #endif |
35 | 39 |
36 // Returns whether |key_system| is compatible with the user's system. | 40 // Returns whether |key_system| is compatible with the user's system. |
37 bool IsSystemCompatible(const std::string& key_system); | 41 bool IsSystemCompatible(const std::string& key_system); |
38 | 42 |
39 // Returns the name that UMA will use for the given |key_system|. | 43 // Returns the name that UMA will use for the given |key_system|. |
40 // This function can be called frequently. Hence this function should be | 44 // This function can be called frequently. Hence this function should be |
41 // implemented not to impact performance. | 45 // implemented not to impact performance. |
42 std::string KeySystemNameForUMAGeneric(const std::string& key_system); | 46 std::string KeySystemNameForUMAGeneric(const std::string& key_system); |
43 | 47 |
44 // Returns whether built-in AesDecryptor can be used for the given |key_system|. | 48 // Returns whether built-in AesDecryptor can be used for the given |key_system|. |
45 bool CanUseBuiltInAesDecryptor(const std::string& key_system); | 49 bool CanUseBuiltInAesDecryptor(const std::string& key_system); |
46 | 50 |
47 } // namespace webkit_media | 51 } // namespace webkit_media |
48 | 52 |
49 #endif // WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 53 #endif // WEBKIT_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
OLD | NEW |