Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1235)

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/vt_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
index dbaafdbf4965c732101f57449baab0d67c604448..72399c2cc89c7beb2de8fb7b0082a036f4ad59d8 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -33,6 +33,19 @@ using content_common_gpu_media::StubPathMap;
namespace content {
+// Only H.264 with 4:2:0 chroma sampling is supported.
+static const media::VideoCodecProfile kSupportedProfiles[] = {
+ media::H264PROFILE_BASELINE,
+ media::H264PROFILE_MAIN,
+ media::H264PROFILE_EXTENDED,
+ media::H264PROFILE_HIGH,
+ media::H264PROFILE_HIGH10PROFILE,
+ media::H264PROFILE_SCALABLEBASELINE,
+ media::H264PROFILE_SCALABLEHIGH,
+ media::H264PROFILE_STEREOHIGH,
+ media::H264PROFILE_MULTIVIEWHIGH,
+};
+
// Size to use for NALU length headers in AVC format (can be 1, 2, or 4).
static const int kNALUHeaderLength = 4;
@@ -289,13 +302,15 @@ bool VTVideoDecodeAccelerator::Initialize(
if (!InitializeVideoToolbox())
return false;
- // Only H.264 with 4:2:0 chroma sampling is supported.
- if (profile < media::H264PROFILE_MIN ||
- profile > media::H264PROFILE_MAX ||
- profile == media::H264PROFILE_HIGH422PROFILE ||
- profile == media::H264PROFILE_HIGH444PREDICTIVEPROFILE) {
- return false;
+ bool profile_supported = false;
+ for (const auto& supported_profile : kSupportedProfiles) {
+ if (profile == supported_profile) {
+ profile_supported = true;
+ break;
+ }
}
+ if (!profile_supported)
+ return false;
// Spawn a thread to handle parsing and calling VideoToolbox.
if (!decoder_thread_.Start())
@@ -1032,4 +1047,18 @@ bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() {
return false;
}
+// static
+media::VideoDecodeAccelerator::SupportedProfiles
+VTVideoDecodeAccelerator::GetSupportedProfiles() {
+ SupportedProfiles profiles;
+ for (const auto& supported_profile : kSupportedProfiles) {
+ SupportedProfile profile;
+ profile.profile = supported_profile;
+ profile.min_resolution.SetSize(480, 360);
+ profile.max_resolution.SetSize(4096, 2160);
+ profiles.push_back(profile);
+ }
+ return profiles;
+}
+
} // namespace content
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698