[libcamera-devel] [PATCH 2/3] libcamera: v4l2_device: Add support for integer array controls

David Plowman david.plowman at raspberrypi.com
Thu Dec 23 09:01:09 CET 2021


Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
---
 src/libcamera/v4l2_device.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 62c91779..6f9de8ad 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -316,6 +316,18 @@ int V4L2Device::setControls(ControlList *ctrls)
 			break;
 		}
 
+		case ControlTypeInteger32: {
+			if (value.isArray()) {
+				Span<uint8_t> data = value.data();
+				v4l2Ctrl.p_u32 = reinterpret_cast<uint32_t *>(data.data());
+				v4l2Ctrl.size = data.size();
+			} else {
+				v4l2Ctrl.value = value.get<int32_t>();
+			}
+
+			break;
+		}
+
 		default:
 			/* \todo To be changed to support strings. */
 			v4l2Ctrl.value = value.get<int32_t>();
-- 
2.30.2



More information about the libcamera-devel mailing list