18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci.. c:namespace:: V4L
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci.. _VIDIOC_G_STD:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci**************************************************************************
78c2ecf20Sopenharmony_ciioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
88c2ecf20Sopenharmony_ci**************************************************************************
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciName
118c2ecf20Sopenharmony_ci====
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciVIDIOC_G_STD - VIDIOC_S_STD - VIDIOC_SUBDEV_G_STD - VIDIOC_SUBDEV_S_STD - Query or select the video standard of the current input
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciSynopsis
168c2ecf20Sopenharmony_ci========
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_G_STD
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_G_STD, v4l2_std_id *argp)``
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_S_STD
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_S_STD, const v4l2_std_id *argp)``
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_SUBDEV_G_STD
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_SUBDEV_G_STD, v4l2_std_id *argp)``
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_SUBDEV_S_STD
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_SUBDEV_S_STD, const v4l2_std_id *argp)``
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciArguments
358c2ecf20Sopenharmony_ci=========
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci``fd``
388c2ecf20Sopenharmony_ci    File descriptor returned by :c:func:`open()`.
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci``argp``
418c2ecf20Sopenharmony_ci    Pointer to :c:type:`v4l2_std_id`.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciDescription
448c2ecf20Sopenharmony_ci===========
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciTo query and select the current video standard applications use the
478c2ecf20Sopenharmony_ci:ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctls which take a pointer to a
488c2ecf20Sopenharmony_ci:ref:`v4l2_std_id <v4l2-std-id>` type as argument. :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`
498c2ecf20Sopenharmony_cican return a single flag or a set of flags as in struct
508c2ecf20Sopenharmony_ci:c:type:`v4l2_standard` field ``id``. The flags must be
518c2ecf20Sopenharmony_ciunambiguous such that they appear in only one enumerated
528c2ecf20Sopenharmony_cistruct :c:type:`v4l2_standard` structure.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
558c2ecf20Sopenharmony_cidoes not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
568c2ecf20Sopenharmony_cino flags are given or the current input does not support the requested
578c2ecf20Sopenharmony_cistandard the driver returns an ``EINVAL`` error code. When the standard set
588c2ecf20Sopenharmony_ciis ambiguous drivers may return ``EINVAL`` or choose any of the requested
598c2ecf20Sopenharmony_cistandards. If the current input or output does not support standard
608c2ecf20Sopenharmony_civideo timings (e.g. if :ref:`VIDIOC_ENUMINPUT`
618c2ecf20Sopenharmony_cidoes not set the ``V4L2_IN_CAP_STD`` flag), then ``ENODATA`` error code is
628c2ecf20Sopenharmony_cireturned.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciCalling ``VIDIOC_SUBDEV_S_STD`` on a subdev device node that has been registered
658c2ecf20Sopenharmony_ciin read-only mode is not allowed. An error is returned and the errno variable is
668c2ecf20Sopenharmony_ciset to ``-EPERM``.
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciReturn Value
698c2ecf20Sopenharmony_ci============
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
728c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the
738c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciEINVAL
768c2ecf20Sopenharmony_ci    The :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` parameter was unsuitable.
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciENODATA
798c2ecf20Sopenharmony_ci    Standard video timings are not supported for this input or output.
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ciEPERM
828c2ecf20Sopenharmony_ci    ``VIDIOC_SUBDEV_S_STD`` has been called on a read-only subdevice.
83