libcamera: v4l2_controls: Store a ControlRange in V4L2ControlInfoMap

V4L2ControlRange only offers a convenience constructor for a
ControlRange. Store the ControlRange instead of V4L2ControlRange in
V4L2ControlInfoMap to make the map less dependent on V4L2 types.

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>
This commit is contained in:
Laurent Pinchart 2019-10-14 00:54:12 +03:00
parent 207d57c8b4
commit 1bfed95c1e
6 changed files with 27 additions and 29 deletions

View file

@ -342,7 +342,7 @@ int V4L2Device::ioctl(unsigned long request, void *argp)
*/
void V4L2Device::listControls()
{
std::map<const ControlId *, V4L2ControlRange> ctrls;
std::map<const ControlId *, ControlRange> ctrls;
struct v4l2_query_ext_ctrl ctrl = {};
/* \todo Add support for menu and compound controls. */
@ -380,9 +380,7 @@ void V4L2Device::listControls()
}
controlIds_.emplace_back(utils::make_unique<V4L2ControlId>(ctrl));
ctrls.emplace(std::piecewise_construct,
std::forward_as_tuple(controlIds_.back().get()),
std::forward_as_tuple(ctrl));
ctrls.emplace(controlIds_.back().get(), V4L2ControlRange(ctrl));
}
controls_ = std::move(ctrls);