Commit d71b1e59 authored by dalecurtis's avatar dalecurtis Committed by Commit bot

Disallow vp8 MediaCodec in MediaCodecUtil instead of AVDA.

Needs to be done in MediaCodecUtil otherwise the EME types won't
incorrectly reject encrypted vp8 support.

BUG=612909
TEST=none

Review-Url: https://codereview.chromium.org/2348683002
Cr-Commit-Position: refs/heads/master@{#419045}
parent 1eb7caa4
...@@ -239,6 +239,12 @@ class MediaCodecUtil { ...@@ -239,6 +239,12 @@ class MediaCodecUtil {
// *** DO NOT ADD ANY NEW CODECS WITHOUT UPDATING MIME_UTIL. *** // *** DO NOT ADD ANY NEW CODECS WITHOUT UPDATING MIME_UTIL. ***
// ************************************************************* // *************************************************************
if (mime.equals("video/x-vnd.on2.vp8")) { if (mime.equals("video/x-vnd.on2.vp8")) {
// Only support VP8 on Android versions where we don't have to synchronously
// tear down the MediaCodec on surface destruction because VP8 requires us to
// completely drain the decoder before releasing it, which is difficult and
// time consuming to do while the surface is being destroyed.
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) return false;
if (Build.MANUFACTURER.toLowerCase(Locale.getDefault()).equals("samsung")) { if (Build.MANUFACTURER.toLowerCase(Locale.getDefault()).equals("samsung")) {
// Some Samsung devices cannot render VP8 video directly to the surface. // Some Samsung devices cannot render VP8 video directly to the surface.
......
...@@ -1563,12 +1563,7 @@ AndroidVideoDecodeAccelerator::GetCapabilities( ...@@ -1563,12 +1563,7 @@ AndroidVideoDecodeAccelerator::GetCapabilities(
Capabilities capabilities; Capabilities capabilities;
SupportedProfiles& profiles = capabilities.supported_profiles; SupportedProfiles& profiles = capabilities.supported_profiles;
// Only support VP8 on Android versions where we don't have to synchronously if (MediaCodecUtil::IsVp8DecoderAvailable()) {
// tear down the MediaCodec on surface destruction because VP8 requires
// us to completely drain the decoder before releasing it, which is difficult
// and time consuming to do while the surface is being destroyed.
if (base::android::BuildInfo::GetInstance()->sdk_int() >= 18 &&
MediaCodecUtil::IsVp8DecoderAvailable()) {
SupportedProfile profile; SupportedProfile profile;
profile.profile = VP8PROFILE_ANY; profile.profile = VP8PROFILE_ANY;
// Since there is little to no power benefit below 360p, don't advertise // Since there is little to no power benefit below 360p, don't advertise
......
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