diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-03-04 23:45:59 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-23 16:45:29 +0200 |
commit | 55ead4647794072a4f4a866a65d18f8483c2998d (patch) | |
tree | 795030ecd8bdb8abbc58900d1e9e400db41bf926 | |
parent | 3786b6c84bbfa91864bfbd16fa8cad575e4247e7 (diff) |
libcamera: v4l2_controls: Support U8 array controls
Add support for array controls of type V4L2_CTRL_TYPE_U8.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/libcamera/v4l2_controls.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp index 4861f977..8e2415f2 100644 --- a/src/libcamera/v4l2_controls.cpp +++ b/src/libcamera/v4l2_controls.cpp @@ -60,6 +60,9 @@ std::string v4l2_ctrl_name(const struct v4l2_query_ext_ctrl &ctrl) ControlType v4l2_ctrl_type(const struct v4l2_query_ext_ctrl &ctrl) { switch (ctrl.type) { + case V4L2_CTRL_TYPE_U8: + return ControlTypeByte; + case V4L2_CTRL_TYPE_BOOLEAN: return ControlTypeBool; @@ -119,6 +122,12 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl) V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl) { switch (ctrl.type) { + case V4L2_CTRL_TYPE_U8: + ControlInfo::operator=(ControlInfo(static_cast<uint8_t>(ctrl.minimum), + static_cast<uint8_t>(ctrl.maximum), + static_cast<uint8_t>(ctrl.default_value))); + break; + case V4L2_CTRL_TYPE_BOOLEAN: ControlInfo::operator=(ControlInfo(static_cast<bool>(ctrl.minimum), static_cast<bool>(ctrl.maximum), |