Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: components/cdm/renderer/android_key_systems.cc

Issue 1106263004: Support Android secure codecs in requestMediaKeySystemAccess(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 28b45eb09be80801f57c7a57ab4abbfc494309d0..77601a956e80a5d53f3acf9b5f306f801ff5d410 100644
--- a/components/cdm/renderer/android_key_systems.cc
+++ b/components/cdm/renderer/android_key_systems.cc
@@ -39,60 +39,46 @@ static SupportedKeySystemResponse QueryKeySystemSupport(
return response;
}
-void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems,
- bool is_non_compositing_supported) {
+void AddAndroidWidevine(std::vector<KeySystemInfo>* concrete_key_systems) {
SupportedKeySystemResponse response = QueryKeySystemSupport(
kWidevineKeySystem);
- // When creating the WIDEVINE key system, BrowserCdmFactoryAndroid configures
- // 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 (is_non_compositing_supported) {
- codecs = response.non_compositing_codecs;
- max_audio_robustness = EmeRobustness::HW_SECURE_CRYPTO;
- max_video_robustness = EmeRobustness::HW_SECURE_ALL;
- }
-
// We are using MediaDrm API on Android and we cannot guarantee that API
// doesn't use persistent storage on the device. Therefore always set
// persistent state to EmeFeatureSupport::ALWAYS_ENABLED to err on the
// safe side.
-
- if (codecs != media::EME_CODEC_NONE) {
+ if (response.compositing_codecs != media::EME_CODEC_NONE) {
ddorwin 2015/04/30 18:18:04 Should we DCHECK that this is not NONE if noncomp
sandersd (OOO until July 31) 2015/04/30 19:57:44 Done.
AddWidevineWithCodecs(
- WIDEVINE, codecs, max_audio_robustness, max_video_robustness,
- media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
- media::EmeSessionTypeSupport::
- NOT_SUPPORTED, // persistent-release-message.
- media::EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state.
- media::EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive
- // identifier.
+ WIDEVINE,
+ response.compositing_codecs, // Regular codecs.
+ response.non_compositing_codecs, // Hardware-secure codecs.
+ EmeRobustness::HW_SECURE_CRYPTO, // Max audio robustness.
+ EmeRobustness::HW_SECURE_ALL, // Max video robustness.
+ media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-license.
jrummell 2015/04/30 02:08:37 Shouldn't these be media::EmeSessionTypeSupport::?
sandersd (OOO until July 31) 2015/04/30 18:19:34 Done.
+ media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-release-message.
+ media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state.
+ media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier.
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
+ // This key systems acts as though only hardware-secure codecs are available.
+ // (The prefixed API only consults the regular codecs field.)
+ // TODO(sandersd): Only register if the hardware-secure codecs pref is set.
if (response.non_compositing_codecs != media::EME_CODEC_NONE) {
+ SupportedCodecs codecs = response.compositing_codecs &
ddorwin 2015/04/30 18:18:04 Probably worth a comment explaining why.
sandersd (OOO until July 31) 2015/04/30 19:57:44 Done.
+ response.non_compositing_codecs;
AddWidevineWithCodecs(
- WIDEVINE_HR_NON_COMPOSITING, response.non_compositing_codecs,
- EmeRobustness::HW_SECURE_CRYPTO, // Max audio robustness.
- EmeRobustness::HW_SECURE_ALL, // Max video robustness.
- media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
- media::EmeSessionTypeSupport::
- NOT_SUPPORTED, // persistent-release-message.
- media::EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state.
- media::EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive
- // identifier.
+ WIDEVINE_HR_NON_COMPOSITING,
+ (response.compositing_codecs &
+ response.non_compositing_codecs), // Regular codecs.
jrummell 2015/04/30 02:08:37 Can't you just use codecs here? Surprised the comp
sandersd (OOO until July 31) 2015/04/30 18:19:34 Done.
+ media::EME_CODEC_NONE, // Hardware-secure codecs.
+ EmeRobustness::HW_SECURE_CRYPTO, // Max audio robustness.
+ EmeRobustness::HW_SECURE_ALL, // Max video robustness.
+ media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-license.
+ media::EME_SESSION_TYPE_NOT_SUPPORTED, // persistent-release-message.
+ media::EME_FEATURE_ALWAYS_ENABLED, // Persistent state.
+ media::EME_FEATURE_ALWAYS_ENABLED, // Distinctive identifier.
concrete_key_systems);
}
}
@@ -121,7 +107,8 @@ void AddAndroidPlatformKeySystems(
#endif // defined(USE_PROPRIETARY_CODECS)
info.max_audio_robustness = EmeRobustness::EMPTY;
info.max_video_robustness = EmeRobustness::EMPTY;
- // Assume the worst case (from a user point of view).
+ // Assume that plaform key systems support no features but can and will
jrummell 2015/04/30 02:08:37 s/plaform/platform/
sandersd (OOO until July 31) 2015/04/30 18:19:34 Done.
+ // make use of persistence and identifiers.
info.persistent_license_support =
media::EmeSessionTypeSupport::NOT_SUPPORTED;
info.persistent_release_message_support =

Powered by Google App Engine
This is Rietveld 408576698