libcamera: controls: Support accessing controls by numerical ID
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -42,7 +42,7 @@ protected:
|
||||
int run()
|
||||
{
|
||||
CameraControlValidator validator(camera_.get());
|
||||
ControlList list(&validator);
|
||||
ControlList list(controls::controls, &validator);
|
||||
|
||||
/* Test that the list is initially empty. */
|
||||
if (!list.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user