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

Jacopo Mondi jacopo at jmondi.org
Fri Feb 1 16:42:43 CET 2019


The single plane getFormat() function wrongly used the VIDIOC_S_FMT ioctl.
Fix that by using the more opportune VIDIOC_G_FMT one.

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);
-- 
2.20.1



More information about the libcamera-devel mailing list