-rw-r--r--<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-scissors"><circle cx="6" cy="6" r="3"></circle><circle cx="6" cy="18" r="3"></circle><line x1="20" y1="4" x2="8.12" y2="15.88"></line><line x1="14.47" y1="14.48" x2="20" y2="20"></line><line x1="8.12" y1="8.12" x2="12" y2="12"></line></svg>
|
) const { return range_; }
private:
unsigned int id_;
@@ -39,8 +38,7 @@ private:
size_t size_;
std::string name_;
- int64_t min_;
- int64_t max_;
+ ControlRange range_;
};
using V4L2ControlInfoMap = std::map<unsigned int, V4L2ControlInfo>;
@@ -364,7 +364,7 @@ int UVCCameraData::init(MediaEntity *entity)
controlInfo_.emplace(std::piecewise_construct,
std::forward_as_tuple(id),
- std::forward_as_tuple(info.min(), info.max()));
+ std::forward_as_tuple(info.range()));
}
return 0;
@@ -437,7 +437,7 @@ int VimcCameraData::init(MediaDevice *media)
controlInfo_.emplace(std::piecewise_construct,
std::forward_as_tuple(id),
- std::forward_as_tuple(info.min(), info.max()));
+ std::forward_as_tuple(info.range()));
}
return 0;
@@ -74,8 +74,13 @@ 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;
+
+ if (ctrl.type == V4L2_CTRL_TYPE_INTEGER64)
+ range_ = ControlRange(static_cast<int64_t>(ctrl.minimum),
+ static_cast<int64_t>(ctrl.maximum));
+ else
+ range_ = ControlRange(static_cast<int32_t>(ctrl.minimum),
+ static_cast<int32_t>(ctrl.maximum));
}
/**
@@ -103,15 +108,9 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)
*/
/**
- * \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
+ * \fn V4L2ControlInfo::range()
+ * \brief Retrieve the control value range
+ * \return The V4L2 control value range
*/
/**