summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_controls.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-12 11:35:51 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-15 22:33:27 +0300
commit75e7452fc50b9b45f04500b1e1d2c358b937df9c (patch)
tree3bd31818b0869267dbee64800b19033c876d3a94 /src/libcamera/v4l2_controls.cpp
parent35e6319b35729ea1671da8516502dd1ee4212082 (diff)
libcamera: v4l2_controls: Move V4L2ControlId out of V4L2ControlInfo
In order to reconcile the libcamera and V4L2 control info maps, we need to move the V4L2ControlId embedded in V4L2ControlInfo map out of the class. Store the V4L2ControlId instances in the V4L2Device that creates them, and only reference them from V4L2ControlInfo. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> 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/v4l2_controls.cpp')
-rw-r--r--src/libcamera/v4l2_controls.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp
index dcf31b7a..12c4fb27 100644
--- a/src/libcamera/v4l2_controls.cpp
+++ b/src/libcamera/v4l2_controls.cpp
@@ -122,10 +122,12 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl)
/**
* \brief Construct a V4L2ControlInfo from a struct v4l2_query_ext_ctrl
+ * \param[in] id The V4L2 control ID
* \param[in] ctrl The struct v4l2_query_ext_ctrl as returned by the kernel
*/
-V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)
- : id_(ctrl)
+V4L2ControlInfo::V4L2ControlInfo(const V4L2ControlId &id,
+ const struct v4l2_query_ext_ctrl &ctrl)
+ : id_(&id)
{
if (ctrl.type == V4L2_CTRL_TYPE_INTEGER64)
range_ = ControlRange(static_cast<int64_t>(ctrl.minimum),