162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci.. c:namespace:: V4L
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci.. _VIDIOC_QUERYCTRL:
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci*******************************************************************
762306a36Sopenharmony_ciioctls VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL and VIDIOC_QUERYMENU
862306a36Sopenharmony_ci*******************************************************************
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciName
1162306a36Sopenharmony_ci====
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciVIDIOC_QUERYCTRL - VIDIOC_QUERY_EXT_CTRL - VIDIOC_QUERYMENU - Enumerate controls and menu control items
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciSynopsis
1662306a36Sopenharmony_ci========
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci``int ioctl(int fd, int VIDIOC_QUERYCTRL, struct v4l2_queryctrl *argp)``
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci.. c:macro:: VIDIOC_QUERY_EXT_CTRL
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_QUERY_EXT_CTRL, struct v4l2_query_ext_ctrl *argp)``
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci.. c:macro:: VIDIOC_QUERYMENU
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_QUERYMENU, struct v4l2_querymenu *argp)``
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciArguments
2962306a36Sopenharmony_ci=========
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci``fd``
3262306a36Sopenharmony_ci    File descriptor returned by :c:func:`open()`.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci``argp``
3562306a36Sopenharmony_ci    Pointer to struct :c:type:`v4l2_queryctrl`, :c:type:`v4l2_query_ext_ctrl`
3662306a36Sopenharmony_ci    or :c:type:`v4l2_querymenu` (depending on the ioctl).
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciDescription
3962306a36Sopenharmony_ci===========
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciTo query the attributes of a control applications set the ``id`` field
4262306a36Sopenharmony_ciof a struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` and call the
4362306a36Sopenharmony_ci``VIDIOC_QUERYCTRL`` ioctl with a pointer to this structure. The driver
4462306a36Sopenharmony_cifills the rest of the structure or returns an ``EINVAL`` error code when the
4562306a36Sopenharmony_ci``id`` is invalid.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciIt is possible to enumerate controls by calling ``VIDIOC_QUERYCTRL``
4862306a36Sopenharmony_ciwith successive ``id`` values starting from ``V4L2_CID_BASE`` up to and
4962306a36Sopenharmony_ciexclusive ``V4L2_CID_LASTP1``. Drivers may return ``EINVAL`` if a control in
5062306a36Sopenharmony_cithis range is not supported. Further applications can enumerate private
5162306a36Sopenharmony_cicontrols, which are not defined in this specification, by starting at
5262306a36Sopenharmony_ci``V4L2_CID_PRIVATE_BASE`` and incrementing ``id`` until the driver
5362306a36Sopenharmony_cireturns ``EINVAL``.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciIn both cases, when the driver sets the ``V4L2_CTRL_FLAG_DISABLED`` flag
5662306a36Sopenharmony_ciin the ``flags`` field this control is permanently disabled and should
5762306a36Sopenharmony_cibe ignored by the application. [#f1]_
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciWhen the application ORs ``id`` with ``V4L2_CTRL_FLAG_NEXT_CTRL`` the
6062306a36Sopenharmony_cidriver returns the next supported non-compound control, or ``EINVAL`` if
6162306a36Sopenharmony_cithere is none. In addition, the ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` flag
6262306a36Sopenharmony_cican be specified to enumerate all compound controls (i.e. controls with
6362306a36Sopenharmony_citype ≥ ``V4L2_CTRL_COMPOUND_TYPES`` and/or array control, in other words
6462306a36Sopenharmony_cicontrols that contain more than one value). Specify both
6562306a36Sopenharmony_ci``V4L2_CTRL_FLAG_NEXT_CTRL`` and ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` in
6662306a36Sopenharmony_ciorder to enumerate all controls, compound or not. Drivers which do not
6762306a36Sopenharmony_cisupport these flags yet always return ``EINVAL``.
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ciThe ``VIDIOC_QUERY_EXT_CTRL`` ioctl was introduced in order to better
7062306a36Sopenharmony_cisupport controls that can use compound types, and to expose additional
7162306a36Sopenharmony_cicontrol information that cannot be returned in struct
7262306a36Sopenharmony_ci:ref:`v4l2_queryctrl <v4l2-queryctrl>` since that structure is full.
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci``VIDIOC_QUERY_EXT_CTRL`` is used in the same way as
7562306a36Sopenharmony_ci``VIDIOC_QUERYCTRL``, except that the ``reserved`` array must be zeroed
7662306a36Sopenharmony_cias well.
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ciAdditional information is required for menu controls: the names of the
7962306a36Sopenharmony_cimenu items. To query them applications set the ``id`` and ``index``
8062306a36Sopenharmony_cifields of struct :ref:`v4l2_querymenu <v4l2-querymenu>` and call the
8162306a36Sopenharmony_ci``VIDIOC_QUERYMENU`` ioctl with a pointer to this structure. The driver
8262306a36Sopenharmony_cifills the rest of the structure or returns an ``EINVAL`` error code when the
8362306a36Sopenharmony_ci``id`` or ``index`` is invalid. Menu items are enumerated by calling
8462306a36Sopenharmony_ci``VIDIOC_QUERYMENU`` with successive ``index`` values from struct
8562306a36Sopenharmony_ci:ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``,
8662306a36Sopenharmony_ciinclusive.
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci.. note::
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci   It is possible for ``VIDIOC_QUERYMENU`` to return
9162306a36Sopenharmony_ci   an ``EINVAL`` error code for some indices between ``minimum`` and
9262306a36Sopenharmony_ci   ``maximum``. In that case that particular menu item is not supported by
9362306a36Sopenharmony_ci   this driver. Also note that the ``minimum`` value is not necessarily 0.
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ciSee also the examples in :ref:`control`.
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci.. tabularcolumns:: |p{1.2cm}|p{3.6cm}|p{12.5cm}|
9862306a36Sopenharmony_ci
9962306a36Sopenharmony_ci.. _v4l2-queryctrl:
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci.. cssclass:: longtable
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci.. flat-table:: struct v4l2_queryctrl
10462306a36Sopenharmony_ci    :header-rows:  0
10562306a36Sopenharmony_ci    :stub-columns: 0
10662306a36Sopenharmony_ci    :widths:       1 1 2
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci    * - __u32
10962306a36Sopenharmony_ci      - ``id``
11062306a36Sopenharmony_ci      - Identifies the control, set by the application. See
11162306a36Sopenharmony_ci	:ref:`control-id` for predefined IDs. When the ID is ORed with
11262306a36Sopenharmony_ci	V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and
11362306a36Sopenharmony_ci	returns the first control with a higher ID. Drivers which do not
11462306a36Sopenharmony_ci	support this flag yet always return an ``EINVAL`` error code.
11562306a36Sopenharmony_ci    * - __u32
11662306a36Sopenharmony_ci      - ``type``
11762306a36Sopenharmony_ci      - Type of control, see :c:type:`v4l2_ctrl_type`.
11862306a36Sopenharmony_ci    * - __u8
11962306a36Sopenharmony_ci      - ``name``\ [32]
12062306a36Sopenharmony_ci      - Name of the control, a NUL-terminated ASCII string. This
12162306a36Sopenharmony_ci	information is intended for the user.
12262306a36Sopenharmony_ci    * - __s32
12362306a36Sopenharmony_ci      - ``minimum``
12462306a36Sopenharmony_ci      - Minimum value, inclusive. This field gives a lower bound for the
12562306a36Sopenharmony_ci	control. See enum :c:type:`v4l2_ctrl_type` how
12662306a36Sopenharmony_ci	the minimum value is to be used for each possible control type.
12762306a36Sopenharmony_ci	Note that this a signed 32-bit value.
12862306a36Sopenharmony_ci    * - __s32
12962306a36Sopenharmony_ci      - ``maximum``
13062306a36Sopenharmony_ci      - Maximum value, inclusive. This field gives an upper bound for the
13162306a36Sopenharmony_ci	control. See enum :c:type:`v4l2_ctrl_type` how
13262306a36Sopenharmony_ci	the maximum value is to be used for each possible control type.
13362306a36Sopenharmony_ci	Note that this a signed 32-bit value.
13462306a36Sopenharmony_ci    * - __s32
13562306a36Sopenharmony_ci      - ``step``
13662306a36Sopenharmony_ci      - This field gives a step size for the control. See enum
13762306a36Sopenharmony_ci	:c:type:`v4l2_ctrl_type` how the step value is
13862306a36Sopenharmony_ci	to be used for each possible control type. Note that this an
13962306a36Sopenharmony_ci	unsigned 32-bit value.
14062306a36Sopenharmony_ci
14162306a36Sopenharmony_ci	Generally drivers should not scale hardware control values. It may
14262306a36Sopenharmony_ci	be necessary for example when the ``name`` or ``id`` imply a
14362306a36Sopenharmony_ci	particular unit and the hardware actually accepts only multiples
14462306a36Sopenharmony_ci	of said unit. If so, drivers must take care values are properly
14562306a36Sopenharmony_ci	rounded when scaling, such that errors will not accumulate on
14662306a36Sopenharmony_ci	repeated read-write cycles.
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci	This field gives the smallest change of an integer control
14962306a36Sopenharmony_ci	actually affecting hardware. Often the information is needed when
15062306a36Sopenharmony_ci	the user can change controls by keyboard or GUI buttons, rather
15162306a36Sopenharmony_ci	than a slider. When for example a hardware register accepts values
15262306a36Sopenharmony_ci	0-511 and the driver reports 0-65535, step should be 128.
15362306a36Sopenharmony_ci
15462306a36Sopenharmony_ci	Note that although signed, the step value is supposed to be always
15562306a36Sopenharmony_ci	positive.
15662306a36Sopenharmony_ci    * - __s32
15762306a36Sopenharmony_ci      - ``default_value``
15862306a36Sopenharmony_ci      - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_BOOLEAN``,
15962306a36Sopenharmony_ci	``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid
16062306a36Sopenharmony_ci	for other types of controls.
16162306a36Sopenharmony_ci
16262306a36Sopenharmony_ci	.. note::
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci	   Drivers reset controls to their default value only when
16562306a36Sopenharmony_ci	   the driver is first loaded, never afterwards.
16662306a36Sopenharmony_ci    * - __u32
16762306a36Sopenharmony_ci      - ``flags``
16862306a36Sopenharmony_ci      - Control flags, see :ref:`control-flags`.
16962306a36Sopenharmony_ci    * - __u32
17062306a36Sopenharmony_ci      - ``reserved``\ [2]
17162306a36Sopenharmony_ci      - Reserved for future extensions. Drivers must set the array to
17262306a36Sopenharmony_ci	zero.
17362306a36Sopenharmony_ci
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_ci.. tabularcolumns:: |p{1.2cm}|p{5.5cm}|p{10.6cm}|
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci.. _v4l2-query-ext-ctrl:
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci.. cssclass:: longtable
18062306a36Sopenharmony_ci
18162306a36Sopenharmony_ci.. flat-table:: struct v4l2_query_ext_ctrl
18262306a36Sopenharmony_ci    :header-rows:  0
18362306a36Sopenharmony_ci    :stub-columns: 0
18462306a36Sopenharmony_ci    :widths:       1 1 2
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci    * - __u32
18762306a36Sopenharmony_ci      - ``id``
18862306a36Sopenharmony_ci      - Identifies the control, set by the application. See
18962306a36Sopenharmony_ci	:ref:`control-id` for predefined IDs. When the ID is ORed with
19062306a36Sopenharmony_ci	``V4L2_CTRL_FLAG_NEXT_CTRL`` the driver clears the flag and
19162306a36Sopenharmony_ci	returns the first non-compound control with a higher ID. When the
19262306a36Sopenharmony_ci	ID is ORed with ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` the driver clears
19362306a36Sopenharmony_ci	the flag and returns the first compound control with a higher ID.
19462306a36Sopenharmony_ci	Set both to get the first control (compound or not) with a higher
19562306a36Sopenharmony_ci	ID.
19662306a36Sopenharmony_ci    * - __u32
19762306a36Sopenharmony_ci      - ``type``
19862306a36Sopenharmony_ci      - Type of control, see :c:type:`v4l2_ctrl_type`.
19962306a36Sopenharmony_ci    * - char
20062306a36Sopenharmony_ci      - ``name``\ [32]
20162306a36Sopenharmony_ci      - Name of the control, a NUL-terminated ASCII string. This
20262306a36Sopenharmony_ci	information is intended for the user.
20362306a36Sopenharmony_ci    * - __s64
20462306a36Sopenharmony_ci      - ``minimum``
20562306a36Sopenharmony_ci      - Minimum value, inclusive. This field gives a lower bound for the
20662306a36Sopenharmony_ci	control. See enum :c:type:`v4l2_ctrl_type` how
20762306a36Sopenharmony_ci	the minimum value is to be used for each possible control type.
20862306a36Sopenharmony_ci	Note that this a signed 64-bit value.
20962306a36Sopenharmony_ci    * - __s64
21062306a36Sopenharmony_ci      - ``maximum``
21162306a36Sopenharmony_ci      - Maximum value, inclusive. This field gives an upper bound for the
21262306a36Sopenharmony_ci	control. See enum :c:type:`v4l2_ctrl_type` how
21362306a36Sopenharmony_ci	the maximum value is to be used for each possible control type.
21462306a36Sopenharmony_ci	Note that this a signed 64-bit value.
21562306a36Sopenharmony_ci    * - __u64
21662306a36Sopenharmony_ci      - ``step``
21762306a36Sopenharmony_ci      - This field gives a step size for the control. See enum
21862306a36Sopenharmony_ci	:c:type:`v4l2_ctrl_type` how the step value is
21962306a36Sopenharmony_ci	to be used for each possible control type. Note that this an
22062306a36Sopenharmony_ci	unsigned 64-bit value.
22162306a36Sopenharmony_ci
22262306a36Sopenharmony_ci	Generally drivers should not scale hardware control values. It may
22362306a36Sopenharmony_ci	be necessary for example when the ``name`` or ``id`` imply a
22462306a36Sopenharmony_ci	particular unit and the hardware actually accepts only multiples
22562306a36Sopenharmony_ci	of said unit. If so, drivers must take care values are properly
22662306a36Sopenharmony_ci	rounded when scaling, such that errors will not accumulate on
22762306a36Sopenharmony_ci	repeated read-write cycles.
22862306a36Sopenharmony_ci
22962306a36Sopenharmony_ci	This field gives the smallest change of an integer control
23062306a36Sopenharmony_ci	actually affecting hardware. Often the information is needed when
23162306a36Sopenharmony_ci	the user can change controls by keyboard or GUI buttons, rather
23262306a36Sopenharmony_ci	than a slider. When for example a hardware register accepts values
23362306a36Sopenharmony_ci	0-511 and the driver reports 0-65535, step should be 128.
23462306a36Sopenharmony_ci    * - __s64
23562306a36Sopenharmony_ci      - ``default_value``
23662306a36Sopenharmony_ci      - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_INTEGER64``,
23762306a36Sopenharmony_ci	``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8``
23862306a36Sopenharmony_ci	or ``_U16`` control. Not valid for other types of controls.
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci	.. note::
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_ci	   Drivers reset controls to their default value only when
24362306a36Sopenharmony_ci	   the driver is first loaded, never afterwards.
24462306a36Sopenharmony_ci    * - __u32
24562306a36Sopenharmony_ci      - ``flags``
24662306a36Sopenharmony_ci      - Control flags, see :ref:`control-flags`.
24762306a36Sopenharmony_ci    * - __u32
24862306a36Sopenharmony_ci      - ``elem_size``
24962306a36Sopenharmony_ci      - The size in bytes of a single element of the array. Given a char
25062306a36Sopenharmony_ci	pointer ``p`` to a 3-dimensional array you can find the position
25162306a36Sopenharmony_ci	of cell ``(z, y, x)`` as follows:
25262306a36Sopenharmony_ci	``p + ((z * dims[1] + y) * dims[0] + x) * elem_size``.
25362306a36Sopenharmony_ci	``elem_size`` is always valid, also when the control isn't an
25462306a36Sopenharmony_ci	array. For string controls ``elem_size`` is equal to
25562306a36Sopenharmony_ci	``maximum + 1``.
25662306a36Sopenharmony_ci    * - __u32
25762306a36Sopenharmony_ci      - ``elems``
25862306a36Sopenharmony_ci      - The number of elements in the N-dimensional array. If this control
25962306a36Sopenharmony_ci	is not an array, then ``elems`` is 1. The ``elems`` field can
26062306a36Sopenharmony_ci	never be 0.
26162306a36Sopenharmony_ci    * - __u32
26262306a36Sopenharmony_ci      - ``nr_of_dims``
26362306a36Sopenharmony_ci      - The number of dimension in the N-dimensional array. If this
26462306a36Sopenharmony_ci	control is not an array, then this field is 0.
26562306a36Sopenharmony_ci    * - __u32
26662306a36Sopenharmony_ci      - ``dims[V4L2_CTRL_MAX_DIMS]``
26762306a36Sopenharmony_ci      - The size of each dimension. The first ``nr_of_dims`` elements of
26862306a36Sopenharmony_ci	this array must be non-zero, all remaining elements must be zero.
26962306a36Sopenharmony_ci    * - __u32
27062306a36Sopenharmony_ci      - ``reserved``\ [32]
27162306a36Sopenharmony_ci      - Reserved for future extensions. Applications and drivers must set
27262306a36Sopenharmony_ci	the array to zero.
27362306a36Sopenharmony_ci
27462306a36Sopenharmony_ci
27562306a36Sopenharmony_ci.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.1cm}|
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ci.. _v4l2-querymenu:
27862306a36Sopenharmony_ci
27962306a36Sopenharmony_ci.. flat-table:: struct v4l2_querymenu
28062306a36Sopenharmony_ci    :header-rows:  0
28162306a36Sopenharmony_ci    :stub-columns: 0
28262306a36Sopenharmony_ci    :widths:       1 1 2
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_ci    * - __u32
28562306a36Sopenharmony_ci      - ``id``
28662306a36Sopenharmony_ci      - Identifies the control, set by the application from the respective
28762306a36Sopenharmony_ci	struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id``.
28862306a36Sopenharmony_ci    * - __u32
28962306a36Sopenharmony_ci      - ``index``
29062306a36Sopenharmony_ci      - Index of the menu item, starting at zero, set by the application.
29162306a36Sopenharmony_ci    * - union {
29262306a36Sopenharmony_ci      - (anonymous)
29362306a36Sopenharmony_ci    * - __u8
29462306a36Sopenharmony_ci      - ``name``\ [32]
29562306a36Sopenharmony_ci      - Name of the menu item, a NUL-terminated ASCII string. This
29662306a36Sopenharmony_ci	information is intended for the user. This field is valid for
29762306a36Sopenharmony_ci	``V4L2_CTRL_TYPE_MENU`` type controls.
29862306a36Sopenharmony_ci    * - __s64
29962306a36Sopenharmony_ci      - ``value``
30062306a36Sopenharmony_ci      - Value of the integer menu item. This field is valid for
30162306a36Sopenharmony_ci	``V4L2_CTRL_TYPE_INTEGER_MENU`` type controls.
30262306a36Sopenharmony_ci    * - }
30362306a36Sopenharmony_ci      -
30462306a36Sopenharmony_ci    * - __u32
30562306a36Sopenharmony_ci      - ``reserved``
30662306a36Sopenharmony_ci      - Reserved for future extensions. Drivers must set the array to
30762306a36Sopenharmony_ci	zero.
30862306a36Sopenharmony_ci
30962306a36Sopenharmony_ci.. c:type:: v4l2_ctrl_type
31062306a36Sopenharmony_ci
31162306a36Sopenharmony_ci.. raw:: latex
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_ci   \footnotesize
31462306a36Sopenharmony_ci
31562306a36Sopenharmony_ci.. tabularcolumns:: |p{6.5cm}|p{1.5cm}|p{1.1cm}|p{1.5cm}|p{6.8cm}|
31662306a36Sopenharmony_ci
31762306a36Sopenharmony_ci.. cssclass:: longtable
31862306a36Sopenharmony_ci
31962306a36Sopenharmony_ci.. flat-table:: enum v4l2_ctrl_type
32062306a36Sopenharmony_ci    :header-rows:  1
32162306a36Sopenharmony_ci    :stub-columns: 0
32262306a36Sopenharmony_ci    :widths:       30 5 5 5 55
32362306a36Sopenharmony_ci
32462306a36Sopenharmony_ci    * - Type
32562306a36Sopenharmony_ci      - ``minimum``
32662306a36Sopenharmony_ci      - ``step``
32762306a36Sopenharmony_ci      - ``maximum``
32862306a36Sopenharmony_ci      - Description
32962306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_INTEGER``
33062306a36Sopenharmony_ci      - any
33162306a36Sopenharmony_ci      - any
33262306a36Sopenharmony_ci      - any
33362306a36Sopenharmony_ci      - An integer-valued control ranging from minimum to maximum
33462306a36Sopenharmony_ci	inclusive. The step value indicates the increment between values.
33562306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_BOOLEAN``
33662306a36Sopenharmony_ci      - 0
33762306a36Sopenharmony_ci      - 1
33862306a36Sopenharmony_ci      - 1
33962306a36Sopenharmony_ci      - A boolean-valued control. Zero corresponds to "disabled", and one
34062306a36Sopenharmony_ci	means "enabled".
34162306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_MENU``
34262306a36Sopenharmony_ci      - ≥ 0
34362306a36Sopenharmony_ci      - 1
34462306a36Sopenharmony_ci      - N-1
34562306a36Sopenharmony_ci      - The control has a menu of N choices. The names of the menu items
34662306a36Sopenharmony_ci	can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl.
34762306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_INTEGER_MENU``
34862306a36Sopenharmony_ci      - ≥ 0
34962306a36Sopenharmony_ci      - 1
35062306a36Sopenharmony_ci      - N-1
35162306a36Sopenharmony_ci      - The control has a menu of N choices. The values of the menu items
35262306a36Sopenharmony_ci	can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl. This is
35362306a36Sopenharmony_ci	similar to ``V4L2_CTRL_TYPE_MENU`` except that instead of strings,
35462306a36Sopenharmony_ci	the menu items are signed 64-bit integers.
35562306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_BITMASK``
35662306a36Sopenharmony_ci      - 0
35762306a36Sopenharmony_ci      - n/a
35862306a36Sopenharmony_ci      - any
35962306a36Sopenharmony_ci      - A bitmask field. The maximum value is the set of bits that can be
36062306a36Sopenharmony_ci	used, all other bits are to be 0. The maximum value is interpreted
36162306a36Sopenharmony_ci	as a __u32, allowing the use of bit 31 in the bitmask.
36262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_BUTTON``
36362306a36Sopenharmony_ci      - 0
36462306a36Sopenharmony_ci      - 0
36562306a36Sopenharmony_ci      - 0
36662306a36Sopenharmony_ci      - A control which performs an action when set. Drivers must ignore
36762306a36Sopenharmony_ci	the value passed with ``VIDIOC_S_CTRL`` and return an ``EACCES`` error
36862306a36Sopenharmony_ci	code on a ``VIDIOC_G_CTRL`` attempt.
36962306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_INTEGER64``
37062306a36Sopenharmony_ci      - any
37162306a36Sopenharmony_ci      - any
37262306a36Sopenharmony_ci      - any
37362306a36Sopenharmony_ci      - A 64-bit integer valued control. Minimum, maximum and step size
37462306a36Sopenharmony_ci	cannot be queried using ``VIDIOC_QUERYCTRL``. Only
37562306a36Sopenharmony_ci	``VIDIOC_QUERY_EXT_CTRL`` can retrieve the 64-bit min/max/step
37662306a36Sopenharmony_ci	values, they should be interpreted as n/a when using
37762306a36Sopenharmony_ci	``VIDIOC_QUERYCTRL``.
37862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_STRING``
37962306a36Sopenharmony_ci      - ≥ 0
38062306a36Sopenharmony_ci      - ≥ 1
38162306a36Sopenharmony_ci      - ≥ 0
38262306a36Sopenharmony_ci      - The minimum and maximum string lengths. The step size means that
38362306a36Sopenharmony_ci	the string must be (minimum + N * step) characters long for N ≥ 0.
38462306a36Sopenharmony_ci	These lengths do not include the terminating zero, so in order to
38562306a36Sopenharmony_ci	pass a string of length 8 to
38662306a36Sopenharmony_ci	:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you need to
38762306a36Sopenharmony_ci	set the ``size`` field of struct
38862306a36Sopenharmony_ci	:c:type:`v4l2_ext_control` to 9. For
38962306a36Sopenharmony_ci	:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you can set
39062306a36Sopenharmony_ci	the ``size`` field to ``maximum`` + 1. Which character encoding is
39162306a36Sopenharmony_ci	used will depend on the string control itself and should be part
39262306a36Sopenharmony_ci	of the control documentation.
39362306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_CTRL_CLASS``
39462306a36Sopenharmony_ci      - n/a
39562306a36Sopenharmony_ci      - n/a
39662306a36Sopenharmony_ci      - n/a
39762306a36Sopenharmony_ci      - This is not a control. When ``VIDIOC_QUERYCTRL`` is called with a
39862306a36Sopenharmony_ci	control ID equal to a control class code (see :ref:`ctrl-class`)
39962306a36Sopenharmony_ci	+ 1, the ioctl returns the name of the control class and this
40062306a36Sopenharmony_ci	control type. Older drivers which do not support this feature
40162306a36Sopenharmony_ci	return an ``EINVAL`` error code.
40262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_U8``
40362306a36Sopenharmony_ci      - any
40462306a36Sopenharmony_ci      - any
40562306a36Sopenharmony_ci      - any
40662306a36Sopenharmony_ci      - An unsigned 8-bit valued control ranging from minimum to maximum
40762306a36Sopenharmony_ci	inclusive. The step value indicates the increment between values.
40862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_U16``
40962306a36Sopenharmony_ci      - any
41062306a36Sopenharmony_ci      - any
41162306a36Sopenharmony_ci      - any
41262306a36Sopenharmony_ci      - An unsigned 16-bit valued control ranging from minimum to maximum
41362306a36Sopenharmony_ci	inclusive. The step value indicates the increment between values.
41462306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_U32``
41562306a36Sopenharmony_ci      - any
41662306a36Sopenharmony_ci      - any
41762306a36Sopenharmony_ci      - any
41862306a36Sopenharmony_ci      - An unsigned 32-bit valued control ranging from minimum to maximum
41962306a36Sopenharmony_ci	inclusive. The step value indicates the increment between values.
42062306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_MPEG2_QUANTISATION``
42162306a36Sopenharmony_ci      - n/a
42262306a36Sopenharmony_ci      - n/a
42362306a36Sopenharmony_ci      - n/a
42462306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_mpeg2_quantisation`, containing MPEG-2
42562306a36Sopenharmony_ci	quantisation matrices for stateless video decoders.
42662306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_MPEG2_SEQUENCE``
42762306a36Sopenharmony_ci      - n/a
42862306a36Sopenharmony_ci      - n/a
42962306a36Sopenharmony_ci      - n/a
43062306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_mpeg2_sequence`, containing MPEG-2
43162306a36Sopenharmony_ci	sequence parameters for stateless video decoders.
43262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_MPEG2_PICTURE``
43362306a36Sopenharmony_ci      - n/a
43462306a36Sopenharmony_ci      - n/a
43562306a36Sopenharmony_ci      - n/a
43662306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_mpeg2_picture`, containing MPEG-2
43762306a36Sopenharmony_ci	picture parameters for stateless video decoders.
43862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_AREA``
43962306a36Sopenharmony_ci      - n/a
44062306a36Sopenharmony_ci      - n/a
44162306a36Sopenharmony_ci      - n/a
44262306a36Sopenharmony_ci      - A struct :c:type:`v4l2_area`, containing the width and the height
44362306a36Sopenharmony_ci        of a rectangular area. Units depend on the use case.
44462306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_H264_SPS``
44562306a36Sopenharmony_ci      - n/a
44662306a36Sopenharmony_ci      - n/a
44762306a36Sopenharmony_ci      - n/a
44862306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_h264_sps`, containing H264
44962306a36Sopenharmony_ci	sequence parameters for stateless video decoders.
45062306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_H264_PPS``
45162306a36Sopenharmony_ci      - n/a
45262306a36Sopenharmony_ci      - n/a
45362306a36Sopenharmony_ci      - n/a
45462306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_h264_pps`, containing H264
45562306a36Sopenharmony_ci	picture parameters for stateless video decoders.
45662306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``
45762306a36Sopenharmony_ci      - n/a
45862306a36Sopenharmony_ci      - n/a
45962306a36Sopenharmony_ci      - n/a
46062306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_h264_scaling_matrix`, containing H264
46162306a36Sopenharmony_ci	scaling matrices for stateless video decoders.
46262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``
46362306a36Sopenharmony_ci      - n/a
46462306a36Sopenharmony_ci      - n/a
46562306a36Sopenharmony_ci      - n/a
46662306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_h264_slice_params`, containing H264
46762306a36Sopenharmony_ci	slice parameters for stateless video decoders.
46862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``
46962306a36Sopenharmony_ci      - n/a
47062306a36Sopenharmony_ci      - n/a
47162306a36Sopenharmony_ci      - n/a
47262306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_h264_decode_params`, containing H264
47362306a36Sopenharmony_ci	decode parameters for stateless video decoders.
47462306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_FWHT_PARAMS``
47562306a36Sopenharmony_ci      - n/a
47662306a36Sopenharmony_ci      - n/a
47762306a36Sopenharmony_ci      - n/a
47862306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_fwht_params`, containing FWHT
47962306a36Sopenharmony_ci	parameters for stateless video decoders.
48062306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_HEVC_SPS``
48162306a36Sopenharmony_ci      - n/a
48262306a36Sopenharmony_ci      - n/a
48362306a36Sopenharmony_ci      - n/a
48462306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_hevc_sps`, containing HEVC Sequence
48562306a36Sopenharmony_ci	Parameter Set for stateless video decoders.
48662306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_HEVC_PPS``
48762306a36Sopenharmony_ci      - n/a
48862306a36Sopenharmony_ci      - n/a
48962306a36Sopenharmony_ci      - n/a
49062306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_hevc_pps`, containing HEVC Picture
49162306a36Sopenharmony_ci	Parameter Set for stateless video decoders.
49262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS``
49362306a36Sopenharmony_ci      - n/a
49462306a36Sopenharmony_ci      - n/a
49562306a36Sopenharmony_ci      - n/a
49662306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_hevc_slice_params`, containing HEVC
49762306a36Sopenharmony_ci	slice parameters for stateless video decoders.
49862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX``
49962306a36Sopenharmony_ci      - n/a
50062306a36Sopenharmony_ci      - n/a
50162306a36Sopenharmony_ci      - n/a
50262306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_hevc_scaling_matrix`, containing HEVC
50362306a36Sopenharmony_ci	scaling matrix for stateless video decoders.
50462306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_VP8_FRAME``
50562306a36Sopenharmony_ci      - n/a
50662306a36Sopenharmony_ci      - n/a
50762306a36Sopenharmony_ci      - n/a
50862306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_vp8_frame`, containing VP8
50962306a36Sopenharmony_ci	frame parameters for stateless video decoders.
51062306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS``
51162306a36Sopenharmony_ci      - n/a
51262306a36Sopenharmony_ci      - n/a
51362306a36Sopenharmony_ci      - n/a
51462306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_hevc_decode_params`, containing HEVC
51562306a36Sopenharmony_ci	decoding parameters for stateless video decoders.
51662306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR``
51762306a36Sopenharmony_ci      - n/a
51862306a36Sopenharmony_ci      - n/a
51962306a36Sopenharmony_ci      - n/a
52062306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_vp9_compressed_hdr`, containing VP9
52162306a36Sopenharmony_ci	probabilities updates for stateless video decoders.
52262306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_VP9_FRAME``
52362306a36Sopenharmony_ci      - n/a
52462306a36Sopenharmony_ci      - n/a
52562306a36Sopenharmony_ci      - n/a
52662306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_vp9_frame`, containing VP9
52762306a36Sopenharmony_ci	frame decode parameters for stateless video decoders.
52862306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_AV1_SEQUENCE``
52962306a36Sopenharmony_ci      - n/a
53062306a36Sopenharmony_ci      - n/a
53162306a36Sopenharmony_ci      - n/a
53262306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_av1_sequence`, containing AV1 Sequence OBU
53362306a36Sopenharmony_ci	decoding parameters for stateless video decoders.
53462306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_AV1_TILE_GROUP_ENTRY``
53562306a36Sopenharmony_ci      - n/a
53662306a36Sopenharmony_ci      - n/a
53762306a36Sopenharmony_ci      - n/a
53862306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_av1_tile_group_entry`, containing AV1 Tile Group
53962306a36Sopenharmony_ci	OBU decoding parameters for stateless video decoders.
54062306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_AV1_FRAME``
54162306a36Sopenharmony_ci      - n/a
54262306a36Sopenharmony_ci      - n/a
54362306a36Sopenharmony_ci      - n/a
54462306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_av1_frame`, containing AV1 Frame/Frame
54562306a36Sopenharmony_ci	Header OBU decoding parameters for stateless video decoders.
54662306a36Sopenharmony_ci    * - ``V4L2_CTRL_TYPE_AV1_FILM_GRAIN``
54762306a36Sopenharmony_ci      - n/a
54862306a36Sopenharmony_ci      - n/a
54962306a36Sopenharmony_ci      - n/a
55062306a36Sopenharmony_ci      - A struct :c:type:`v4l2_ctrl_av1_film_grain`, containing AV1 Film Grain
55162306a36Sopenharmony_ci        parameters for stateless video decoders.
55262306a36Sopenharmony_ci
55362306a36Sopenharmony_ci.. raw:: latex
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_ci   \normalsize
55662306a36Sopenharmony_ci
55762306a36Sopenharmony_ci.. tabularcolumns:: |p{7.3cm}|p{1.8cm}|p{8.2cm}|
55862306a36Sopenharmony_ci
55962306a36Sopenharmony_ci.. cssclass:: longtable
56062306a36Sopenharmony_ci
56162306a36Sopenharmony_ci.. _control-flags:
56262306a36Sopenharmony_ci
56362306a36Sopenharmony_ci.. flat-table:: Control Flags
56462306a36Sopenharmony_ci    :header-rows:  0
56562306a36Sopenharmony_ci    :stub-columns: 0
56662306a36Sopenharmony_ci    :widths:       3 1 4
56762306a36Sopenharmony_ci
56862306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_DISABLED``
56962306a36Sopenharmony_ci      - 0x0001
57062306a36Sopenharmony_ci      - This control is permanently disabled and should be ignored by the
57162306a36Sopenharmony_ci	application. Any attempt to change the control will result in an
57262306a36Sopenharmony_ci	``EINVAL`` error code.
57362306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_GRABBED``
57462306a36Sopenharmony_ci      - 0x0002
57562306a36Sopenharmony_ci      - This control is temporarily unchangeable, for example because
57662306a36Sopenharmony_ci	another application took over control of the respective resource.
57762306a36Sopenharmony_ci	Such controls may be displayed specially in a user interface.
57862306a36Sopenharmony_ci	Attempts to change the control may result in an ``EBUSY`` error code.
57962306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_READ_ONLY``
58062306a36Sopenharmony_ci      - 0x0004
58162306a36Sopenharmony_ci      - This control is permanently readable only. Any attempt to change
58262306a36Sopenharmony_ci	the control will result in an ``EINVAL`` error code.
58362306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_UPDATE``
58462306a36Sopenharmony_ci      - 0x0008
58562306a36Sopenharmony_ci      - A hint that changing this control may affect the value of other
58662306a36Sopenharmony_ci	controls within the same control class. Applications should update
58762306a36Sopenharmony_ci	their user interface accordingly.
58862306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_INACTIVE``
58962306a36Sopenharmony_ci      - 0x0010
59062306a36Sopenharmony_ci      - This control is not applicable to the current configuration and
59162306a36Sopenharmony_ci	should be displayed accordingly in a user interface. For example
59262306a36Sopenharmony_ci	the flag may be set on a MPEG audio level 2 bitrate control when
59362306a36Sopenharmony_ci	MPEG audio encoding level 1 was selected with another control.
59462306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_SLIDER``
59562306a36Sopenharmony_ci      - 0x0020
59662306a36Sopenharmony_ci      - A hint that this control is best represented as a slider-like
59762306a36Sopenharmony_ci	element in a user interface.
59862306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_WRITE_ONLY``
59962306a36Sopenharmony_ci      - 0x0040
60062306a36Sopenharmony_ci      - This control is permanently writable only. Any attempt to read the
60162306a36Sopenharmony_ci	control will result in an ``EACCES`` error code error code. This flag
60262306a36Sopenharmony_ci	is typically present for relative controls or action controls
60362306a36Sopenharmony_ci	where writing a value will cause the device to carry out a given
60462306a36Sopenharmony_ci	action (e. g. motor control) but no meaningful value can be
60562306a36Sopenharmony_ci	returned.
60662306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_VOLATILE``
60762306a36Sopenharmony_ci      - 0x0080
60862306a36Sopenharmony_ci      - This control is volatile, which means that the value of the
60962306a36Sopenharmony_ci	control changes continuously. A typical example would be the
61062306a36Sopenharmony_ci	current gain value if the device is in auto-gain mode. In such a
61162306a36Sopenharmony_ci	case the hardware calculates the gain value based on the lighting
61262306a36Sopenharmony_ci	conditions which can change over time.
61362306a36Sopenharmony_ci
61462306a36Sopenharmony_ci	.. note::
61562306a36Sopenharmony_ci
61662306a36Sopenharmony_ci	   Setting a new value for a volatile control will be ignored
61762306a36Sopenharmony_ci	   unless
61862306a36Sopenharmony_ci	   :ref:`V4L2_CTRL_FLAG_EXECUTE_ON_WRITE <FLAG_EXECUTE_ON_WRITE>`
61962306a36Sopenharmony_ci	   is also set.
62062306a36Sopenharmony_ci	   Setting a new value for a volatile control will *never* trigger a
62162306a36Sopenharmony_ci	   :ref:`V4L2_EVENT_CTRL_CH_VALUE <ctrl-changes-flags>` event.
62262306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_HAS_PAYLOAD``
62362306a36Sopenharmony_ci      - 0x0100
62462306a36Sopenharmony_ci      - This control has a pointer type, so its value has to be accessed
62562306a36Sopenharmony_ci	using one of the pointer fields of struct
62662306a36Sopenharmony_ci	:c:type:`v4l2_ext_control`. This flag is set
62762306a36Sopenharmony_ci	for controls that are an array, string, or have a compound type.
62862306a36Sopenharmony_ci	In all cases you have to set a pointer to memory containing the
62962306a36Sopenharmony_ci	payload of the control.
63062306a36Sopenharmony_ci    * .. _FLAG_EXECUTE_ON_WRITE:
63162306a36Sopenharmony_ci
63262306a36Sopenharmony_ci      - ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE``
63362306a36Sopenharmony_ci      - 0x0200
63462306a36Sopenharmony_ci      - The value provided to the control will be propagated to the driver
63562306a36Sopenharmony_ci	even if it remains constant. This is required when the control
63662306a36Sopenharmony_ci	represents an action on the hardware. For example: clearing an
63762306a36Sopenharmony_ci	error flag or triggering the flash. All the controls of the type
63862306a36Sopenharmony_ci	``V4L2_CTRL_TYPE_BUTTON`` have this flag set.
63962306a36Sopenharmony_ci    * .. _FLAG_MODIFY_LAYOUT:
64062306a36Sopenharmony_ci
64162306a36Sopenharmony_ci      - ``V4L2_CTRL_FLAG_MODIFY_LAYOUT``
64262306a36Sopenharmony_ci      - 0x0400
64362306a36Sopenharmony_ci      - Changing this control value may modify the layout of the
64462306a36Sopenharmony_ci        buffer (for video devices) or the media bus format (for sub-devices).
64562306a36Sopenharmony_ci
64662306a36Sopenharmony_ci	A typical example would be the ``V4L2_CID_ROTATE`` control.
64762306a36Sopenharmony_ci
64862306a36Sopenharmony_ci	Note that typically controls with this flag will also set the
64962306a36Sopenharmony_ci	``V4L2_CTRL_FLAG_GRABBED`` flag when buffers are allocated or
65062306a36Sopenharmony_ci	streaming is in progress since most drivers do not support changing
65162306a36Sopenharmony_ci	the format in that case.
65262306a36Sopenharmony_ci    * - ``V4L2_CTRL_FLAG_DYNAMIC_ARRAY``
65362306a36Sopenharmony_ci      - 0x0800
65462306a36Sopenharmony_ci      - This control is a dynamically sized 1-dimensional array. It
65562306a36Sopenharmony_ci        behaves the same as a regular array, except that the number
65662306a36Sopenharmony_ci	of elements as reported by the ``elems`` field is between 1 and
65762306a36Sopenharmony_ci	``dims[0]``. So setting the control with a differently sized
65862306a36Sopenharmony_ci	array will change the ``elems`` field when the control is
65962306a36Sopenharmony_ci	queried afterwards.
66062306a36Sopenharmony_ci
66162306a36Sopenharmony_ciReturn Value
66262306a36Sopenharmony_ci============
66362306a36Sopenharmony_ci
66462306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
66562306a36Sopenharmony_ciappropriately. The generic error codes are described at the
66662306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
66762306a36Sopenharmony_ci
66862306a36Sopenharmony_ciEINVAL
66962306a36Sopenharmony_ci    The struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id`` is
67062306a36Sopenharmony_ci    invalid. The struct :ref:`v4l2_querymenu <v4l2-querymenu>` ``id``
67162306a36Sopenharmony_ci    is invalid or ``index`` is out of range (less than ``minimum`` or
67262306a36Sopenharmony_ci    greater than ``maximum``) or this particular menu item is not
67362306a36Sopenharmony_ci    supported by the driver.
67462306a36Sopenharmony_ci
67562306a36Sopenharmony_ciEACCES
67662306a36Sopenharmony_ci    An attempt was made to read a write-only control.
67762306a36Sopenharmony_ci
67862306a36Sopenharmony_ci.. [#f1]
67962306a36Sopenharmony_ci   ``V4L2_CTRL_FLAG_DISABLED`` was intended for two purposes: Drivers
68062306a36Sopenharmony_ci   can skip predefined controls not supported by the hardware (although
68162306a36Sopenharmony_ci   returning ``EINVAL`` would do as well), or disable predefined and private
68262306a36Sopenharmony_ci   controls after hardware detection without the trouble of reordering
68362306a36Sopenharmony_ci   control arrays and indices (``EINVAL`` cannot be used to skip private
68462306a36Sopenharmony_ci   controls because it would prematurely end the enumeration).
685