Chromium Code Reviews| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 "application/x-ppapi-clearkey-cdm"; | 65 "application/x-ppapi-clearkey-cdm"; |
| 66 | 66 |
| 67 std::vector<base::string16> additional_param_names; | 67 std::vector<base::string16> additional_param_names; |
| 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(kExternalClearKeyKeySystem); | 75 KeySystemInfo info; |
| 76 info.key_system = kExternalClearKeyKeySystem; | |
| 76 | 77 |
| 77 info.supported_codecs = media::EME_CODEC_WEBM_ALL; | 78 info.supported_codecs = media::EME_CODEC_WEBM_ALL; |
| 78 info.supported_init_data_types = media::EME_INIT_DATA_TYPE_WEBM; | 79 info.supported_init_data_types = media::EME_INIT_DATA_TYPE_WEBM; |
| 79 #if defined(USE_PROPRIETARY_CODECS) | 80 #if defined(USE_PROPRIETARY_CODECS) |
| 80 info.supported_codecs |= media::EME_CODEC_MP4_ALL; | 81 info.supported_codecs |= media::EME_CODEC_MP4_ALL; |
| 81 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; | 82 info.supported_init_data_types |= media::EME_INIT_DATA_TYPE_CENC; |
| 82 #endif // defined(USE_PROPRIETARY_CODECS) | 83 #endif // defined(USE_PROPRIETARY_CODECS) |
| 83 | 84 |
| 85 // Persistent sessions are faked. | |
| 86 info.persistent_license_support = media::EME_SESSION_TYPE_SUPPORTED; | |
| 87 info.persistent_release_message_support = | |
| 88 media::EME_SESSION_TYPE_NOT_SUPPORTED; | |
| 89 info.persistent_state_support = media::EME_FEATURE_SUPPORTED; | |
| 90 info.distinctive_identifier_support = media::EME_FEATURE_NOT_SUPPORTED; | |
| 91 | |
| 84 info.pepper_type = kExternalClearKeyPepperType; | 92 info.pepper_type = kExternalClearKeyPepperType; |
| 85 | 93 |
| 86 concrete_key_systems->push_back(info); | 94 concrete_key_systems->push_back(info); |
| 87 | 95 |
| 88 // Add support of decrypt-only mode in ClearKeyCdm. | 96 // Add support of decrypt-only mode in ClearKeyCdm. |
| 89 info.key_system = kExternalClearKeyDecryptOnlyKeySystem; | 97 info.key_system = kExternalClearKeyDecryptOnlyKeySystem; |
| 90 concrete_key_systems->push_back(info); | 98 concrete_key_systems->push_back(info); |
| 91 | 99 |
| 92 // A key system that triggers FileIO test in ClearKeyCdm. | 100 // A key system that triggers FileIO test in ClearKeyCdm. |
| 93 info.key_system = kExternalClearKeyFileIOTestKeySystem; | 101 info.key_system = kExternalClearKeyFileIOTestKeySystem; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 if (codecs[i] == kCdmSupportedCodecVp8) | 179 if (codecs[i] == kCdmSupportedCodecVp8) |
| 172 supported_codecs |= media::EME_CODEC_WEBM_VP8; | 180 supported_codecs |= media::EME_CODEC_WEBM_VP8; |
| 173 if (codecs[i] == kCdmSupportedCodecVp9) | 181 if (codecs[i] == kCdmSupportedCodecVp9) |
| 174 supported_codecs |= media::EME_CODEC_WEBM_VP9; | 182 supported_codecs |= media::EME_CODEC_WEBM_VP9; |
| 175 #if defined(USE_PROPRIETARY_CODECS) | 183 #if defined(USE_PROPRIETARY_CODECS) |
| 176 if (codecs[i] == kCdmSupportedCodecAvc1) | 184 if (codecs[i] == kCdmSupportedCodecAvc1) |
| 177 supported_codecs |= media::EME_CODEC_MP4_AVC1; | 185 supported_codecs |= media::EME_CODEC_MP4_AVC1; |
| 178 #endif // defined(USE_PROPRIETARY_CODECS) | 186 #endif // defined(USE_PROPRIETARY_CODECS) |
| 179 } | 187 } |
| 180 | 188 |
| 181 cdm::AddWidevineWithCodecs(cdm::WIDEVINE, | 189 cdm::AddWidevineWithCodecs( |
| 182 supported_codecs, | 190 cdm::WIDEVINE, |
| 183 concrete_key_systems); | 191 supported_codecs, |
| 192 #if defined(OS_CHROMEOS) | |
| 193 // Persistent licenses are supported if remote attestatin succeeds. | |
|
ddorwin
2015/02/19 01:41:33
attestation
sandersd (OOO until July 31)
2015/02/19 21:08:33
Done.
| |
| 194 media::EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, | |
| 195 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | |
| 196 media::EME_FEATURE_SUPPORTED, // Persistent state. | |
| 197 // A distinctive identifier will be available if remote attestation | |
| 198 // succeeds. | |
| 199 // TODO(sandersd): Using ALWAYS_AVAILABLE prevents "not-allowed" from | |
| 200 // succeeding. Change this to SUPPORTED_WITH_PERMISSION once the | |
| 201 // distinctive identifier can be blocked. http://crbug.com/457482 | |
| 202 media::EME_FEATURE_ALWAYS_AVAILABLE, | |
| 203 #else // (Desktop) | |
| 204 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. | |
| 205 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | |
| 206 media::EME_FEATURE_SUPPORTED, // Persistent state. | |
| 207 media::EME_FEATURE_NOT_SUPPORTED, // Distinctive identifier. | |
| 208 #endif // defined(OS_CHROMEOS) | |
| 209 concrete_key_systems); | |
| 184 } | 210 } |
| 185 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 211 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 186 #endif // defined(ENABLE_PEPPER_CDMS) | 212 #endif // defined(ENABLE_PEPPER_CDMS) |
| 187 | 213 |
| 188 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { | 214 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { |
| 189 #if defined(ENABLE_PEPPER_CDMS) | 215 #if defined(ENABLE_PEPPER_CDMS) |
| 190 AddExternalClearKey(key_systems_info); | 216 AddExternalClearKey(key_systems_info); |
| 191 | 217 |
| 192 #if defined(WIDEVINE_CDM_AVAILABLE) | 218 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 193 AddPepperBasedWidevine(key_systems_info); | 219 AddPepperBasedWidevine(key_systems_info); |
| 194 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 220 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 195 #endif // defined(ENABLE_PEPPER_CDMS) | 221 #endif // defined(ENABLE_PEPPER_CDMS) |
| 196 | 222 |
| 197 #if defined(OS_ANDROID) | 223 #if defined(OS_ANDROID) |
| 198 cdm::AddAndroidWidevine(key_systems_info); | 224 cdm::AddAndroidWidevine(key_systems_info); |
| 199 #endif // defined(OS_ANDROID) | 225 #endif // defined(OS_ANDROID) |
| 200 } | 226 } |
| OLD | NEW |