[PATCH v1] libcamera: controls: Arrays of arrays are not supported

Barnabás Pőcze barnabas.pocze at ideasonboard.com
Tue Apr 22 14:44:01 CEST 2025


Arrays of arrays, even arrays of strings, are not supported by
the current `ControlValue` mechanism, so disable them for now
to trigger comptime errors if attempts are made to use them.

Signed-off-by: Barnabás Pőcze <barnabas.pocze at ideasonboard.com>
---
 include/libcamera/controls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 326452540..427517a02 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -121,7 +121,7 @@ struct control_type<Point> {
 };
 
 template<typename T, std::size_t N>
-struct control_type<Span<T, N>> : public control_type<std::remove_cv_t<T>> {
+struct control_type<Span<T, N>, std::enable_if_t<control_type<std::remove_cv_t<T>>::size == 0>> : public control_type<std::remove_cv_t<T>> {
 	static constexpr std::size_t size = N;
 };
 
-- 
2.49.0



More information about the libcamera-devel mailing list