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