[libcamera-devel] [PATCH 2/7] libcamera: v4l2_device: Fix getFormatSingleplane ioclt

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Feb 1 23:10:21 CET 2019


On Fri, Feb 01, 2019 at 10:19:33PM +0100, Kieran Bingham wrote:
> On 01/02/2019 16:42, Jacopo Mondi wrote:
> > The single plane getFormat() function wrongly used the VIDIOC_S_FMT ioctl.
> > Fix that by using the more opportune VIDIOC_G_FMT one.
> I think this one deserves a fixes tag:
> 
> Fixes: ba8da0f2fcd0 ("libcamera: v4l2_device: Add methods to get/set
> format")
> 
> With s/ioclt/ioctl/ in the commit title:

I had the exact same comments :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com.
> 
> > Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> > ---
> >  src/libcamera/v4l2_device.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> > index 26b6ff3..5ba89b9 100644
> > --- a/src/libcamera/v4l2_device.cpp
> > +++ b/src/libcamera/v4l2_device.cpp
> > @@ -305,7 +305,7 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *fmt)
> >  	int ret;
> >  
> >  	v4l2Fmt.type = bufferType_;
> > -	ret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Fmt);
> > +	ret = ioctl(fd_, VIDIOC_G_FMT, &v4l2Fmt);
> >  	if (ret) {
> >  		ret = -errno;
> >  		LOG(Error) << "Unable to get format: " << strerror(-ret);

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list