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 #include "chrome/renderer/media/chrome_key_systems.h" | 5 #include "chrome/renderer/media/chrome_key_systems.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 std::vector<base::string16> additional_param_values; | 68 std::vector<base::string16> additional_param_values; |
69 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, | 69 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, |
70 &additional_param_names, | 70 &additional_param_names, |
71 &additional_param_values)) { | 71 &additional_param_values)) { |
72 return; | 72 return; |
73 } | 73 } |
74 | 74 |
75 KeySystemInfo info; | 75 KeySystemInfo info; |
76 info.key_system = kExternalClearKeyKeySystem; | 76 info.key_system = kExternalClearKeyKeySystem; |
77 | 77 |
78 info.supported_codecs = media::EME_CODEC_WEBM_ALL; | |
79 info.supported_init_data_types = | 78 info.supported_init_data_types = |
80 media::EME_INIT_DATA_TYPE_WEBM | media::EME_INIT_DATA_TYPE_KEYIDS; | 79 media::EME_INIT_DATA_TYPE_WEBM | media::EME_INIT_DATA_TYPE_KEYIDS; |
| 80 info.supported_codecs = media::EME_CODEC_WEBM_ALL; |
81 #if defined(USE_PROPRIETARY_CODECS) | 81 #if defined(USE_PROPRIETARY_CODECS) |
| 82 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; |
82 info.supported_codecs |= media::EME_CODEC_MP4_ALL; | 83 info.supported_codecs |= media::EME_CODEC_MP4_ALL; |
83 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; | |
84 #endif // defined(USE_PROPRIETARY_CODECS) | 84 #endif // defined(USE_PROPRIETARY_CODECS) |
85 | 85 |
| 86 info.max_audio_robustness = media::EmeRobustness::EMPTY; |
| 87 info.max_video_robustness = media::EmeRobustness::EMPTY; |
| 88 |
86 // Persistent sessions are faked. | 89 // Persistent sessions are faked. |
87 info.persistent_license_support = media::EME_SESSION_TYPE_SUPPORTED; | 90 info.persistent_license_support = media::EME_SESSION_TYPE_SUPPORTED; |
88 info.persistent_release_message_support = | 91 info.persistent_release_message_support = |
89 media::EME_SESSION_TYPE_NOT_SUPPORTED; | 92 media::EME_SESSION_TYPE_NOT_SUPPORTED; |
90 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 93 info.persistent_state_support = media::EME_FEATURE_REQUESTABLE; |
91 // succeeding. Change this to REQUESTABLE once the state can be blocked. | |
92 // http://crbug.com/457482 | |
93 info.persistent_state_support = media::EME_FEATURE_ALWAYS_ENABLED; | |
94 info.distinctive_identifier_support = media::EME_FEATURE_NOT_SUPPORTED; | 94 info.distinctive_identifier_support = media::EME_FEATURE_NOT_SUPPORTED; |
95 | 95 |
96 info.pepper_type = kExternalClearKeyPepperType; | 96 info.pepper_type = kExternalClearKeyPepperType; |
97 | 97 |
98 concrete_key_systems->push_back(info); | 98 concrete_key_systems->push_back(info); |
99 | 99 |
100 // Add support of decrypt-only mode in ClearKeyCdm. | 100 // Add support of decrypt-only mode in ClearKeyCdm. |
101 info.key_system = kExternalClearKeyDecryptOnlyKeySystem; | 101 info.key_system = kExternalClearKeyDecryptOnlyKeySystem; |
102 concrete_key_systems->push_back(info); | 102 concrete_key_systems->push_back(info); |
103 | 103 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 supported_codecs |= media::EME_CODEC_WEBM_VP9; | 186 supported_codecs |= media::EME_CODEC_WEBM_VP9; |
187 #if defined(USE_PROPRIETARY_CODECS) | 187 #if defined(USE_PROPRIETARY_CODECS) |
188 if (codecs[i] == kCdmSupportedCodecAvc1) | 188 if (codecs[i] == kCdmSupportedCodecAvc1) |
189 supported_codecs |= media::EME_CODEC_MP4_AVC1; | 189 supported_codecs |= media::EME_CODEC_MP4_AVC1; |
190 #endif // defined(USE_PROPRIETARY_CODECS) | 190 #endif // defined(USE_PROPRIETARY_CODECS) |
191 } | 191 } |
192 | 192 |
193 cdm::AddWidevineWithCodecs( | 193 cdm::AddWidevineWithCodecs( |
194 cdm::WIDEVINE, supported_codecs, | 194 cdm::WIDEVINE, supported_codecs, |
195 #if defined(OS_CHROMEOS) | 195 #if defined(OS_CHROMEOS) |
196 // Persistent licenses are supported if remote attestation succeeds. | 196 media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness. |
197 media::EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, | 197 media::EmeRobustness::HW_SECURE_ALL, // Maximim video robustness. |
198 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 198 // persistent-license. |
199 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 199 media::EME_SESSION_TYPE_SUPPORTED_WITH_IDENTIFIER, |
200 // succeeding. Change this to REQUESTABLE once the state can be blocked. | 200 media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-release-message. |
201 // http://crbug.com/457482 | 201 media::EME_FEATURE_REQUESTABLE, // Persistent state. |
202 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. | 202 // Distinctive identifier. |
203 // A distinctive identifier will be available if remote attestation | 203 media::EME_FEATURE_REQUESTABLE_WITH_IDENTIFIER, |
204 // succeeds. | |
205 media::EME_FEATURE_REQUESTABLE_WITH_PERMISSION, | |
206 #else // (Desktop) | 204 #else // (Desktop) |
207 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. | 205 media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness. |
208 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 206 media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness. |
209 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 207 media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-license. |
210 // succeeding. Change this to REQUESTABLE once the state can be blocked. | 208 media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-release-message. |
211 // http://crbug.com/457482 | 209 media::EME_FEATURE_REQUESTABLE, // Persistent state. |
212 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. | 210 media::EME_FEATURE_NOT_SUPPORTED, // Distinctive identifier. |
213 media::EME_FEATURE_NOT_SUPPORTED, // Distinctive identifier. | |
214 #endif // defined(OS_CHROMEOS) | 211 #endif // defined(OS_CHROMEOS) |
215 concrete_key_systems); | 212 concrete_key_systems); |
216 } | 213 } |
217 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 214 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
218 #endif // defined(ENABLE_PEPPER_CDMS) | 215 #endif // defined(ENABLE_PEPPER_CDMS) |
219 | 216 |
220 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { | 217 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { |
221 #if defined(ENABLE_PEPPER_CDMS) | 218 #if defined(ENABLE_PEPPER_CDMS) |
222 AddExternalClearKey(key_systems_info); | 219 AddExternalClearKey(key_systems_info); |
223 | 220 |
224 #if defined(WIDEVINE_CDM_AVAILABLE) | 221 #if defined(WIDEVINE_CDM_AVAILABLE) |
225 AddPepperBasedWidevine(key_systems_info); | 222 AddPepperBasedWidevine(key_systems_info); |
226 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 223 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
227 #endif // defined(ENABLE_PEPPER_CDMS) | 224 #endif // defined(ENABLE_PEPPER_CDMS) |
228 | 225 |
229 #if defined(OS_ANDROID) | 226 #if defined(OS_ANDROID) |
230 cdm::AddAndroidWidevine(key_systems_info); | 227 cdm::AddAndroidWidevine(key_systems_info); |
231 #endif // defined(OS_ANDROID) | 228 #endif // defined(OS_ANDROID) |
232 } | 229 } |
OLD | NEW |