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 WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 5 #ifndef WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
6 #define WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 6 #define WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | |
11 | |
12 #if defined(OS_ANDROID) | |
13 #include <vector> | |
14 #endif | |
15 | |
10 namespace webkit_media { | 16 namespace webkit_media { |
11 | 17 |
12 struct MediaFormatAndKeySystem { | 18 struct MediaFormatAndKeySystem { |
13 const char* mime_type; | 19 const char* mime_type; |
14 const char* codecs_list; | 20 const char* codecs_list; |
15 const char* key_system; | 21 const char* key_system; |
16 }; | 22 }; |
17 | 23 |
18 #if defined(ENABLE_PEPPER_CDMS) | 24 #if defined(ENABLE_PEPPER_CDMS) |
19 struct KeySystemPepperTypePair { | 25 struct KeySystemPepperTypePair { |
20 const char* key_system; | 26 const char* key_system; |
21 const char* type; | 27 const char* type; |
22 }; | 28 }; |
23 #endif | 29 #endif // defined(ENABLE_PEPPER_CDMS) |
30 | |
31 #if defined(OS_ANDROID) | |
32 struct KeySystemUUIDPair { | |
33 const char* key_system; | |
34 std::vector<uint8> uuid; | |
ddorwin
2013/06/20 22:20:15
Per the other comment, you'll need a different typ
qinmin
2013/06/20 23:30:12
Done.
| |
35 }; | |
36 #endif // defined(OS_ANDROID) | |
24 | 37 |
25 // Specifies the container and codec combinations supported by individual | 38 // Specifies the container and codec combinations supported by individual |
26 // key systems. Each line is a container-codecs combination and the key system | 39 // key systems. Each line is a container-codecs combination and the key system |
27 // that supports it. Multiple codecs can be listed. In all cases, the container | 40 // that supports it. Multiple codecs can be listed. In all cases, the container |
28 // without a codec is also supported. | 41 // without a codec is also supported. |
29 // This list is converted at runtime into individual container-codec-key system | 42 // This list is converted at runtime into individual container-codec-key system |
30 // entries in KeySystems::key_system_map_. | 43 // entries in KeySystems::key_system_map_. |
31 extern const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[]; | 44 extern const MediaFormatAndKeySystem kSupportedFormatKeySystemCombinations[]; |
32 extern const int kNumSupportedFormatKeySystemCombinations; | 45 extern const int kNumSupportedFormatKeySystemCombinations; |
33 | 46 |
34 #if defined(ENABLE_PEPPER_CDMS) | 47 #if defined(ENABLE_PEPPER_CDMS) |
35 // There should be one entry for each key system. | 48 // There should be one entry for each key system. |
36 extern const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[]; | 49 extern const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[]; |
37 extern const int kNumKeySystemToPepperTypeMapping; | 50 extern const int kNumKeySystemToPepperTypeMapping; |
38 #endif | 51 #endif // defined(ENABLE_PEPPER_CDMS) |
52 | |
53 #if defined(OS_ANDROID) | |
54 // Mapping from key system to UUID, one entry per key system. | |
55 extern const KeySystemUUIDPair kKeySystemToUUIDMapping[]; | |
56 extern const int kNumKeySystemToUUIDMapping; | |
57 #endif // defined(OS_ANDROID) | |
39 | 58 |
40 // Returns whether |key_system| is compatible with the user's system. | 59 // Returns whether |key_system| is compatible with the user's system. |
41 bool IsSystemCompatible(const std::string& key_system); | 60 bool IsSystemCompatible(const std::string& key_system); |
42 | 61 |
43 // Returns the name that UMA will use for the given |key_system|. | 62 // Returns the name that UMA will use for the given |key_system|. |
44 // This function can be called frequently. Hence this function should be | 63 // This function can be called frequently. Hence this function should be |
45 // implemented not to impact performance. | 64 // implemented not to impact performance. |
46 std::string KeySystemNameForUMAGeneric(const std::string& key_system); | 65 std::string KeySystemNameForUMAGeneric(const std::string& key_system); |
47 | 66 |
48 // Returns whether built-in AesDecryptor can be used for the given |key_system|. | 67 // Returns whether built-in AesDecryptor can be used for the given |key_system|. |
49 bool CanUseBuiltInAesDecryptor(const std::string& key_system); | 68 bool CanUseBuiltInAesDecryptor(const std::string& key_system); |
50 | 69 |
51 } // namespace webkit_media | 70 } // namespace webkit_media |
52 | 71 |
53 #endif // WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ | 72 #endif // WEBKIT_RENDERER_MEDIA_CRYPTO_KEY_SYSTEMS_INFO_H_ |
OLD | NEW |