From a1c6b2b6419cdf82c623355725efd48ff169a675 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 6 Oct 2019 09:54:16 +0300 Subject: libcamera: controls: Support accessing controls by numerical ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ControlList class has template get() and set() methods to get and set control values. The methods require a reference to a Control instance, which is only available when calling them with a hardcoded control. In order to support usage of ControlList for V4L2 controls, as well as serialisation and deserialisation of ControlList, we need a way to get and set control values based on a control numerical ID. Add new contains(), get() and set() overload methods to do so. As this change prepares the ControlList to be used for other objects than camera, update its documentation accordingly. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Tested-by: Niklas Söderlund Reviewed-by: Niklas Söderlund --- src/libcamera/request.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libcamera/request.cpp') diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index e800f144..c14ed1a4 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include "camera_controls.h" @@ -64,12 +65,12 @@ Request::Request(Camera *camera, uint64_t cookie) * creating a new instance for each request? */ validator_ = new CameraControlValidator(camera); - controls_ = new ControlList(validator_); + controls_ = new ControlList(controls::controls, validator_); /** * \todo: Add a validator for metadata controls. */ - metadata_ = new ControlList(); + metadata_ = new ControlList(controls::controls); } Request::~Request() -- cgit v1.2.1