<div dir="ltr"><div dir="ltr">Hi Kieran,<div><br></div><div>Thank you for your patch.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 27 Oct 2021 at 13:07, Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The V4L2Capability has helpers to interogate the capabilities<br>
of a device.<br>
<br>
V4L2VideoDevice::enumPixelformats accesses the raw capabilites to check<br>
if the device is supported by a MediaController device.<br>
<br>
Provide a helper, and update the usage.<br>
<br>
Signed-off-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com" target="_blank">kieran.bingham@ideasonboard.com</a>></blockquote><div><br></div><div>Just what I needed :-)</div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
---<br>
This might also be used in the upcoming RPi MediaController series, but<br>
shouldn't block integration of that ...<br>
---<br>
include/libcamera/internal/v4l2_videodevice.h | 4 ++++<br>
src/libcamera/v4l2_videodevice.cpp | 2 +-<br>
2 files changed, 5 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h<br>
index efe34d47e72b..a1c458e45088 100644<br>
--- a/include/libcamera/internal/v4l2_videodevice.h<br>
+++ b/include/libcamera/internal/v4l2_videodevice.h<br>
@@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {<br>
{<br>
return device_caps() & V4L2_CAP_STREAMING;<br>
}<br>
+ bool hasMediaController() const<br>
+ {<br>
+ return device_caps() & V4L2_CAP_IO_MC;<br>
+ }<br>
};<br>
<br>
class V4L2BufferCache<br>
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp<br>
index 0cc622f91f2d..0fbf32bcfc00 100644<br>
--- a/src/libcamera/v4l2_videodevice.cpp<br>
+++ b/src/libcamera/v4l2_videodevice.cpp<br>
@@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat> V4L2VideoDevice::enumPixelformats(uint32_t code)<br>
std::vector<V4L2PixelFormat> formats;<br>
int ret;<br>
<br>
- if (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {<br>
+ if (code && !(caps_.hasMediaController())) {<br>
LOG(V4L2, Error)<br>
<< "Media bus code filtering not supported by the device";<br>
return {};<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div>