[libcamera-devel] [PATCH 03/15] v4l2: v4l2_camera_proxy: Fix v4l2-compliance support for extended formats

Jacopo Mondi jacopo at jmondi.org
Wed Jun 17 14:43:45 CEST 2020


Hi Paul,

On Tue, Jun 16, 2020 at 10:12:32PM +0900, Paul Elder wrote:
> Fix the following v4l2-compliance error:
>
> fail: v4l2-compliance.cpp(652): !(caps & V4L2_CAP_EXT_PIX_FORMAT)
>
> Simply add V4L2_CAP_EXT_PIX_FORMAT to capabilities in querycap.

This is really a relic from the past, as the V4L2 sets this flag
unconditionally, but I don't see it used anywhere in mainline :/

>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>

However, let's please the compliance tool

Acked-by: Jacopo Mondi <jacopo at jmondi.org>

> ---
>  src/v4l2/v4l2_camera_proxy.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
> index 5b74b53..d899853 100644
> --- a/src/v4l2/v4l2_camera_proxy.cpp
> +++ b/src/v4l2/v4l2_camera_proxy.cpp
> @@ -202,7 +202,9 @@ void V4L2CameraProxy::querycap(std::shared_ptr<Camera> camera)
>  		       sizeof(capabilities_.bus_info));
>  	/* \todo Put this in a header/config somewhere. */
>  	capabilities_.version = KERNEL_VERSION(5, 2, 0);

Just noticed, this could be exposed by the CameraManager by quering
the pipeline handlers media devices, I presume this will soon be
required, as hardcoding the kernel version is not optimal :)

> -	capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> +	capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE
> +				  | V4L2_CAP_STREAMING
> +				  | V4L2_CAP_EXT_PIX_FORMAT;
>  	capabilities_.capabilities = capabilities_.device_caps
>  				   | V4L2_CAP_DEVICE_CAPS;
>  	memset(capabilities_.reserved, 0, sizeof(capabilities_.reserved));
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list