| 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 "media/base/key_systems.h" | 5 #include "media/base/key_systems.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 if (properties->GetDistinctiveIdentifierSupport() == | 403 if (properties->GetDistinctiveIdentifierSupport() == |
| 404 EmeFeatureSupport::NOT_SUPPORTED) { | 404 EmeFeatureSupport::NOT_SUPPORTED) { |
| 405 DCHECK(properties->GetPersistentLicenseSessionSupport() != | 405 DCHECK(properties->GetPersistentLicenseSessionSupport() != |
| 406 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); | 406 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); |
| 407 DCHECK(properties->GetPersistentReleaseMessageSessionSupport() != | 407 DCHECK(properties->GetPersistentReleaseMessageSessionSupport() != |
| 408 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); | 408 EmeSessionTypeSupport::SUPPORTED_WITH_IDENTIFIER); |
| 409 } | 409 } |
| 410 | 410 |
| 411 // Distinctive identifiers and persistent state can only be reliably blocked | 411 // Distinctive identifiers and persistent state can only be reliably blocked |
| 412 // (and therefore be safely configurable) for Pepper-hosted key systems. For | 412 // (and therefore be safely configurable) for Pepper-hosted key systems. For |
| 413 // other platforms, (except for the AES decryptor) assume that the CDM can | 413 // other platforms assume the CDM can and will do anything, except for the |
| 414 // and will do anything. | 414 // following two cases: |
| 415 // 1) AES decryptor, and |
| 416 // 2) External Clear Key key system on Android, only enabled for testing. |
| 415 bool can_block = properties->UseAesDecryptor(); | 417 bool can_block = properties->UseAesDecryptor(); |
| 416 #if defined(ENABLE_PEPPER_CDMS) | 418 #if defined(ENABLE_PEPPER_CDMS) |
| 417 DCHECK_EQ(properties->UseAesDecryptor(), | 419 DCHECK_EQ(properties->UseAesDecryptor(), |
| 418 properties->GetPepperType().empty()); | 420 properties->GetPepperType().empty()); |
| 419 if (!properties->GetPepperType().empty()) | 421 if (!properties->GetPepperType().empty()) |
| 420 can_block = true; | 422 can_block = true; |
| 423 #elif defined(OS_ANDROID) |
| 424 if (IsExternalClearKey(properties->GetKeySystemName())) |
| 425 can_block = true; |
| 421 #endif | 426 #endif |
| 422 if (!can_block) { | 427 if (!can_block) { |
| 423 DCHECK(properties->GetDistinctiveIdentifierSupport() == | 428 DCHECK(properties->GetDistinctiveIdentifierSupport() == |
| 424 EmeFeatureSupport::ALWAYS_ENABLED); | 429 EmeFeatureSupport::ALWAYS_ENABLED); |
| 425 DCHECK(properties->GetPersistentStateSupport() == | 430 DCHECK(properties->GetPersistentStateSupport() == |
| 426 EmeFeatureSupport::ALWAYS_ENABLED); | 431 EmeFeatureSupport::ALWAYS_ENABLED); |
| 427 } | 432 } |
| 428 | 433 |
| 429 DCHECK_EQ(key_system_properties_map_.count(properties->GetKeySystemName()), | 434 DCHECK_EQ(key_system_properties_map_.count(properties->GetKeySystemName()), |
| 430 0u) | 435 0u) |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 uint32_t mask) { | 732 uint32_t mask) { |
| 728 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); | 733 KeySystemsImpl::GetInstance()->AddCodecMask(media_type, codec, mask); |
| 729 } | 734 } |
| 730 | 735 |
| 731 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, | 736 MEDIA_EXPORT void AddMimeTypeCodecMask(const std::string& mime_type, |
| 732 uint32_t mask) { | 737 uint32_t mask) { |
| 733 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); | 738 KeySystemsImpl::GetInstance()->AddMimeTypeCodecMask(mime_type, mask); |
| 734 } | 739 } |
| 735 | 740 |
| 736 } // namespace media | 741 } // namespace media |
| OLD | NEW |