From 53625eed98105bfa900672cefa6336280272e9f7 Mon Sep 17 00:00:00 2001 From: ddorwin Date: Wed, 1 Apr 2015 20:35:09 -0700 Subject: Replace kMediaDrmEnableNonCompositing swicth with use_video_overlay_for_embedded_encrypted_video pref Disables kMediaDrmEnableNonCompositing by default in WebView. It is now controlled by the pref. Also updates comments related to enabling unprefixed EME. BUG=470275,470279 Review URL: https://codereview.chromium.org/1045173002 Cr-Commit-Position: refs/heads/master@{#323420} --- components/cdm/renderer/android_key_systems.cc | 13 +++++++------ components/cdm/renderer/android_key_systems.h | 7 ++++++- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'components/cdm') diff --git a/components/cdm/renderer/android_key_systems.cc b/components/cdm/renderer/android_key_systems.cc index d9bb106..e1538ba 100644 --- a/components/cdm/renderer/android_key_systems.cc +++ b/components/cdm/renderer/android_key_systems.cc @@ -39,21 +39,22 @@ static SupportedKeySystemResponse QueryKeySystemSupport( return response; } -void AddAndroidWidevine(std::vector* concrete_key_systems) { +void AddAndroidWidevine(std::vector* concrete_key_systems, + bool is_non_compositing_supported) { SupportedKeySystemResponse response = QueryKeySystemSupport( kWidevineKeySystem); // When creating the WIDEVINE key system, BrowserCdmFactoryAndroid configures - // the CDM's security level based on the --mediadrm-enable-non-compositing - // flag (L1 if the flag is enabled, L3 otherwise). Therefore the supported - // codec/robustenss combinations depend on that flag. + // the CDM's security level based on a pref. Therefore the supported + // codec/robustenss combinations depend on that pref, represented by + // |bool is_non_compositing_supported|. // TODO(sandersd): For unprefixed, set the security level based on the // requested robustness instead of the flag. http://crbug.com/467779 + // We should also stop using the term "non_compositing." SupportedCodecs codecs = response.compositing_codecs; EmeRobustness max_audio_robustness = EmeRobustness::SW_SECURE_CRYPTO; EmeRobustness max_video_robustness = EmeRobustness::SW_SECURE_CRYPTO; - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kMediaDrmEnableNonCompositing)) { + if (is_non_compositing_supported) { codecs = response.non_compositing_codecs; max_audio_robustness = EmeRobustness::HW_SECURE_CRYPTO; max_video_robustness = EmeRobustness::HW_SECURE_ALL; diff --git a/components/cdm/renderer/android_key_systems.h b/components/cdm/renderer/android_key_systems.h index fb962b1..b27f57c 100644 --- a/components/cdm/renderer/android_key_systems.h +++ b/components/cdm/renderer/android_key_systems.h @@ -12,7 +12,12 @@ namespace cdm { void AddAndroidWidevine( - std::vector* concrete_key_systems); + std::vector* concrete_key_systems, + // TODO(sandersd): Non-compositing support depends on the + // use_video_overlay_for_embedded_encrypted_video pref, which may differ per + // WebContents, meaning this cannot be a global setting for the renderer + // process. Handle this per WebContents instead. http://crbug.com/467779 + bool is_non_compositing_supported); // Add platform-supported key systems which are not explicitly handled // by Chrome. -- cgit v1.1