Commit cbf3eb05 authored by liberato's avatar liberato Committed by Commit bot

Don't use AVDA for <360p VPx content.

Power measurements on a nexus 5 show that there's very little
difference below 360p between hardware and libvpx decoding.  This CL
switches to libvpx decoding for <360p, even if it could be hardware
accelerated by AVDA.

This saves a hardware codec instance, and avoids potential stability
issues with lots of MediaCodecs in use at once.

BUG=647259, 642948
TEST=manually checked 240p and 360p.

Review-Url: https://codereview.chromium.org/2334223009
Cr-Commit-Position: refs/heads/master@{#418964}
parent 26ce8fb7
...@@ -1571,7 +1571,9 @@ AndroidVideoDecodeAccelerator::GetCapabilities( ...@@ -1571,7 +1571,9 @@ AndroidVideoDecodeAccelerator::GetCapabilities(
MediaCodecUtil::IsVp8DecoderAvailable()) { MediaCodecUtil::IsVp8DecoderAvailable()) {
SupportedProfile profile; SupportedProfile profile;
profile.profile = VP8PROFILE_ANY; profile.profile = VP8PROFILE_ANY;
profile.min_resolution.SetSize(0, 0); // Since there is little to no power benefit below 360p, don't advertise
// support for it. Let libvpx decode it, and save a MediaCodec instance.
profile.min_resolution.SetSize(480, 360);
profile.max_resolution.SetSize(3840, 2160); profile.max_resolution.SetSize(3840, 2160);
// If we know MediaCodec will just create a software codec, prefer our // If we know MediaCodec will just create a software codec, prefer our
// internal software decoder instead. It's more up to date and secured // internal software decoder instead. It's more up to date and secured
...@@ -1585,7 +1587,8 @@ AndroidVideoDecodeAccelerator::GetCapabilities( ...@@ -1585,7 +1587,8 @@ AndroidVideoDecodeAccelerator::GetCapabilities(
if (MediaCodecUtil::IsVp9DecoderAvailable()) { if (MediaCodecUtil::IsVp9DecoderAvailable()) {
SupportedProfile profile; SupportedProfile profile;
profile.min_resolution.SetSize(0, 0); // Limit to 360p, like we do for vp8. See above.
profile.min_resolution.SetSize(480, 360);
profile.max_resolution.SetSize(3840, 2160); profile.max_resolution.SetSize(3840, 2160);
// If we know MediaCodec will just create a software codec, prefer our // If we know MediaCodec will just create a software codec, prefer our
// internal software decoder instead. It's more up to date and secured // internal software decoder instead. It's more up to date and secured
......
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