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