From f9c28992a9f591124db24b44d94b88ff4ca294f8 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 11 Aug 2022 03:50:01 +0300 Subject: libcamera: controls: Construct Span with size for array controls The ControlList::set() function overload used for array controls constructs a Span from an initializer list. It doesn't specify the Span size explicitly, which results in a dynamic extent Span being constructed. That causes a compilation failure for fixed-size array controls, as they are defined as Control with T being a fixed-extent Span, and conversion from a dynamic-extent to fixed-extent Span when calling ControlValue::set() can't be implicit. Fix this by constructing the Span using the size of the control, which resolves to a fixed-extent and dynamic-extent Span for fixed-size and dynamic-size array controls respectively. The ControlList::set() function that takes an initializer list can then be used for fixed-size array controls. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain --- src/libcamera/controls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index bc3db4f6..6dbf9b34 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -970,7 +970,7 @@ bool ControlList::contains(unsigned int id) const */ /** - * \fn ControlList::set(const Control &ctrl, const std::initializer_list &value) + * \fn ControlList::set(const Control> &ctrl, const std::initializer_list &value) * \copydoc ControlList::set(const Control &ctrl, const V &value) */ -- cgit v1.2.1