From 33ee44dc16dc7e6fd15926d76a10545601a20613 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 6 Oct 2019 09:43:07 +0300 Subject: libcamera: control_ids: Generate map of all supported controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jacopo Mondi Tested-by: Niklas Söderlund Reviewed-by: Niklas Söderlund --- include/libcamera/control_ids.h.in | 2 ++ include/libcamera/controls.h | 1 + 2 files changed, 3 insertions(+) (limited to 'include') 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; using ControlInfoMap = std::unordered_map; class ControlList -- cgit v1.2.1