| 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 "media/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 media::VideoDecodeAccelerator::Capabilities | 1404 media::VideoDecodeAccelerator::Capabilities |
| 1405 AndroidVideoDecodeAccelerator::GetCapabilities( | 1405 AndroidVideoDecodeAccelerator::GetCapabilities( |
| 1406 const gpu::GpuPreferences& gpu_preferences) { | 1406 const gpu::GpuPreferences& gpu_preferences) { |
| 1407 Capabilities capabilities; | 1407 Capabilities capabilities; |
| 1408 SupportedProfiles& profiles = capabilities.supported_profiles; | 1408 SupportedProfiles& profiles = capabilities.supported_profiles; |
| 1409 | 1409 |
| 1410 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { | 1410 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { |
| 1411 SupportedProfile profile; | 1411 SupportedProfile profile; |
| 1412 profile.profile = media::VP8PROFILE_ANY; | 1412 profile.profile = media::VP8PROFILE_ANY; |
| 1413 profile.min_resolution.SetSize(0, 0); | 1413 profile.min_resolution.SetSize(0, 0); |
| 1414 profile.max_resolution.SetSize(1920, 1088); | 1414 profile.max_resolution.SetSize(3840, 2160); |
| 1415 // If we know MediaCodec will just create a software codec, prefer our | 1415 // If we know MediaCodec will just create a software codec, prefer our |
| 1416 // internal software decoder instead. It's more up to date and secured | 1416 // internal software decoder instead. It's more up to date and secured |
| 1417 // within the renderer sandbox. However if the content is encrypted, we | 1417 // within the renderer sandbox. However if the content is encrypted, we |
| 1418 // must use MediaCodec anyways since MediaDrm offers no way to decrypt | 1418 // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| 1419 // the buffers and let us use our internal software decoders. | 1419 // the buffers and let us use our internal software decoders. |
| 1420 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( | 1420 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( |
| 1421 media::kCodecVP8, media::MEDIA_CODEC_DECODER); | 1421 media::kCodecVP8, media::MEDIA_CODEC_DECODER); |
| 1422 profiles.push_back(profile); | 1422 profiles.push_back(profile); |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 if (media::MediaCodecUtil::IsVp9DecoderAvailable()) { | 1425 if (media::MediaCodecUtil::IsVp9DecoderAvailable()) { |
| 1426 SupportedProfile profile; | 1426 SupportedProfile profile; |
| 1427 profile.min_resolution.SetSize(0, 0); | 1427 profile.min_resolution.SetSize(0, 0); |
| 1428 profile.max_resolution.SetSize(1920, 1088); | 1428 profile.max_resolution.SetSize(3840, 2160); |
| 1429 // If we know MediaCodec will just create a software codec, prefer our | 1429 // If we know MediaCodec will just create a software codec, prefer our |
| 1430 // internal software decoder instead. It's more up to date and secured | 1430 // internal software decoder instead. It's more up to date and secured |
| 1431 // within the renderer sandbox. However if the content is encrypted, we | 1431 // within the renderer sandbox. However if the content is encrypted, we |
| 1432 // must use MediaCodec anyways since MediaDrm offers no way to decrypt | 1432 // must use MediaCodec anyways since MediaDrm offers no way to decrypt |
| 1433 // the buffers and let us use our internal software decoders. | 1433 // the buffers and let us use our internal software decoders. |
| 1434 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( | 1434 profile.encrypted_only = media::VideoCodecBridge::IsKnownUnaccelerated( |
| 1435 media::kCodecVP9, media::MEDIA_CODEC_DECODER); | 1435 media::kCodecVP9, media::MEDIA_CODEC_DECODER); |
| 1436 profile.profile = media::VP9PROFILE_PROFILE0; | 1436 profile.profile = media::VP9PROFILE_PROFILE0; |
| 1437 profiles.push_back(profile); | 1437 profiles.push_back(profile); |
| 1438 profile.profile = media::VP9PROFILE_PROFILE1; | 1438 profile.profile = media::VP9PROFILE_PROFILE1; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1462 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { | 1462 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { |
| 1463 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: | 1463 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: |
| 1464 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1464 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1465 } | 1465 } |
| 1466 } | 1466 } |
| 1467 | 1467 |
| 1468 return capabilities; | 1468 return capabilities; |
| 1469 } | 1469 } |
| 1470 | 1470 |
| 1471 } // namespace media | 1471 } // namespace media |
| OLD | NEW |