xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/v4l/vidioc-g-std.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun.. c:namespace:: V4L
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun.. _VIDIOC_G_STD:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun**************************************************************************
7*4882a593Smuzhiyunioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
8*4882a593Smuzhiyun**************************************************************************
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunName
11*4882a593Smuzhiyun====
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunVIDIOC_G_STD - VIDIOC_S_STD - VIDIOC_SUBDEV_G_STD - VIDIOC_SUBDEV_S_STD - Query or select the video standard of the current input
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSynopsis
16*4882a593Smuzhiyun========
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun.. c:macro:: VIDIOC_G_STD
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_G_STD, v4l2_std_id *argp)``
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun.. c:macro:: VIDIOC_S_STD
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_S_STD, const v4l2_std_id *argp)``
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun.. c:macro:: VIDIOC_SUBDEV_G_STD
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_SUBDEV_G_STD, v4l2_std_id *argp)``
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun.. c:macro:: VIDIOC_SUBDEV_S_STD
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun``int ioctl(int fd, VIDIOC_SUBDEV_S_STD, const v4l2_std_id *argp)``
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunArguments
35*4882a593Smuzhiyun=========
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun``fd``
38*4882a593Smuzhiyun    File descriptor returned by :c:func:`open()`.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun``argp``
41*4882a593Smuzhiyun    Pointer to :c:type:`v4l2_std_id`.
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunDescription
44*4882a593Smuzhiyun===========
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunTo query and select the current video standard applications use the
47*4882a593Smuzhiyun:ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctls which take a pointer to a
48*4882a593Smuzhiyun:ref:`v4l2_std_id <v4l2-std-id>` type as argument. :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`
49*4882a593Smuzhiyuncan return a single flag or a set of flags as in struct
50*4882a593Smuzhiyun:c:type:`v4l2_standard` field ``id``. The flags must be
51*4882a593Smuzhiyununambiguous such that they appear in only one enumerated
52*4882a593Smuzhiyunstruct :c:type:`v4l2_standard` structure.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
55*4882a593Smuzhiyundoes not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
56*4882a593Smuzhiyunno flags are given or the current input does not support the requested
57*4882a593Smuzhiyunstandard the driver returns an ``EINVAL`` error code. When the standard set
58*4882a593Smuzhiyunis ambiguous drivers may return ``EINVAL`` or choose any of the requested
59*4882a593Smuzhiyunstandards. If the current input or output does not support standard
60*4882a593Smuzhiyunvideo timings (e.g. if :ref:`VIDIOC_ENUMINPUT`
61*4882a593Smuzhiyundoes not set the ``V4L2_IN_CAP_STD`` flag), then ``ENODATA`` error code is
62*4882a593Smuzhiyunreturned.
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunCalling ``VIDIOC_SUBDEV_S_STD`` on a subdev device node that has been registered
65*4882a593Smuzhiyunin read-only mode is not allowed. An error is returned and the errno variable is
66*4882a593Smuzhiyunset to ``-EPERM``.
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunReturn Value
69*4882a593Smuzhiyun============
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunOn success 0 is returned, on error -1 and the ``errno`` variable is set
72*4882a593Smuzhiyunappropriately. The generic error codes are described at the
73*4882a593Smuzhiyun:ref:`Generic Error Codes <gen-errors>` chapter.
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunEINVAL
76*4882a593Smuzhiyun    The :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` parameter was unsuitable.
77*4882a593Smuzhiyun
78*4882a593SmuzhiyunENODATA
79*4882a593Smuzhiyun    Standard video timings are not supported for this input or output.
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunEPERM
82*4882a593Smuzhiyun    ``VIDIOC_SUBDEV_S_STD`` has been called on a read-only subdevice.
83