ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
VIDIOC_TRY_EXT_CTRLS
&manvol;
VIDIOC_G_EXT_CTRLS
VIDIOC_S_EXT_CTRLS
VIDIOC_TRY_EXT_CTRLS
Get or set the value of several controls, try control
values
int ioctl
int fd
int request
struct v4l2_ext_controls
*argp
Arguments
fd
&fd;
request
VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS,
VIDIOC_TRY_EXT_CTRLS
argp
Description
These ioctls allow the caller to get or set multiple
controls atomically. Control IDs are grouped into control classes (see
) and all controls in the control array
must belong to the same control class.
Applications must always fill in the
count,
ctrl_class,
controls and
reserved fields of &v4l2-ext-controls;, and
initialize the &v4l2-ext-control; array pointed to by the
controls fields.
To get the current value of a set of controls applications
initialize the id field of each
&v4l2-ext-control; and call the
VIDIOC_G_EXT_CTRLS ioctl.
To change the value of a set of controls applications
initialize the id and
value fields of a &v4l2-ext-control; and
call the VIDIOC_S_EXT_CTRLS ioctl. The controls
will only be set if all control values are
valid.
To check if the a set of controls have correct values
applications initialize the id and
value fields of a &v4l2-ext-control; and
call the VIDIOC_TRY_EXT_CTRLS ioctl. It is up to
the driver whether wrong values are automatically adjusted to a valid
value or if an error is returned.
When the id or
ctrl_class is invalid drivers return an
&EINVAL;. When the value is out of bounds drivers can choose to take
the closest valid value or return an &ERANGE;, whatever seems more
appropriate. In the first case the new value is set in
&v4l2-ext-control;.
The driver will only set/get these controls if all control
values are correct. This prevents the situation where only some of the
controls were set/get. Only low-level errors (⪚ a failed i2c
command) can still cause this situation.
struct v4l2_ext_control
&cs-ustr;
__u32
id
Identifies the control, set by the
application.
__u32
reserved2[2]
Reserved for future extensions. Drivers and
applications must set the array to zero.
union
(anonymous)
__s32
value
New value or current value.
__s64
value64
New value or current value.
void *
reserved
Reserved for future pointer-type controls. Currently unused.
struct v4l2_ext_controls
&cs-str;
__u32
ctrl_class
The control class to which all controls belong, see
.
__u32
count
The number of controls in the controls array. May
also be zero.
__u32
error_idx
Set by the driver in case of an error. It is the
index of the control causing the error or equal to 'count' when the
error is not associated with a particular control. Undefined when the
ioctl returns 0 (success).
__u32
reserved[2]
Reserved for future extensions. Drivers and
applications must set the array to zero.
&v4l2-ext-control; *
controls
Pointer to an array of
count v4l2_ext_control structures. Ignored
if count equals zero.
Control classes
&cs-def;
V4L2_CTRL_CLASS_USER
0x980000
The class containing user controls. These controls
are described in . All controls that can be set
using the &VIDIOC-S-CTRL; and &VIDIOC-G-CTRL; ioctl belong to this
class.
V4L2_CTRL_CLASS_MPEG
0x990000
The class containing MPEG compression controls.
These controls are described in section .
&return-value;
EINVAL
The &v4l2-ext-control; id
is invalid or the &v4l2-ext-controls;
ctrl_class is invalid. This error code is
also returned by the VIDIOC_S_EXT_CTRLS and
VIDIOC_TRY_EXT_CTRLS ioctls if two or more
control values are in conflict.
ERANGE
The &v4l2-ext-control; value
is out of bounds.
EBUSY
The control is temporarily not changeable, possibly
because another applications took over control of the device function
this control belongs to.