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

Unified Diff: content/common/gpu/media/v4l2_slice_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: Created 5 years, 9 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
Index: content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
index 3fcba612d8f3b9ae7473308306e371965c2effdf..43f3847abe3cbf6de59fe61a567c1470ed81e4bb 100644
--- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
@@ -2477,4 +2477,41 @@ bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() {
return true;
}
+// static
+std::vector<media::VideoDecodeAccelerator::SupportedProfile>
+V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() {
+ std::vector<SupportedProfile> profiles;
+ scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder);
+ if (!device)
+ return profiles;
+
+ SupportedProfile profile;
+ profile.min_resolution.SetSize(16, 16);
+ // NOTE: additional autodetection logic may require updating input buffer size
+ // selection.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode))
+ profile.max_resolution.SetSize(4096, 2160);
+ else
+ profile.max_resolution.SetSize(1920, 1088);
+
+ v4l2_fmtdesc fmtdesc;
+ memset(&fmtdesc, 0, sizeof(fmtdesc));
+ fmtdesc.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ for (; device->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0; ++fmtdesc.index) {
+ switch (fmtdesc.pixelformat) {
+ case V4L2_PIX_FMT_H264_SLICE:
+ profile.profile = media::H264PROFILE_MAIN;
+ profiles.push_back(profile);
+ break;
+ case V4L2_PIX_FMT_VP8_FRAME:
+ profile.profile = media::VP8PROFILE_ANY;
+ profiles.push_back(profile);
+ break;
+ }
+ }
+
+ return profiles;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698