summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-06 09:43:07 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-13 20:37:24 +0300
commit33ee44dc16dc7e6fd15926d76a10545601a20613 (patch)
tree7d292401d4e6b7670961abc140927e6050c1d31f /include
parent5af6a1a0128b5776a1d66a55e7296c58aff72e97 (diff)
libcamera: control_ids: Generate map of all supported controls
In order to deserialise a ControlList, we will need to lookup ControlId instances based on their numerical ID. Generate a global map from the controls definitions to support such a lookup. 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>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/control_ids.h.in2
-rw-r--r--include/libcamera/controls.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in
index 1d0bc791..6ff0e418 100644
--- a/include/libcamera/control_ids.h.in
+++ b/include/libcamera/control_ids.h.in
@@ -24,6 +24,8 @@ ${ids}
${controls}
+extern const ControlIdMap controls;
+
} /* namespace controls */
} /* namespace libcamera */
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 90426753..d8acd800 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -111,6 +111,7 @@ private:
ControlValue max_;
};
+using ControlIdMap = std::unordered_map<unsigned int, const ControlId *>;
using ControlInfoMap = std::unordered_map<const ControlId *, ControlRange>;
class ControlList