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 |