| 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 SupportedProfile profile; | 1117 SupportedProfile profile; |
| 1118 | 1118 |
| 1119 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { | 1119 if (media::MediaCodecUtil::IsVp8DecoderAvailable()) { |
| 1120 profile.profile = media::VP8PROFILE_ANY; | 1120 profile.profile = media::VP8PROFILE_ANY; |
| 1121 profile.min_resolution.SetSize(0, 0); | 1121 profile.min_resolution.SetSize(0, 0); |
| 1122 profile.max_resolution.SetSize(1920, 1088); | 1122 profile.max_resolution.SetSize(1920, 1088); |
| 1123 profiles.push_back(profile); | 1123 profiles.push_back(profile); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 if (media::PlatformHasVp9Support()) { | 1126 if (media::PlatformHasVp9Support()) { |
| 1127 profile.profile = media::VP9PROFILE_ANY; | |
| 1128 profile.min_resolution.SetSize(0, 0); | 1127 profile.min_resolution.SetSize(0, 0); |
| 1129 profile.max_resolution.SetSize(1920, 1088); | 1128 profile.max_resolution.SetSize(1920, 1088); |
| 1129 profile.profile = media::VP9PROFILE_PROFILE0; |
| 1130 profiles.push_back(profile); |
| 1131 profile.profile = media::VP9PROFILE_PROFILE1; |
| 1132 profiles.push_back(profile); |
| 1133 profile.profile = media::VP9PROFILE_PROFILE2; |
| 1134 profiles.push_back(profile); |
| 1135 profile.profile = media::VP9PROFILE_PROFILE3; |
| 1130 profiles.push_back(profile); | 1136 profiles.push_back(profile); |
| 1131 } | 1137 } |
| 1132 | 1138 |
| 1133 for (const auto& supported_profile : kSupportedH264Profiles) { | 1139 for (const auto& supported_profile : kSupportedH264Profiles) { |
| 1134 SupportedProfile profile; | 1140 SupportedProfile profile; |
| 1135 profile.profile = supported_profile; | 1141 profile.profile = supported_profile; |
| 1136 profile.min_resolution.SetSize(0, 0); | 1142 profile.min_resolution.SetSize(0, 0); |
| 1137 // Advertise support for 4k and let the MediaCodec fail when decoding if it | 1143 // Advertise support for 4k and let the MediaCodec fail when decoding if it |
| 1138 // doesn't support the resolution. It's assumed that consumers won't have | 1144 // doesn't support the resolution. It's assumed that consumers won't have |
| 1139 // software fallback for H264 on Android anyway. | 1145 // software fallback for H264 on Android anyway. |
| 1140 profile.max_resolution.SetSize(3840, 2160); | 1146 profile.max_resolution.SetSize(3840, 2160); |
| 1141 profiles.push_back(profile); | 1147 profiles.push_back(profile); |
| 1142 } | 1148 } |
| 1143 | 1149 |
| 1144 if (UseDeferredRenderingStrategy()) { | 1150 if (UseDeferredRenderingStrategy()) { |
| 1145 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: | 1151 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: |
| 1146 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | | 1152 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE | |
| 1147 media::VideoDecodeAccelerator::Capabilities:: | 1153 media::VideoDecodeAccelerator::Capabilities:: |
| 1148 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1154 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1149 } | 1155 } |
| 1150 | 1156 |
| 1151 return capabilities; | 1157 return capabilities; |
| 1152 } | 1158 } |
| 1153 | 1159 |
| 1154 } // namespace content | 1160 } // namespace content |
| OLD | NEW |