[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Return correct format for metadata

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Apr 17 10:31:34 CEST 2020


Hi Laurent,

On 16/04/2020 23:05, Laurent Pinchart wrote:
> When setting format on a metadata video device, the returned format
> isn't updated with the actual set format due to a typo. Fix it.

Did you hit this? Or identify it from the coverity scan?

This is Coverity ID: 279098, if it's worth adding that to the commit
message.

> Fixes: 629e9301c518 ("libcamera: v4l2_device: Add META support in g/s_fmt")
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> ---
>  src/libcamera/v4l2_videodevice.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
> index 439a9c90dbf7..a959cfe65c43 100644
> --- a/src/libcamera/v4l2_videodevice.cpp
> +++ b/src/libcamera/v4l2_videodevice.cpp
> @@ -848,7 +848,7 @@ int V4L2VideoDevice::setFormatMeta(V4L2DeviceFormat *format)
>  	 */
>  	format->size.width = 0;
>  	format->size.height = 0;
> -	format->fourcc = format->fourcc;
> +	format->fourcc = V4L2PixelFormat(pix->dataformat);
>  	format->planesCount = 1;
>  	format->planes[0].bpl = pix->buffersize;
>  	format->planes[0].size = pix->buffersize;

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list