From 35e6319b35729ea1671da8516502dd1ee4212082 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 13 Oct 2019 21:20:44 +0300 Subject: libcamera: v4l2_controls: Remove V4L2ControlInfo::size() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't support V4L2 compound controls, the size field is thus unused. Remove it to ease merging of the libcamera and V4L2 control info classes. Support for array controls can then be added later on top, and would be useful for libcamera controls too. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/libcamera/include/v4l2_controls.h | 4 ---- src/libcamera/v4l2_controls.cpp | 8 -------- src/libcamera/v4l2_device.cpp | 7 +++++++ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h index 89cc7448..133f5262 100644 --- a/src/libcamera/include/v4l2_controls.h +++ b/src/libcamera/include/v4l2_controls.h @@ -31,14 +31,10 @@ public: V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl); const ControlId &id() const { return id_; } - size_t size() const { return size_; } - const ControlRange &range() const { return range_; } private: V4L2ControlId id_; - size_t size_; - ControlRange range_; }; diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp index c45d3fda..dcf31b7a 100644 --- a/src/libcamera/v4l2_controls.cpp +++ b/src/libcamera/v4l2_controls.cpp @@ -127,8 +127,6 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl) V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl) : id_(ctrl) { - size_ = ctrl.elem_size * ctrl.elems; - if (ctrl.type == V4L2_CTRL_TYPE_INTEGER64) range_ = ControlRange(static_cast(ctrl.minimum), static_cast(ctrl.maximum)); @@ -143,12 +141,6 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl) * \return The V4L2 control ID */ -/** - * \fn V4L2ControlInfo::size() - * \brief Retrieve the control value data size (in bytes) - * \return The V4L2 control value data size - */ - /** * \fn V4L2ControlInfo::range() * \brief Retrieve the control value range diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 68f2d44d..54cc214e 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -362,6 +362,13 @@ void V4L2Device::listControls() ctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; + if (ctrl.elems != 1 || ctrl.nr_of_dims) { + LOG(V4L2, Debug) + << "Array control " << utils::hex(ctrl.id) + << " not supported"; + continue; + } + switch (ctrl.type) { case V4L2_CTRL_TYPE_INTEGER: case V4L2_CTRL_TYPE_BOOLEAN: -- cgit v1.2.1