summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-13 23:34:29 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-15 22:33:29 +0300
commit6d2411fcb7483c7fee98824cafd1fabac3d75071 (patch)
tree07b38791f2786a70e452b0379d029b6570c4d378 /src/libcamera/pipeline
parentf24f77e7f506b6134e2636be27db7227c5052a26 (diff)
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>
Diffstat (limited to 'src/libcamera/pipeline')
-rw-r--r--src/libcamera/pipeline/uvcvideo.cpp2
-rw-r--r--src/libcamera/pipeline/vimc.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp
index 547ad5ca..4d76b5fd 100644
--- a/src/libcamera/pipeline/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo.cpp
@@ -340,7 +340,7 @@ int UVCCameraData::init(MediaEntity *entity)
const V4L2ControlInfo &info = ctrl.second;
const ControlId *id;
- switch (info.id().id()) {
+ switch (ctrl.first->id()) {
case V4L2_CID_BRIGHTNESS:
id = &controls::Brightness;
break;
diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp
index 53d00360..78c0fe5a 100644
--- a/src/libcamera/pipeline/vimc.cpp
+++ b/src/libcamera/pipeline/vimc.cpp
@@ -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;