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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 supported_codecs |= media::EME_CODEC_WEBM_VP8; | 183 supported_codecs |= media::EME_CODEC_WEBM_VP8; |
184 if (codecs[i] == kCdmSupportedCodecVp9) | 184 if (codecs[i] == kCdmSupportedCodecVp9) |
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, | 193 cdm::WIDEVINE, supported_codecs, |
194 supported_codecs, | |
195 #if defined(OS_CHROMEOS) | 194 #if defined(OS_CHROMEOS) |
196 // Persistent licenses are supported if remote attestation succeeds. | 195 // Persistent licenses are supported if remote attestation succeeds. |
197 media::EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, | 196 media::EME_SESSION_TYPE_SUPPORTED_WITH_PERMISSION, |
198 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 197 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
199 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 198 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from |
200 // succeeding. Change this to REQUESTABLE once the state can be blocked. | 199 // succeeding. Change this to REQUESTABLE once the state can be blocked. |
201 // http://crbug.com/457482 | 200 // http://crbug.com/457482 |
202 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. | 201 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. |
203 // A distinctive identifier will be available if remote attestation | 202 // A distinctive identifier will be available if remote attestation |
204 // succeeds. | 203 // succeeds. |
205 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 204 media::EME_FEATURE_REQUESTABLE_WITH_PERMISSION, |
206 // succeeding. Change this to REQUESTABLE_WITH_PERMISSION once the | |
207 // distinctive identifier can be blocked. http://crbug.com/457482 | |
208 media::EME_FEATURE_ALWAYS_ENABLED, | |
209 #else // (Desktop) | 205 #else // (Desktop) |
210 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. | 206 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. |
211 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. | 207 media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
212 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from | 208 // TODO(sandersd): Using ALWAYS_ENABLED prevents "not-allowed" from |
213 // succeeding. Change this to REQUESTABLE once the state can be blocked. | 209 // succeeding. Change this to REQUESTABLE once the state can be blocked. |
214 // http://crbug.com/457482 | 210 // http://crbug.com/457482 |
215 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. | 211 media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state. |
216 media::EME_FEATURE_NOT_SUPPORTED, // Distinctive identifier. | 212 media::EME_FEATURE_NOT_SUPPORTED, // Distinctive identifier. |
217 #endif // defined(OS_CHROMEOS) | 213 #endif // defined(OS_CHROMEOS) |
218 concrete_key_systems); | 214 concrete_key_systems); |
219 } | 215 } |
220 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 216 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
221 #endif // defined(ENABLE_PEPPER_CDMS) | 217 #endif // defined(ENABLE_PEPPER_CDMS) |
222 | 218 |
223 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { | 219 void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) { |
224 #if defined(ENABLE_PEPPER_CDMS) | 220 #if defined(ENABLE_PEPPER_CDMS) |
225 AddExternalClearKey(key_systems_info); | 221 AddExternalClearKey(key_systems_info); |
226 | 222 |
227 #if defined(WIDEVINE_CDM_AVAILABLE) | 223 #if defined(WIDEVINE_CDM_AVAILABLE) |
228 AddPepperBasedWidevine(key_systems_info); | 224 AddPepperBasedWidevine(key_systems_info); |
229 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 225 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
230 #endif // defined(ENABLE_PEPPER_CDMS) | 226 #endif // defined(ENABLE_PEPPER_CDMS) |
231 | 227 |
232 #if defined(OS_ANDROID) | 228 #if defined(OS_ANDROID) |
233 cdm::AddAndroidWidevine(key_systems_info); | 229 cdm::AddAndroidWidevine(key_systems_info); |
234 #endif // defined(OS_ANDROID) | 230 #endif // defined(OS_ANDROID) |
235 } | 231 } |
OLD | NEW |