| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1398 media::VideoDecodeAccelerator::Capabilities | 1398 media::VideoDecodeAccelerator::Capabilities |
| 1399 AndroidVideoDecodeAccelerator::GetCapabilities( | 1399 AndroidVideoDecodeAccelerator::GetCapabilities( |
| 1400 const gpu::GpuPreferences& gpu_preferences) { | 1400 const gpu::GpuPreferences& gpu_preferences) { |
| 1401 Capabilities capabilities; | 1401 Capabilities capabilities; |
| 1402 SupportedProfiles& profiles = capabilities.supported_profiles; | 1402 SupportedProfiles& profiles = capabilities.supported_profiles; |
| 1403 | 1403 |
| 1404 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { | 1404 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { |
| 1405 SupportedProfile profile; | 1405 SupportedProfile profile; |
| 1406 profile.profile = media::VP8PROFILE_ANY; | 1406 profile.profile = media::VP8PROFILE_ANY; |
| 1407 profile.min_resolution.SetSize(0, 0); | 1407 profile.min_resolution.SetSize(0, 0); |
| 1408 profile.max_resolution.SetSize(1920, 1088); | 1408 profile.max_resolution.SetSize(3840, 2160); |
| 1409 // If we know MediaCodec will just create a software codec, prefer our | 1409 // If we know MediaCodec will just create a software codec, prefer our |
| 1410 // internal software decoder instead. It's more up to date and secured | 1410 // internal software decoder instead. It's more up to date and secured |
| 1411 // within the renderer sandbox. However if the content is encrypted, we | 1411 // within the renderer sandbox. However if the content is encrypted, we |
| 1412 // must use MediaCodec anyways since MediaDrm offers no way to decrypt | 1412 // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| 1413 // the buffers and let us use our internal software decoders. | 1413 // the buffers and let us use our internal software decoders. |
| 1414 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( | 1414 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( |
| 1415 media::kCodecVP8, media::MEDIA_CODEC_DECODER); | 1415 media::kCodecVP8, media::MEDIA_CODEC_DECODER); |
| 1416 profiles.push_back(profile); | 1416 profiles.push_back(profile); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 if (media::MediaCodecUtil::IsVp9DecoderAvailable()) { | 1419 if (media::MediaCodecUtil::IsVp9DecoderAvailable()) { |
| 1420 SupportedProfile profile; | 1420 SupportedProfile profile; |
| 1421 profile.min_resolution.SetSize(0, 0); | 1421 profile.min_resolution.SetSize(0, 0); |
| 1422 profile.max_resolution.SetSize(1920, 1088); | 1422 profile.max_resolution.SetSize(3840, 2160); |
| 1423 // If we know MediaCodec will just create a software codec, prefer our | 1423 // If we know MediaCodec will just create a software codec, prefer our |
| 1424 // internal software decoder instead. It's more up to date and secured | 1424 // internal software decoder instead. It's more up to date and secured |
| 1425 // within the renderer sandbox. However if the content is encrypted, we | 1425 // within the renderer sandbox. However if the content is encrypted, we |
| 1426 // must use MediaCodec anyways since MediaDrm offers no way to decrypt | 1426 // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| 1427 // the buffers and let us use our internal software decoders. | 1427 // the buffers and let us use our internal software decoders. |
| 1428 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( | 1428 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( |
| 1429 media::kCodecVP9, media::MEDIA_CODEC_DECODER); | 1429 media::kCodecVP9, media::MEDIA_CODEC_DECODER); |
| 1430 profile.profile = media::VP9PROFILE_PROFILE0; | 1430 profile.profile = media::VP9PROFILE_PROFILE0; |
| 1431 profiles.push_back(profile); | 1431 profiles.push_back(profile); |
| 1432 profile.profile = media::VP9PROFILE_PROFILE1; | 1432 profile.profile = media::VP9PROFILE_PROFILE1; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1456 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { | 1456 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { |
| 1457 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: | 1457 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: |
| 1458 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1458 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1459 } | 1459 } |
| 1460 } | 1460 } |
| 1461 | 1461 |
| 1462 return capabilities; | 1462 return capabilities; |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 } // namespace content | 1465 } // namespace content |
| OLD | NEW |