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 #include "webkit/media/crypto/key_systems_info.h" | 5 #include "webkit/media/crypto/key_systems_info.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 | 8 |
9 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 9 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineBaseKeySystem }, | 82 { "audio/mp4", kWidevineAudioMp4Codecs, kWidevineBaseKeySystem }, |
83 #endif // defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) | 83 #endif // defined(WIDEVINE_CDM_CENC_SUPPORT_AVAILABLE) |
84 #endif // defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) | 84 #endif // defined(GOOGLE_CHROME_BUILD) || defined(USE_PROPRIETARY_CODECS) |
85 #endif // defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE) | 85 #endif // defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE) |
86 #endif // WIDEVINE_CDM_AVAILABLE | 86 #endif // WIDEVINE_CDM_AVAILABLE |
87 }; | 87 }; |
88 | 88 |
89 const int kNumSupportedFormatKeySystemCombinations = | 89 const int kNumSupportedFormatKeySystemCombinations = |
90 arraysize(kSupportedFormatKeySystemCombinations); | 90 arraysize(kSupportedFormatKeySystemCombinations); |
91 | 91 |
92 const KeySystemPluginTypePair kKeySystemToPluginTypeMapping[] = { | 92 #if defined(ENABLE_PEPPER_CDMS) |
93 // TODO(xhwang): Update this with the real plugin name. | 93 const KeySystemPepperTypePair kKeySystemToPepperTypeMapping[] = { |
94 { kExternalClearKeyKeySystem, "application/x-ppapi-clearkey-cdm"}, | 94 { kExternalClearKeyKeySystem, "application/x-ppapi-clearkey-cdm"}, |
95 #if defined(WIDEVINE_CDM_AVAILABLE) | 95 #if defined(WIDEVINE_CDM_AVAILABLE) |
96 { kWidevineKeySystem, kWidevineCdmPluginMimeType} | 96 { kWidevineKeySystem, kWidevineCdmPluginMimeType} |
97 #endif // WIDEVINE_CDM_AVAILABLE | 97 #endif // WIDEVINE_CDM_AVAILABLE |
98 }; | 98 }; |
99 | 99 |
100 const int kNumKeySystemToPluginTypeMapping = | 100 const int kNumKeySystemToPepperTypeMapping = |
101 arraysize(kKeySystemToPluginTypeMapping); | 101 arraysize(kKeySystemToPepperTypeMapping); |
| 102 #endif // defined(ENABLE_PEPPER_CDMS) |
102 | 103 |
103 bool IsSystemCompatible(const std::string& key_system) { | 104 bool IsSystemCompatible(const std::string& key_system) { |
104 #if defined(WIDEVINE_CDM_AVAILABLE) && \ | 105 #if defined(WIDEVINE_CDM_AVAILABLE) && \ |
105 defined(OS_LINUX) && !defined(OS_CHROMEOS) | 106 defined(OS_LINUX) && !defined(OS_CHROMEOS) |
106 if (key_system == kWidevineKeySystem || | 107 if (key_system == kWidevineKeySystem || |
107 key_system == kWidevineBaseKeySystem) { | 108 key_system == kWidevineBaseKeySystem) { |
108 Version glibc_version(gnu_get_libc_version()); | 109 Version glibc_version(gnu_get_libc_version()); |
109 DCHECK(glibc_version.IsValid()); | 110 DCHECK(glibc_version.IsValid()); |
110 return !glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION); | 111 return !glibc_version.IsOlderThan(WIDEVINE_CDM_MIN_GLIBC_VERSION); |
111 } | 112 } |
112 #endif | 113 #endif |
113 return true; | 114 return true; |
114 } | 115 } |
115 | 116 |
116 std::string KeySystemNameForUMAGeneric(const std::string& key_system) { | 117 std::string KeySystemNameForUMAGeneric(const std::string& key_system) { |
117 if (key_system == kClearKeyKeySystem) | 118 if (key_system == kClearKeyKeySystem) |
118 return "ClearKey"; | 119 return "ClearKey"; |
119 #if defined(WIDEVINE_CDM_AVAILABLE) | 120 #if defined(WIDEVINE_CDM_AVAILABLE) |
120 if (key_system == kWidevineKeySystem) | 121 if (key_system == kWidevineKeySystem) |
121 return "Widevine"; | 122 return "Widevine"; |
122 #endif // WIDEVINE_CDM_AVAILABLE | 123 #endif // WIDEVINE_CDM_AVAILABLE |
123 return "Unknown"; | 124 return "Unknown"; |
124 } | 125 } |
125 | 126 |
126 bool CanUseBuiltInAesDecryptor(const std::string& key_system) { | 127 bool CanUseBuiltInAesDecryptor(const std::string& key_system) { |
127 return key_system == kClearKeyKeySystem; | 128 return key_system == kClearKeyKeySystem; |
128 } | 129 } |
129 | 130 |
130 } // namespace webkit_media | 131 } // namespace webkit_media |
OLD | NEW |