Chromium Code Reviews| Index: media/gpu/android_video_decode_accelerator.cc |
| diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc |
| index 233d70910822699a47056296371f22119b286be3..4b7d0020a884cbc19e64f3b31f00208e7ea46c76 100644 |
| --- a/media/gpu/android_video_decode_accelerator.cc |
| +++ b/media/gpu/android_video_decode_accelerator.cc |
| @@ -1573,6 +1573,8 @@ AndroidVideoDecodeAccelerator::GetCapabilities( |
| profile.profile = VP8PROFILE_ANY; |
| // 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. |
| + // Note that we allow it anyway for encrypted content, since we push a |
| + // separate profile for that. |
| profile.min_resolution.SetSize(480, 360); |
| profile.max_resolution.SetSize(3840, 2160); |
| // If we know MediaCodec will just create a software codec, prefer our |
| @@ -1583,28 +1585,37 @@ AndroidVideoDecodeAccelerator::GetCapabilities( |
| profile.encrypted_only = |
|
DaleCurtis
2016/09/15 22:20:11
Query outside loop?
liberato (no reviews please)
2016/09/15 22:30:26
what loop do you mean?
DaleCurtis
2016/09/15 22:33:10
https://www.youtube.com/watch?v=mjqysusiZBk
|
| VideoCodecBridge::IsKnownUnaccelerated(kCodecVP8, MEDIA_CODEC_DECODER); |
| profiles.push_back(profile); |
| + |
| + // Always allow encrypted content, even at low resolutions. |
| + profile.min_resolution.SetSize(0, 0); |
| + profile.encrypted_only = true; |
| + profiles.push_back(profile); |
| } |
| if (MediaCodecUtil::IsVp9DecoderAvailable()) { |
| - SupportedProfile profile; |
| - // Limit to 360p, like we do for vp8. See above. |
| - profile.min_resolution.SetSize(480, 360); |
| - profile.max_resolution.SetSize(3840, 2160); |
| - // If we know MediaCodec will just create a software codec, prefer our |
| - // internal software decoder instead. It's more up to date and secured |
| - // within the renderer sandbox. However if the content is encrypted, we |
| - // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| - // the buffers and let us use our internal software decoders. |
| - profile.encrypted_only = |
| - VideoCodecBridge::IsKnownUnaccelerated(kCodecVP9, MEDIA_CODEC_DECODER); |
| - profile.profile = VP9PROFILE_PROFILE0; |
| - profiles.push_back(profile); |
| - profile.profile = VP9PROFILE_PROFILE1; |
| - profiles.push_back(profile); |
| - profile.profile = VP9PROFILE_PROFILE2; |
| - profiles.push_back(profile); |
| - profile.profile = VP9PROFILE_PROFILE3; |
| - profiles.push_back(profile); |
| + const VideoCodecProfile profile_types[] = { |
| + VP9PROFILE_PROFILE0, VP9PROFILE_PROFILE1, VP9PROFILE_PROFILE2, |
| + VP9PROFILE_PROFILE3, VIDEO_CODEC_PROFILE_UNKNOWN}; |
| + for (int i = 0; profile_types[i] != VIDEO_CODEC_PROFILE_UNKNOWN; i++) { |
| + SupportedProfile profile; |
| + // Limit to 360p, like we do for vp8. See above. |
| + profile.min_resolution.SetSize(480, 360); |
| + profile.max_resolution.SetSize(3840, 2160); |
| + // If we know MediaCodec will just create a software codec, prefer our |
| + // internal software decoder instead. It's more up to date and secured |
| + // within the renderer sandbox. However if the content is encrypted, we |
| + // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| + // the buffers and let us use our internal software decoders. |
| + profile.encrypted_only = VideoCodecBridge::IsKnownUnaccelerated( |
|
DaleCurtis
2016/09/15 22:20:11
Ditto.
liberato (no reviews please)
2016/09/15 22:30:26
Done.
|
| + kCodecVP9, MEDIA_CODEC_DECODER); |
| + profile.profile = profile_types[i]; |
| + profiles.push_back(profile); |
| + |
| + // Always allow encrypted content. |
| + profile.min_resolution.SetSize(0, 0); |
| + profile.encrypted_only = true; |
| + profiles.push_back(profile); |
| + } |
| } |
| for (const auto& supported_profile : kSupportedH264Profiles) { |