OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/cdm/renderer/external_clear_key_key_system_properties.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "media/base/eme_constants.h" |
| 9 |
| 10 namespace cdm { |
| 11 |
| 12 #if defined(ENABLE_PEPPER_CDMS) |
| 13 const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm"; |
| 14 #endif |
| 15 |
| 16 ExternalClearKeyProperties::ExternalClearKeyProperties( |
| 17 const std::string& key_system_name) |
| 18 : key_system_name_(key_system_name) {} |
| 19 |
| 20 ExternalClearKeyProperties::~ExternalClearKeyProperties() {} |
| 21 |
| 22 std::string ExternalClearKeyProperties::GetKeySystemName() const { |
| 23 return key_system_name_; |
| 24 } |
| 25 |
| 26 bool ExternalClearKeyProperties::IsSupportedInitDataType( |
| 27 media::EmeInitDataType init_data_type) const { |
| 28 switch (init_data_type) { |
| 29 case media::EmeInitDataType::WEBM: |
| 30 case media::EmeInitDataType::KEYIDS: |
| 31 return true; |
| 32 |
| 33 case media::EmeInitDataType::CENC: |
| 34 #if defined(USE_PROPRIETARY_CODECS) |
| 35 return true; |
| 36 #else |
| 37 return false; |
| 38 #endif // defined(USE_PROPRIETARY_CODECS) |
| 39 |
| 40 case media::EmeInitDataType::UNKNOWN: |
| 41 return false; |
| 42 } |
| 43 NOTREACHED(); |
| 44 return false; |
| 45 } |
| 46 |
| 47 media::SupportedCodecs ExternalClearKeyProperties::GetSupportedCodecs() const { |
| 48 #if defined(USE_PROPRIETARY_CODECS) |
| 49 return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL; |
| 50 #else |
| 51 return media::EME_CODEC_WEBM_ALL; |
| 52 #endif |
| 53 } |
| 54 |
| 55 media::EmeConfigRule ExternalClearKeyProperties::GetRobustnessConfigRule( |
| 56 media::EmeMediaType media_type, |
| 57 const std::string& requested_robustness) const { |
| 58 return requested_robustness.empty() ? media::EmeConfigRule::SUPPORTED |
| 59 : media::EmeConfigRule::NOT_SUPPORTED; |
| 60 } |
| 61 |
| 62 // Persistent license sessions are faked. |
| 63 media::EmeSessionTypeSupport |
| 64 ExternalClearKeyProperties::GetPersistentLicenseSessionSupport() const { |
| 65 return media::EmeSessionTypeSupport::SUPPORTED; |
| 66 } |
| 67 |
| 68 media::EmeSessionTypeSupport |
| 69 ExternalClearKeyProperties::GetPersistentReleaseMessageSessionSupport() const { |
| 70 return media::EmeSessionTypeSupport::NOT_SUPPORTED; |
| 71 } |
| 72 |
| 73 media::EmeFeatureSupport ExternalClearKeyProperties::GetPersistentStateSupport() |
| 74 const { |
| 75 return media::EmeFeatureSupport::REQUESTABLE; |
| 76 } |
| 77 |
| 78 media::EmeFeatureSupport |
| 79 ExternalClearKeyProperties::GetDistinctiveIdentifierSupport() const { |
| 80 return media::EmeFeatureSupport::NOT_SUPPORTED; |
| 81 } |
| 82 |
| 83 #if defined(ENABLE_PEPPER_CDMS) |
| 84 std::string ExternalClearKeyProperties::GetPepperType() const { |
| 85 return kExternalClearKeyPepperType; |
| 86 } |
| 87 #endif |
| 88 |
| 89 } // namespace cdm |
OLD | NEW |