| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/renderer/key_systems_cast.h" | 5 #include "chromecast/renderer/key_systems_cast.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chromecast/media/base/key_systems_common.h" | 12 #include "chromecast/media/base/key_systems_common.h" |
| 13 #include "components/cdm/renderer/widevine_key_system_properties.h" | 13 #include "components/cdm/renderer/widevine_key_system_properties.h" |
| 14 #include "media/base/eme_constants.h" | 14 #include "media/base/eme_constants.h" |
| 15 #include "media/base/key_system_properties.h" | 15 #include "media/base/key_system_properties.h" |
| 16 #include "media/media_features.h" |
| 16 | 17 |
| 17 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 18 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 18 | 19 |
| 19 using ::media::EmeConfigRule; | 20 using ::media::EmeConfigRule; |
| 20 using ::media::EmeFeatureSupport; | 21 using ::media::EmeFeatureSupport; |
| 21 using ::media::EmeInitDataType; | 22 using ::media::EmeInitDataType; |
| 22 using ::media::EmeMediaType; | 23 using ::media::EmeMediaType; |
| 23 using ::media::EmeSessionTypeSupport; | 24 using ::media::EmeSessionTypeSupport; |
| 24 using ::media::SupportedCodecs; | 25 using ::media::SupportedCodecs; |
| 25 | 26 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 | 37 |
| 37 std::string GetKeySystemName() const override { | 38 std::string GetKeySystemName() const override { |
| 38 return media::kChromecastPlayreadyKeySystem; | 39 return media::kChromecastPlayreadyKeySystem; |
| 39 } | 40 } |
| 40 | 41 |
| 41 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { | 42 bool IsSupportedInitDataType(EmeInitDataType init_data_type) const override { |
| 42 return init_data_type == EmeInitDataType::CENC; | 43 return init_data_type == EmeInitDataType::CENC; |
| 43 } | 44 } |
| 44 | 45 |
| 45 SupportedCodecs GetSupportedCodecs() const override { | 46 SupportedCodecs GetSupportedCodecs() const override { |
| 46 return ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; | 47 SupportedCodecs codecs = |
| 48 ::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1; |
| 49 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| 50 codecs |= ::media::EME_CODEC_MP4_HEVC; |
| 51 #endif |
| 52 return codecs; |
| 47 } | 53 } |
| 48 | 54 |
| 49 EmeConfigRule GetRobustnessConfigRule( | 55 EmeConfigRule GetRobustnessConfigRule( |
| 50 EmeMediaType media_type, | 56 EmeMediaType media_type, |
| 51 const std::string& requested_robustness) const override { | 57 const std::string& requested_robustness) const override { |
| 52 return requested_robustness.empty() ? EmeConfigRule::SUPPORTED | 58 return requested_robustness.empty() ? EmeConfigRule::SUPPORTED |
| 53 : EmeConfigRule::NOT_SUPPORTED; | 59 : EmeConfigRule::NOT_SUPPORTED; |
| 54 } | 60 } |
| 55 | 61 |
| 56 EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const override { | 62 EmeSessionTypeSupport GetPersistentLicenseSessionSupport() const override { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. | 110 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license. |
| 105 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. | 111 EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message. |
| 106 // Note: On Chromecast, all CDMs may have persistent state. | 112 // Note: On Chromecast, all CDMs may have persistent state. |
| 107 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. | 113 EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state. |
| 108 EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. | 114 EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier. |
| 109 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 115 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| 110 } | 116 } |
| 111 | 117 |
| 112 } // namespace shell | 118 } // namespace shell |
| 113 } // namespace chromecast | 119 } // namespace chromecast |
| OLD | NEW |