diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-24 12:15:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:30:04 +0000 |
commit | b014812705fc80bff0a5c120dfcef88f349816dc (patch) | |
tree | 25a2e2d9fa285f1add86aa333389a839f81a39ae /chromium/components/cdm/renderer | |
parent | 9f4560b1027ae06fdb497023cdcaf91b8511fa74 (diff) | |
download | qtwebengine-chromium-b014812705fc80bff0a5c120dfcef88f349816dc.tar.gz |
BASELINE: Update Chromium to 68.0.3440.125
Change-Id: I23f19369e01f688e496f5bf179abb521ad73874f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/cdm/renderer')
5 files changed, 49 insertions, 23 deletions
diff --git a/chromium/components/cdm/renderer/android_key_systems.cc b/chromium/components/cdm/renderer/android_key_systems.cc index ec177e94293..6eaa2ba963d 100644 --- a/chromium/components/cdm/renderer/android_key_systems.cc +++ b/chromium/components/cdm/renderer/android_key_systems.cc @@ -48,11 +48,7 @@ class AndroidPlatformKeySystemProperties : public KeySystemProperties { case EmeInitDataType::WEBM: return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; case EmeInitDataType::CENC: -#if BUILDFLAG(USE_PROPRIETARY_CODECS) return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; -#else - return false; -#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) case EmeInitDataType::KEYIDS: case EmeInitDataType::UNKNOWN: return false; @@ -61,6 +57,11 @@ class AndroidPlatformKeySystemProperties : public KeySystemProperties { return false; } + bool IsEncryptionSchemeSupported( + media::EncryptionMode encryption_scheme) const override { + return encryption_scheme == media::EncryptionMode::kCenc; + } + SupportedCodecs GetSupportedCodecs() const override { return supported_codecs_; } @@ -112,8 +113,8 @@ SupportedKeySystemResponse QueryKeySystemSupport( void AddAndroidWidevine( std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { - SupportedKeySystemResponse response = QueryKeySystemSupport( - kWidevineKeySystem); + SupportedKeySystemResponse response = + QueryKeySystemSupport(kWidevineKeySystem); // Since we do not control the implementation of the MediaDrm API on Android, // we assume that it can and will make use of persistence no matter whether @@ -126,7 +127,14 @@ void AddAndroidWidevine( if (response.non_secure_codecs != media::EME_CODEC_NONE) { DVLOG(3) << __func__ << " Widevine supported."; + + // TODO(crbug.com/813845): Determine 'cbcs' support, which may vary by + // Android version. + base::flat_set<media::EncryptionMode> supported_encryption_schemes = { + media::EncryptionMode::kCenc}; + concrete_key_systems->emplace_back(new WidevineKeySystemProperties( + supported_encryption_schemes, // Encryption schemes. response.non_secure_codecs, // Regular codecs. response.secure_codecs, // Hardware-secure codecs. Robustness::HW_SECURE_CRYPTO, // Max audio robustness. diff --git a/chromium/components/cdm/renderer/external_clear_key_key_system_properties.cc b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.cc index 9ff56dc6d68..828d628aceb 100644 --- a/chromium/components/cdm/renderer/external_clear_key_key_system_properties.cc +++ b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.cc @@ -6,7 +6,6 @@ #include "base/logging.h" #include "media/base/eme_constants.h" -#include "media/media_buildflags.h" namespace cdm { @@ -23,17 +22,11 @@ std::string ExternalClearKeyProperties::GetKeySystemName() const { bool ExternalClearKeyProperties::IsSupportedInitDataType( media::EmeInitDataType init_data_type) const { switch (init_data_type) { + case media::EmeInitDataType::CENC: case media::EmeInitDataType::WEBM: case media::EmeInitDataType::KEYIDS: return true; - case media::EmeInitDataType::CENC: -#if BUILDFLAG(USE_PROPRIETARY_CODECS) - return true; -#else - return false; -#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) - case media::EmeInitDataType::UNKNOWN: return false; } @@ -41,12 +34,21 @@ bool ExternalClearKeyProperties::IsSupportedInitDataType( return false; } +bool ExternalClearKeyProperties::IsEncryptionSchemeSupported( + media::EncryptionMode encryption_scheme) const { + switch (encryption_scheme) { + case media::EncryptionMode::kCenc: + case media::EncryptionMode::kCbcs: + return true; + case media::EncryptionMode::kUnencrypted: + break; + } + NOTREACHED(); + return false; +} + media::SupportedCodecs ExternalClearKeyProperties::GetSupportedCodecs() const { -#if BUILDFLAG(USE_PROPRIETARY_CODECS) return media::EME_CODEC_MP4_ALL | media::EME_CODEC_WEBM_ALL; -#else - return media::EME_CODEC_WEBM_ALL; -#endif } media::EmeConfigRule ExternalClearKeyProperties::GetRobustnessConfigRule( diff --git a/chromium/components/cdm/renderer/external_clear_key_key_system_properties.h b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.h index f08967a61d7..224f22d4f6e 100644 --- a/chromium/components/cdm/renderer/external_clear_key_key_system_properties.h +++ b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.h @@ -22,6 +22,8 @@ class ExternalClearKeyProperties : public media::KeySystemProperties { std::string GetKeySystemName() const override; bool IsSupportedInitDataType( media::EmeInitDataType init_data_type) const override; + bool IsEncryptionSchemeSupported( + media::EncryptionMode encryption_scheme) const override; media::SupportedCodecs GetSupportedCodecs() const override; media::EmeConfigRule GetRobustnessConfigRule( media::EmeMediaType media_type, diff --git a/chromium/components/cdm/renderer/widevine_key_system_properties.cc b/chromium/components/cdm/renderer/widevine_key_system_properties.cc index 3683fb8b573..60f4bb07d9c 100644 --- a/chromium/components/cdm/renderer/widevine_key_system_properties.cc +++ b/chromium/components/cdm/renderer/widevine_key_system_properties.cc @@ -4,7 +4,6 @@ #include "components/cdm/renderer/widevine_key_system_properties.h" -#include "media/media_buildflags.h" #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. #if defined(WIDEVINE_CDM_AVAILABLE) @@ -39,6 +38,7 @@ Robustness ConvertRobustness(const std::string& robustness) { } // namespace WidevineKeySystemProperties::WidevineKeySystemProperties( + base::flat_set<media::EncryptionMode> supported_encryption_schemes, media::SupportedCodecs supported_codecs, #if defined(OS_ANDROID) media::SupportedCodecs supported_secure_codecs, @@ -49,7 +49,8 @@ WidevineKeySystemProperties::WidevineKeySystemProperties( media::EmeSessionTypeSupport persistent_release_message_support, media::EmeFeatureSupport persistent_state_support, media::EmeFeatureSupport distinctive_identifier_support) - : supported_codecs_(supported_codecs), + : supported_encryption_schemes_(std::move(supported_encryption_schemes)), + supported_codecs_(supported_codecs), #if defined(OS_ANDROID) supported_secure_codecs_(supported_secure_codecs), #endif // defined(OS_ANDROID) @@ -61,6 +62,8 @@ WidevineKeySystemProperties::WidevineKeySystemProperties( distinctive_identifier_support_(distinctive_identifier_support) { } +WidevineKeySystemProperties::~WidevineKeySystemProperties() = default; + std::string WidevineKeySystemProperties::GetKeySystemName() const { return kWidevineKeySystem; } @@ -72,14 +75,17 @@ bool WidevineKeySystemProperties::IsSupportedInitDataType( // |init_data_type| x |container| pairings. if (init_data_type == EmeInitDataType::WEBM) return (supported_codecs_ & media::EME_CODEC_WEBM_ALL) != 0; -#if BUILDFLAG(USE_PROPRIETARY_CODECS) if (init_data_type == EmeInitDataType::CENC) return (supported_codecs_ & media::EME_CODEC_MP4_ALL) != 0; -#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) return false; } +bool WidevineKeySystemProperties::IsEncryptionSchemeSupported( + media::EncryptionMode encryption_scheme) const { + return supported_encryption_schemes_.count(encryption_scheme) != 0; +} + SupportedCodecs WidevineKeySystemProperties::GetSupportedCodecs() const { return supported_codecs_; } diff --git a/chromium/components/cdm/renderer/widevine_key_system_properties.h b/chromium/components/cdm/renderer/widevine_key_system_properties.h index c758b84c144..05b88a659d0 100644 --- a/chromium/components/cdm/renderer/widevine_key_system_properties.h +++ b/chromium/components/cdm/renderer/widevine_key_system_properties.h @@ -5,9 +5,12 @@ #ifndef COMPONENTS_CDM_RENDERER_WIDEVINE_KEY_SYSTEM_PROPERTIES_H_ #define COMPONENTS_CDM_RENDERER_WIDEVINE_KEY_SYSTEM_PROPERTIES_H_ +#include <string> +#include <vector> + +#include "base/containers/flat_set.h" #include "build/build_config.h" #include "media/base/key_system_properties.h" -#include "media/media_buildflags.h" namespace cdm { @@ -27,6 +30,7 @@ class WidevineKeySystemProperties : public media::KeySystemProperties { }; WidevineKeySystemProperties( + base::flat_set<media::EncryptionMode> supported_encryption_schemes, media::SupportedCodecs supported_codecs, #if defined(OS_ANDROID) media::SupportedCodecs supported_secure_codecs, @@ -37,10 +41,13 @@ class WidevineKeySystemProperties : public media::KeySystemProperties { media::EmeSessionTypeSupport persistent_release_message_support, media::EmeFeatureSupport persistent_state_support, media::EmeFeatureSupport distinctive_identifier_support); + ~WidevineKeySystemProperties() override; std::string GetKeySystemName() const override; bool IsSupportedInitDataType( media::EmeInitDataType init_data_type) const override; + bool IsEncryptionSchemeSupported( + media::EncryptionMode encryption_scheme) const override; media::SupportedCodecs GetSupportedCodecs() const override; #if defined(OS_ANDROID) @@ -58,6 +65,7 @@ class WidevineKeySystemProperties : public media::KeySystemProperties { media::EmeFeatureSupport GetDistinctiveIdentifierSupport() const override; private: + const base::flat_set<media::EncryptionMode> supported_encryption_schemes_; const media::SupportedCodecs supported_codecs_; #if defined(OS_ANDROID) const media::SupportedCodecs supported_secure_codecs_; |