libcamera: v4l2_controls: Index V4L2ControlInfoMap by ControlId *

To bring the libcamera and V4L2 control info maps closer, index the
latter by ControlId * like the former. As V4L2ControlInfoMap is widely
indexed by V4L2 numerical IDs, add accessors based on numerical IDs.

This allows complete removal of the ControId pointer from the
V4L2ControlInfo, as the ControId is accessible as the key when iterating
over the map. A handful of users have to be modified to adapt to the
change.

The controlInfo argument from V4L2Device::updateControls() can also be
removed as it itsn't used anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart
2019-10-13 23:34:29 +03:00
parent f24f77e7f5
commit 6d2411fcb7
6 changed files with 92 additions and 49 deletions
+1 -1
View File
@@ -416,7 +416,7 @@ int VimcCameraData::init(MediaDevice *media)
const V4L2ControlInfo &info = ctrl.second;
const ControlId *id;
switch (info.id().id()) {
switch (ctrl.first->id()) {
case V4L2_CID_BRIGHTNESS:
id = &controls::Brightness;
break;