diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-04 14:17:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-01-05 10:05:06 +0000 |
commit | 39d357e3248f80abea0159765ff39554affb40db (patch) | |
tree | aba0e6bfb76de0244bba0f5fdbd64b830dd6e621 /chromium/components/cdm | |
parent | 87778abf5a1f89266f37d1321b92a21851d8244d (diff) | |
download | qtwebengine-chromium-39d357e3248f80abea0159765ff39554affb40db.tar.gz |
BASELINE: Update Chromium to 55.0.2883.105
And updates ninja to 1.7.2
Change-Id: I20d43c737f82764d857ada9a55586901b18b9243
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/components/cdm')
5 files changed, 143 insertions, 4 deletions
diff --git a/chromium/components/cdm/common/BUILD.gn b/chromium/components/cdm/common/BUILD.gn index fc43c7e2a70..03e672cc5d3 100644 --- a/chromium/components/cdm/common/BUILD.gn +++ b/chromium/components/cdm/common/BUILD.gn @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("common") { +static_library("common") { sources = [ "cdm_message_generator.cc", "cdm_message_generator.h", diff --git a/chromium/components/cdm/renderer/BUILD.gn b/chromium/components/cdm/renderer/BUILD.gn index f364f89c829..9ec8fd05be4 100644 --- a/chromium/components/cdm/renderer/BUILD.gn +++ b/chromium/components/cdm/renderer/BUILD.gn @@ -4,6 +4,8 @@ static_library("renderer") { sources = [ + "external_clear_key_key_system_properties.cc", + "external_clear_key_key_system_properties.h", "widevine_key_system_properties.cc", "widevine_key_system_properties.h", ] diff --git a/chromium/components/cdm/renderer/android_key_systems.cc b/chromium/components/cdm/renderer/android_key_systems.cc index 22ca175eaa4..7953dd61f19 100644 --- a/chromium/components/cdm/renderer/android_key_systems.cc +++ b/chromium/components/cdm/renderer/android_key_systems.cc @@ -91,9 +91,7 @@ class AndroidPlatformKeySystemProperties : public KeySystemProperties { const SupportedCodecs supported_codecs_; }; -} // namespace - -static SupportedKeySystemResponse QueryKeySystemSupport( +SupportedKeySystemResponse QueryKeySystemSupport( const std::string& key_system) { SupportedKeySystemRequest request; SupportedKeySystemResponse response; @@ -109,6 +107,8 @@ static SupportedKeySystemResponse QueryKeySystemSupport( return response; } +} // namespace + void AddAndroidWidevine( std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { SupportedKeySystemResponse response = QueryKeySystemSupport( 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 new file mode 100644 index 00000000000..5771ec2af55 --- /dev/null +++ b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.cc @@ -0,0 +1,89 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/cdm/renderer/external_clear_key_key_system_properties.h" + +#include "base/logging.h" +#include "media/base/eme_constants.h" + +namespace cdm { + +#if defined(ENABLE_PEPPER_CDMS) +const char kExternalClearKeyPepperType[] = "application/x-ppapi-clearkey-cdm"; +#endif + +ExternalClearKeyProperties::ExternalClearKeyProperties( + const std::string& key_system_name) + : key_system_name_(key_system_name) {} + +ExternalClearKeyProperties::~ExternalClearKeyProperties() {} + +std::string ExternalClearKeyProperties::GetKeySystemName() const { + return key_system_name_; +} + +bool ExternalClearKeyProperties::IsSupportedInitDataType( + media::EmeInitDataType init_data_type) const { + switch (init_data_type) { + case media::EmeInitDataType::WEBM: + case media::EmeInitDataType::KEYIDS: + return true; + + case media::EmeInitDataType::CENC: +#if defined(USE_PROPRIETARY_CODECS) + return true; +#else + return false; +#endif // defined(USE_PROPRIETARY_CODECS) + + case media::EmeInitDataType::UNKNOWN: + return false; + } + NOTREACHED(); + return false; +} + +media::SupportedCodecs ExternalClearKeyProperties::GetSupportedCodecs() const { +#if defined(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( + media::EmeMediaType media_type, + const std::string& requested_robustness) const { + return requested_robustness.empty() ? media::EmeConfigRule::SUPPORTED + : media::EmeConfigRule::NOT_SUPPORTED; +} + +// Persistent license sessions are faked. +media::EmeSessionTypeSupport +ExternalClearKeyProperties::GetPersistentLicenseSessionSupport() const { + return media::EmeSessionTypeSupport::SUPPORTED; +} + +media::EmeSessionTypeSupport +ExternalClearKeyProperties::GetPersistentReleaseMessageSessionSupport() const { + return media::EmeSessionTypeSupport::NOT_SUPPORTED; +} + +media::EmeFeatureSupport ExternalClearKeyProperties::GetPersistentStateSupport() + const { + return media::EmeFeatureSupport::REQUESTABLE; +} + +media::EmeFeatureSupport +ExternalClearKeyProperties::GetDistinctiveIdentifierSupport() const { + return media::EmeFeatureSupport::NOT_SUPPORTED; +} + +#if defined(ENABLE_PEPPER_CDMS) +std::string ExternalClearKeyProperties::GetPepperType() const { + return kExternalClearKeyPepperType; +} +#endif + +} // namespace cdm 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 new file mode 100644 index 00000000000..d0ed06fd875 --- /dev/null +++ b/chromium/components/cdm/renderer/external_clear_key_key_system_properties.h @@ -0,0 +1,48 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CDM_RENDERER_EXTERNAL_CLEAR_KEY_KEY_SYSTEM_PROPERTIES_H_ +#define COMPONENTS_CDM_RENDERER_EXTERNAL_CLEAR_KEY_KEY_SYSTEM_PROPERTIES_H_ + +#include <string> + +#include "build/build_config.h" +#include "media/base/key_system_properties.h" + +namespace cdm { + +#if defined(ENABLE_PEPPER_CDMS) +extern const char kExternalClearKeyPepperType[]; +#endif + +// KeySystemProperties implementation for external Clear Key key systems. +class ExternalClearKeyProperties : public media::KeySystemProperties { + public: + explicit ExternalClearKeyProperties(const std::string& key_system_name); + ~ExternalClearKeyProperties() override; + + std::string GetKeySystemName() const override; + bool IsSupportedInitDataType( + media::EmeInitDataType init_data_type) const override; + media::SupportedCodecs GetSupportedCodecs() const override; + media::EmeConfigRule GetRobustnessConfigRule( + media::EmeMediaType media_type, + const std::string& requested_robustness) const override; + media::EmeSessionTypeSupport GetPersistentLicenseSessionSupport() + const override; + media::EmeSessionTypeSupport GetPersistentReleaseMessageSessionSupport() + const override; + media::EmeFeatureSupport GetPersistentStateSupport() const override; + media::EmeFeatureSupport GetDistinctiveIdentifierSupport() const override; +#if defined(ENABLE_PEPPER_CDMS) + std::string GetPepperType() const override; +#endif + + private: + const std::string key_system_name_; +}; + +} // namespace cdm + +#endif // COMPONENTS_CDM_RENDERER_EXTERNAL_CLEAR_KEY_KEY_SYSTEM_PROPERTIES_H_ |