v4l2: camera_proxy: Fix try_fmt format conversion

The set pixelformat field of struct v4l2_pix_format structure was
wrongly converted to PixelFormat by calling v4l2ToDrm(), with an already
converted 'format' argument.

Fix this by calling the right drmToV4l2() conversion function.

Fixes: 0ce8f2390b ("v4l2: v4l2_compat: Add V4L2 compatibility layer")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2020-01-07 17:38:21 +01:00
parent eccbb17551
commit 769ca0a550

View file

@ -282,7 +282,7 @@ int V4L2CameraProxy::vidioc_try_fmt(struct v4l2_format *arg)
arg->fmt.pix.width = size.width; arg->fmt.pix.width = size.width;
arg->fmt.pix.height = size.height; arg->fmt.pix.height = size.height;
arg->fmt.pix.pixelformat = v4l2ToDrm(format); arg->fmt.pix.pixelformat = drmToV4L2(format);
arg->fmt.pix.field = V4L2_FIELD_NONE; arg->fmt.pix.field = V4L2_FIELD_NONE;
arg->fmt.pix.bytesperline = bplMultiplier(drmToV4L2(format)) * arg->fmt.pix.bytesperline = bplMultiplier(drmToV4L2(format)) *
arg->fmt.pix.width; arg->fmt.pix.width;