libcamera: request: Create control list with Camera info map

The control lists associated with a Request is created with the global
libcamera::controls::controls id map.

This is fine as the idmap/info map used to contruct a ControlList are not
used for any control validation purposes by the libcamera code.

However creating a ControlList with the camera ControlInfoMap has two
advantages:

1) The idmap can be extracted from the info map, but not the other way
   around
2) The control list is constructed with a valid map of info to the
   controls it can actually supports, instead of the global map of
   libcamera controls

Initialize the ControlList part of a Request with the Camera control
info map, as the association between a Request and a Camera is permanent
and valid for the whole lifetime of a Request.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
This commit is contained in:
Jacopo Mondi
2025-11-24 17:19:22 +01:00
parent 99e35cc9ec
commit a8b8485aca

View File

@@ -356,7 +356,7 @@ Request::Request(Camera *camera, uint64_t cookie)
: Extensible(std::make_unique<Private>(camera)),
cookie_(cookie), status_(RequestPending)
{
controls_ = new ControlList(controls::controls,
controls_ = new ControlList(camera->controls(),
camera->_d()->validator());
/**