1 .. -*- coding: utf-8; mode: rst -*-
12 VIDIOC_ENUMSTD - Enumerate supported video standards
18 .. c:function:: int ioctl( int fd, int request, struct v4l2_standard *argp )
25 File descriptor returned by :ref:`open() <func-open>`.
36 To query the attributes of a video standard, especially a custom (driver
37 defined) one, applications initialize the ``index`` field of struct
38 :ref:`v4l2_standard <v4l2-standard>` and call the :ref:`VIDIOC_ENUMSTD`
39 ioctl with a pointer to this structure. Drivers fill the rest of the
40 structure or return an ``EINVAL`` error code when the index is out of
41 bounds. To enumerate all standards applications shall begin at index
42 zero, incrementing by one until the driver returns ``EINVAL``. Drivers may
43 enumerate a different set of standards after switching the video input
49 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
51 .. flat-table:: struct v4l2_standard
63 - Number of the video standard, set by the application.
67 - :ref:`v4l2_std_id <v4l2-std-id>`
71 - The bits in this field identify the standard as one of the common
72 standards listed in :ref:`v4l2-std-id`, or if bits 32 to 63 are
73 set as custom standards. Multiple bits can be set if the hardware
74 does not distinguish between these standards, however separate
75 indices do not indicate the opposite. The ``id`` must be unique.
76 No other enumerated :ref:`struct v4l2_standard <v4l2-standard>` structure,
77 for this input or output anyway, can contain the same set of bits.
85 - Name of the standard, a NUL-terminated ASCII string, for example:
86 "PAL-B/G", "NTSC Japan". This information is intended for the
91 - struct :ref:`v4l2_fract <v4l2-fract>`
95 - The frame period (not field period) is numerator / denominator.
96 For example M/NTSC has a frame period of 1001 / 30000 seconds.
104 - Total lines per frame including blanking, e. g. 625 for B/PAL.
112 - Reserved for future extensions. Drivers must set the array to
119 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
121 .. flat-table:: struct v4l2_fract
144 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
148 .. flat-table:: typedef v4l2_std_id
160 - This type is a set, each bit representing another video standard
161 as listed below and in :ref:`video-standards`. The 32 most
162 significant bits are reserved for custom (driver defined) video
169 #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
170 #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
171 #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
172 #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
173 #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
174 #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
175 #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
176 #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
178 #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
179 #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
180 #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
181 #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
183 ``V4L2_STD_PAL_60`` is a hybrid standard with 525 lines, 60 Hz refresh
184 rate, and PAL color modulation with a 4.43 MHz color subcarrier. Some
185 PAL video recorders can play back NTSC tapes in this mode for display on
186 a 50/60 Hz agnostic PAL TV.
191 #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
192 #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
193 #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
195 ``V4L2_STD_NTSC_443`` is a hybrid standard with 525 lines, 60 Hz refresh
196 rate, and NTSC color modulation with a 4.43 MHz color subcarrier.
201 #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
203 #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
204 #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
205 #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
206 #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
207 #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
208 #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
209 #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
210 #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
213 #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
214 #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
216 ``V4L2_STD_ATSC_8_VSB`` and ``V4L2_STD_ATSC_16_VSB`` are U.S.
217 terrestrial digital TV standards. Presently the V4L2 API does not
218 support digital TV. See also the Linux DVB API at
219 `https://linuxtv.org <https://linuxtv.org>`__.
224 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |
227 #define V4L2_STD_B (V4L2_STD_PAL_B |
230 #define V4L2_STD_GH (V4L2_STD_PAL_G |
234 #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |
237 #define V4L2_STD_PAL (V4L2_STD_PAL_BG |
241 #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |
244 #define V4L2_STD_MN (V4L2_STD_PAL_M |
248 #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |
251 #define V4L2_STD_DK (V4L2_STD_PAL_DK |
254 #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |
261 #define V4L2_STD_525_60 (V4L2_STD_PAL_M |
265 #define V4L2_STD_625_50 (V4L2_STD_PAL |
270 #define V4L2_STD_UNKNOWN 0
271 #define V4L2_STD_ALL (V4L2_STD_525_60 |
276 \begin{adjustbox}{width=\columnwidth}
278 .. NTSC/M PAL/M /N /B /D /H /I SECAM/B /D /K1 /L
279 .. tabularcolumns:: |p{2.7cm}|p{2.6cm}|p{3.0cm}|p{3.2cm}|p{3.2cm}|p{2.2cm}|p{1.2cm}|p{3.2cm}|p{3.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|
283 .. flat-table:: Video Standards (based on :ref:`itu470`)
326 - :cspan:`1` 1001/30000
332 - Chrominance sub-carrier frequency (Hz)
342 - :cspan:`3` 4433618.75 ± 5
346 - :cspan:`2` f\ :sub:`OR` = 4406250 ± 2000,
348 f\ :sub:`OB` = 4250000 ± 2000
352 - Nominal radio-frequency channel bandwidth (MHz)
378 - Sound carrier relative to vision carrier (MHz)
386 - 5.5 ± 0.001 [#f4]_ [#f5]_ [#f6]_ [#f7]_
404 \end{adjustbox}\newline\newline
411 On success 0 is returned, on error -1 and the ``errno`` variable is set
412 appropriately. The generic error codes are described at the
413 :ref:`Generic Error Codes <gen-errors>` chapter.
416 The struct :ref:`v4l2_standard <v4l2-standard>` ``index`` is out
420 Standard video timings are not supported for this input or output.
423 The supported standards may overlap and we need an unambiguous set to
424 find the current standard returned by :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`.
427 Japan uses a standard similar to M/NTSC (V4L2_STD_NTSC_M_JP).
430 The values in brackets apply to the combination N/PAL a.k.a.
431 N\ :sub:`C` used in Argentina (V4L2_STD_PAL_Nc).
434 In the Federal Republic of Germany, Austria, Italy, the Netherlands,
435 Slovakia and Switzerland a system of two sound carriers is used, the
436 frequency of the second carrier being 242.1875 kHz above the
437 frequency of the first sound carrier. For stereophonic sound
438 transmissions a similar system is used in Australia.
441 New Zealand uses a sound carrier displaced 5.4996 ± 0.0005 MHz from
445 In Denmark, Finland, New Zealand, Sweden and Spain a system of two
446 sound carriers is used. In Iceland, Norway and Poland the same system
447 is being introduced. The second carrier is 5.85 MHz above the vision
448 carrier and is DQPSK modulated with 728 kbit/s sound and data
449 multiplex. (NICAM system)
452 In the United Kingdom, a system of two sound carriers is used. The
453 second sound carrier is 6.552 MHz above the vision carrier and is
454 DQPSK modulated with a 728 kbit/s sound and data multiplex able to
455 carry two sound channels. (NICAM system)
458 In France, a digital carrier 5.85 MHz away from the vision carrier
459 may be used in addition to the main sound carrier. It is modulated in
460 differentially encoded QPSK with a 728 kbit/s sound and data
461 multiplexer capable of carrying two sound channels. (NICAM system)