Index: components/cdm/renderer/android_key_systems.cc |
diff --git a/components/cdm/renderer/android_key_systems.cc b/components/cdm/renderer/android_key_systems.cc |
index d1e0f2ad7f4955fdb8b8f40fff829a3fc06eb6ea..81c3b637250faf23b78f788a63f029915001505b 100644 |
--- a/components/cdm/renderer/android_key_systems.cc |
+++ b/components/cdm/renderer/android_key_systems.cc |
@@ -39,10 +39,22 @@ static SupportedKeySystemResponse QueryKeySystemSupport( |
void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { |
SupportedKeySystemResponse response = QueryKeySystemSupport( |
kWidevineKeySystem); |
- if (response.compositing_codecs != media::EME_CODEC_NONE) { |
+ |
+ // 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. |
+ // TODO(sandersd): For unprefixed, set the security level based on the |
+ // requested robustness instead of the flag. http://crbug.com/459400 |
ddorwin
2015/03/16 23:25:08
That's probably not exactly this bug.
sandersd (OOO until July 31)
2015/03/17 22:10:38
Done.
|
+ SupportedCodecs codecs = response.compositing_codecs; |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
ddorwin
2015/03/16 23:25:08
My point was that we might want to use
if (respons
sandersd (OOO until July 31)
2015/03/17 22:10:38
Unfortunately the com.widevine.alpha key system ma
ddorwin
2015/03/18 01:08:04
Oh. :( Thanks.
|
+ switches::kMediaDrmEnableNonCompositing)) { |
+ codecs = response.non_compositing_codecs; |
+ } |
+ if (codecs != media::EME_CODEC_NONE) { |
AddWidevineWithCodecs( |
WIDEVINE, |
- static_cast<SupportedCodecs>(response.compositing_codecs), |
+ codecs, |
media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. |
media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. |
@@ -50,11 +62,15 @@ void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) { |
concrete_key_systems); |
} |
+ // For compatibility with the prefixed API, register a separate L1 key system. |
+ // When creating the WIDEVINE_HR_NON_COMPOSITING key system, |
+ // BrowserCdmFactoryAndroid does not configure the CDM's security level (that |
+ // is, leaves it as L1); therefore only secure codecs are supported. |
+ // TODO(ddorwin): Remove with unprefixed. http://crbug.com/249976 |
if (response.non_compositing_codecs != media::EME_CODEC_NONE) { |
- // TODO(ddorwin): Remove with unprefixed. http://crbug.com/249976 |
AddWidevineWithCodecs( |
WIDEVINE_HR_NON_COMPOSITING, |
- static_cast<SupportedCodecs>(response.non_compositing_codecs), |
+ response.non_compositing_codecs, |
media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent license. |
media::EME_SESSION_TYPE_NOT_SUPPORTED, // Persistent release message. |
media::EME_FEATURE_NOT_SUPPORTED, // Persistent state. |