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

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

Issue 1566533003: V4L2(S)VDA: Check if device handles profile for supported fourccs on init. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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_device.cc
diff --git a/content/common/gpu/media/v4l2_device.cc b/content/common/gpu/media/v4l2_device.cc
index b277f6b8c989802ff4d77845162492a0219313a0..fec869a371b8a34e9f021e6e8ba7f2f387703937 100644
--- a/content/common/gpu/media/v4l2_device.cc
+++ b/content/common/gpu/media/v4l2_device.cc
@@ -302,4 +302,23 @@ V4L2Device::GetSupportedDecodeProfiles(const size_t num_formats,
return profiles;
}
+bool V4L2Device::SupportsDecodeProfileForV4L2PixelFormats(
+ media::VideoCodecProfile profile,
+ const size_t num_formats,
+ const uint32_t pixelformats[]) {
+ // Get all supported profiles by this device, taking into account only fourccs
+ // in pixelformats.
+ const auto supported_profiles =
+ GetSupportedDecodeProfiles(num_formats, pixelformats);
+
+ // Try to find requested profile among the returned supported_profiles.
+ const auto iter = std::find_if(
+ supported_profiles.begin(), supported_profiles.end(),
+ [profile](const media::VideoDecodeAccelerator::SupportedProfile& p) {
+ return profile == p.profile;
+ });
+
+ return iter != supported_profiles.end();
+}
+
} // namespace content
« no previous file with comments | « content/common/gpu/media/v4l2_device.h ('k') | content/common/gpu/media/v4l2_slice_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698