diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-27 17:56:17 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-09-22 08:47:36 +0000 |
commit | 5d0fbf8a6890c395c0cdc0c60e775b70c95e15ed (patch) | |
tree | c6354b09515a9110c121e3a3f3e97dd94b9b788a /src/core/content_client_qt.cpp | |
parent | 43b7af20c421e4ffb20cd4625f3b704e78e7325d (diff) |
General adaptations for Chromium 69
Change-Id: Ifeaf0ee13213dc5a24d2f2b4655cf7f405cddef7
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/content_client_qt.cpp')
-rw-r--r-- | src/core/content_client_qt.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index a2b8c4da3..1a3be31be 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -250,9 +250,7 @@ namespace QtWebEngineCore { #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) static bool IsWidevineAvailable(base::FilePath *cdm_path, - std::vector<media::VideoCodec> *codecs_supported, - bool *supports_persistent_license, - base::flat_set<media::EncryptionMode>* modes_supported) + content::CdmCapability *capability) { QStringList pluginPaths; const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kCdmWidevinePath); @@ -300,15 +298,20 @@ static bool IsWidevineAvailable(base::FilePath *cdm_path, if (base::PathExists(*cdm_path)) { // Add the supported codecs as if they came from the component manifest. // This list must match the CDM that is being bundled with Chrome. - codecs_supported->push_back(media::VideoCodec::kCodecVP8); - codecs_supported->push_back(media::VideoCodec::kCodecVP9); + capability->video_codecs.push_back(media::VideoCodec::kCodecVP8); + capability->video_codecs.push_back(media::VideoCodec::kCodecVP9); #if BUILDFLAG(USE_PROPRIETARY_CODECS) - codecs_supported->push_back(media::VideoCodec::kCodecH264); + capability->video_codecs.push_back(media::VideoCodec::kCodecH264); #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) - *supports_persistent_license = false; + // Add the supported encryption schemes as if they came from the + // component manifest. This list must match the CDM that is being + // bundled with Chrome. + capability->encryption_schemes.insert(media::EncryptionMode::kCenc); + capability->encryption_schemes.insert(media::EncryptionMode::kCbcs); - modes_supported->insert(media::EncryptionMode::kCenc); + // Temporary session is always supported. + capability->session_types.insert(media::CdmSessionType::kTemporary); return true; } @@ -325,16 +328,11 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo> if (cdms) { #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) base::FilePath cdm_path; - std::vector<media::VideoCodec> video_codecs_supported; - bool supports_persistent_license = false; - base::flat_set<media::EncryptionMode> encryption_modes_supported; - if (IsWidevineAvailable(&cdm_path, &video_codecs_supported, - &supports_persistent_license, - &encryption_modes_supported)) { + content::CdmCapability capability; + if (IsWidevineAvailable(&cdm_path, &capability)) { const base::Version version; cdms->push_back(content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path, - kWidevineCdmFileSystemId, video_codecs_supported, - supports_persistent_license, encryption_modes_supported, + kWidevineCdmFileSystemId, std::move(capability), kWidevineKeySystem, false)); } #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) @@ -351,8 +349,13 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo> // A variant of ECK key system that has a different GUID. const char kExternalClearKeyDifferentGuidTestKeySystem[] = "org.chromium.externalclearkey.differentguid"; - // ECK implementation supports persistent licenses. - constexpr bool supports_persistent_license = true; + + // Supported codecs are hard-coded in ExternalClearKeyProperties. + content::CdmCapability capability( + {}, {media::EncryptionMode::kCenc, media::EncryptionMode::kCbcs}, + {media::CdmSessionType::kTemporary, + media::CdmSessionType::kPersistentLicense}, + {}); // Register kExternalClearKeyDifferentGuidTestKeySystem first separately. // Otherwise, it'll be treated as a sub-key-system of normal @@ -360,15 +363,13 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo> // ECKEncryptedMediaTest. cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmDifferentGuid, base::Version("0.1.0.0"), clear_key_cdm_path, - media::kClearKeyCdmFileSystemId, {}, supports_persistent_license, - {media::EncryptionMode::kCenc, media::EncryptionMode::kCbcs}, + media::kClearKeyCdmFileSystemId, capability, kExternalClearKeyDifferentGuidTestKeySystem, false)); // Supported codecs are hard-coded in ExternalClearKeyProperties. cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmGuid, base::Version("0.1.0.0"), clear_key_cdm_path, - media::kClearKeyCdmFileSystemId, {}, supports_persistent_license, - {media::EncryptionMode::kCenc, media::EncryptionMode::kCbcs}, + media::kClearKeyCdmFileSystemId, capability, kExternalClearKeyKeySystem, true)); } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) |