libcamera: v4l2_controls: Add V4L2ControlId
Add a V4L2 specialisation of the ControlId class, in order to construct a ControlId from a v4l2_query_ext_ctrl. The V4L2ControlId is embedded in V4L2ControlInfo, and thus needs to be copyable to allow for V4L2ControlInfo to be passed to IPAs. The ControlId copy constructor and assignment operators are thus restored, but made protected to avoid the Control class being copyable. This is needed in order to use ControlList for V4L2 controls, as ControlList requires ControlId instances for all controls. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
764ff6fdf3
commit
c0dc218eb8
4 changed files with 72 additions and 18 deletions
|
@ -184,7 +184,7 @@ int V4L2Device::getControls(V4L2ControlList *ctrls)
|
|||
|
||||
const V4L2ControlInfo *info = &iter->second;
|
||||
controlInfo[i] = info;
|
||||
v4l2Ctrls[i].id = info->id();
|
||||
v4l2Ctrls[i].id = ctrl->id();
|
||||
}
|
||||
|
||||
struct v4l2_ext_controls v4l2ExtCtrls = {};
|
||||
|
@ -259,7 +259,7 @@ int V4L2Device::setControls(V4L2ControlList *ctrls)
|
|||
|
||||
const V4L2ControlInfo *info = &iter->second;
|
||||
controlInfo[i] = info;
|
||||
v4l2Ctrls[i].id = info->id();
|
||||
v4l2Ctrls[i].id = ctrl->id();
|
||||
|
||||
/* Set the v4l2_ext_control value for the write operation. */
|
||||
switch (info->type()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue