Commit fde644c1 authored by John Rummell's avatar John Rummell Committed by Commit Bot

Revert MediaCodecUtil changes using FEATURE_SecurePlayback.

UMA stats are showing that the number of successful
navigator.requestMediaKeySystemAccess() calls are lower on canary
than before this change was landed. It's possible that the checks
for secure playback are not working properly on some devices,
so reverting part of the change that added them to verify.

Bug: 707127,727918,846120
Test: EncryptedMedia content_browsertests pass
Change-Id: I9d1be799121859181c996e5ea47234fae6c6fcf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1719729
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#681136}
parent 6fc3850d
...@@ -202,43 +202,7 @@ class MediaCodecUtil { ...@@ -202,43 +202,7 @@ class MediaCodecUtil {
*/ */
@CalledByNative @CalledByNative
private static boolean canDecode(String mime, boolean isSecure) { private static boolean canDecode(String mime, boolean isSecure) {
// Not supported on blacklisted devices. // TODO(crbug.com/846120): Investigate if FEATURE_SecurePlayback will work here.
if (!isDecoderSupportedForDevice(mime)) {
Log.e(TAG, "Decoder for type %s is not supported on this device", mime);
return false;
}
// MediaCodecInfo.CodecCapabilities.FEATURE_SecurePlayback is available as of
// API 21 (LOLLIPOP), which is the same as NewMediaCodecList.
MediaCodecListHelper codecListHelper = new MediaCodecListHelper();
if (codecListHelper.hasNewMediaCodecList()) {
for (MediaCodecInfo info : codecListHelper) {
if (info.isEncoder()) continue;
try {
CodecCapabilities caps = info.getCapabilitiesForType(mime);
if (caps != null) {
// If a secure decoder is required, then FEATURE_SecurePlayback must be
// supported.
if (isSecure) {
return caps.isFeatureSupported(
CodecCapabilities.FEATURE_SecurePlayback);
}
// If a secure decoder is not required, then make sure that
// FEATURE_SecurePlayback is not required.
return !caps.isFeatureRequired(CodecCapabilities.FEATURE_SecurePlayback);
}
} catch (IllegalArgumentException e) {
// Type is not supported.
}
}
// Unable to find a match for |mime|, so not supported.
return false;
}
// On older versions of Android attempt to create a decoder for the specified MIME type.
// TODO(liberato): Should we insist on software here? // TODO(liberato): Should we insist on software here?
CodecCreationInfo info = createDecoder(mime, isSecure ? CodecType.SECURE : CodecType.ANY); CodecCreationInfo info = createDecoder(mime, isSecure ? CodecType.SECURE : CodecType.ANY);
if (info == null || info.mediaCodec == null) return false; if (info == null || info.mediaCodec == null) return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment