libcamera: v4l2_controls: Add min and max to V4L2ControlInfo

Add min() and max() methods to V4L2ControlInfo to report the control's
minimum and maximum value respectively.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-06-30 15:22:27 +03:00
parent f137451817
commit bd0245a0dc
2 changed files with 20 additions and 0 deletions
+14
View File
@@ -74,6 +74,8 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)
type_ = ctrl.type;
name_ = static_cast<const char *>(ctrl.name);
size_ = ctrl.elem_size * ctrl.elems;
min_ = ctrl.minimum;
max_ = ctrl.maximum;
}
/**
@@ -100,6 +102,18 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)
* \return The V4L2 control user readable name
*/
/**
* \fn V4L2ControlInfo::min()
* \brief Retrieve the control minimum value
* \return The V4L2 control minimum value
*/
/**
* \fn V4L2ControlInfo::max()
* \brief Retrieve the control maximum value
* \return The V4L2 control maximum value
*/
/**
* \class V4L2Control
* \brief A V4L2 control value