1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_ENUMSTD</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference"><link rel="prev" href="vidioc-enumoutput.html" title="ioctl VIDIOC_ENUMOUTPUT"><link rel="next" href="vidioc-expbuf.html" title="ioctl VIDIOC_EXPBUF"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_ENUMSTD</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-enumoutput.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="vidioc-expbuf.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-enumstd"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_ENUMSTD &#8212; Enumerate supported video standards</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct v4l2_standard *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1113406756"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_ENUMSTD</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1113410844"></a><h2>Description</h2><p>To query the attributes of a video standard,
2especially a custom (driver defined) one, applications initialize the
3<em class="structfield"><code>index</code></em> field of struct&#160;<a class="link" href="vidioc-enumstd.html#v4l2-standard" title="Table&#160;A.46.&#160;struct v4l2_standard">v4l2_standard</a> and call the
4<code class="constant">VIDIOC_ENUMSTD</code> ioctl with a pointer to this
5structure. Drivers fill the rest of the structure or return an
6<span class="errorcode">EINVAL</span> error code when the index is out of bounds. To enumerate all standards
7applications shall begin  at index zero, incrementing by one until the
8driver returns <span class="errorcode">EINVAL</span>. Drivers may enumerate a
9different set of standards after switching the video input or
10output.<a href="#ftn.idp1113413324" class="footnote" name="idp1113413324"><sup class="footnote">[18]</sup></a></p><div class="table"><a name="v4l2-standard"></a><p class="title"><b>Table&#160;A.46.&#160;struct <span class="structname">v4l2_standard</span></b></p><div class="table-contents"><table summary="struct v4l2_standard" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>index</code></em></td><td valign="top">Number of the video standard, set by the
11application.</td></tr><tr><td valign="top"><a class="link" href="vidioc-enumstd.html#v4l2-std-id" title="Table&#160;A.48.&#160;typedef v4l2_std_id">v4l2_std_id</a></td><td valign="top"><em class="structfield"><code>id</code></em></td><td valign="top">The bits in this field identify the standard as
12one of the common standards listed in <a class="xref" href="vidioc-enumstd.html#v4l2-std-id" title="Table&#160;A.48.&#160;typedef v4l2_std_id">Table&#160;A.48, &#8220;typedef <span class="structname">v4l2_std_id</span>&#8221;</a>,
13or if bits 32 to 63 are set as custom standards. Multiple bits can be
14set if the hardware does not distinguish between these standards,
15however separate indices do not indicate the opposite. The
16<em class="structfield"><code>id</code></em> must be unique. No other enumerated
17<span class="structname">v4l2_standard</span> structure, for this input or
18output anyway, can contain the same set of bits.</td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>name</code></em>[24]</td><td valign="top">Name of the standard, a NUL-terminated ASCII
19string, for example: "PAL-B/G", "NTSC Japan". This information is
20intended for the user.</td></tr><tr><td valign="top">struct&#160;<a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table&#160;A.47.&#160;struct v4l2_fract">v4l2_fract</a></td><td valign="top"><em class="structfield"><code>frameperiod</code></em></td><td valign="top">The frame period (not field period) is numerator
21/ denominator. For example M/NTSC has a frame period of 1001 /
2230000 seconds.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>framelines</code></em></td><td valign="top">Total lines per frame including blanking,
23e.&#160;g. 625 for B/PAL.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[4]</td><td valign="top">Reserved for future extensions. Drivers must set
24the array to zero.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-fract"></a><p class="title"><b>Table&#160;A.47.&#160;struct <span class="structname">v4l2_fract</span></b></p><div class="table-contents"><table summary="struct v4l2_fract" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>numerator</code></em></td><td valign="top">&#160;</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>denominator</code></em></td><td valign="top">&#160;</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-std-id"></a><p class="title"><b>Table&#160;A.48.&#160;typedef <span class="structname">v4l2_std_id</span></b></p><div class="table-contents"><table summary="typedef v4l2_std_id" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u64</td><td valign="top"><em class="structfield"><code>v4l2_std_id</code></em></td><td valign="top">This type is a set, each bit representing another
25video standard as listed below and in <a class="xref" href="vidioc-enumstd.html#video-standards" title="Table&#160;A.49.&#160;Video Standards (based on [[ITU&#160;BT.470]])">Table&#160;A.49, &#8220;Video Standards (based on [[<abbr class="abbrev">ITU&#160;BT.470</abbr>]])&#8221;</a>. The 32 most significant bits are reserved
26for custom (driver defined) video standards.</td></tr></tbody></table></div></div><br class="table-break"><pre class="programlisting">
27#define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
28#define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
29#define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
30#define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
31#define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
32#define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
33#define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
34#define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)
35
36#define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
37#define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
38#define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
39#define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)
40</pre><p><code class="constant">V4L2_STD_PAL_60</code> is
41a hybrid standard with 525 lines, 60 Hz refresh rate, and PAL color
42modulation with a 4.43 MHz color subcarrier. Some PAL video recorders
43can play back NTSC tapes in this mode for display on a 50/60 Hz agnostic
44PAL TV.</p><pre class="programlisting">
45#define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)
46#define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)
47#define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)
48</pre><p><code class="constant">V4L2_STD_NTSC_443</code>
49is a hybrid standard with 525 lines, 60 Hz refresh rate, and NTSC
50color modulation with a 4.43 MHz color
51subcarrier.</p><pre class="programlisting">
52#define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)
53
54#define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
55#define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
56#define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
57#define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
58#define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
59#define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
60#define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
61#define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)
62
63/* ATSC/HDTV */
64#define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
65#define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)
66</pre><p><code class="constant">V4L2_STD_ATSC_8_VSB</code> and
67<code class="constant">V4L2_STD_ATSC_16_VSB</code> are U.S. terrestrial digital
68TV standards. Presently the V4L2 API does not support digital TV. See
69also the Linux DVB API at <a class="ulink" href="http://linuxtv.org" target="_top">http://linuxtv.org</a>.</p><pre class="programlisting">
70#define V4L2_STD_PAL_BG         (V4L2_STD_PAL_B         |\
71				 V4L2_STD_PAL_B1        |\
72				 V4L2_STD_PAL_G)
73#define V4L2_STD_B              (V4L2_STD_PAL_B         |\
74				 V4L2_STD_PAL_B1        |\
75				 V4L2_STD_SECAM_B)
76#define V4L2_STD_GH             (V4L2_STD_PAL_G         |\
77				 V4L2_STD_PAL_H         |\
78				 V4L2_STD_SECAM_G       |\
79				 V4L2_STD_SECAM_H)
80#define V4L2_STD_PAL_DK         (V4L2_STD_PAL_D         |\
81				 V4L2_STD_PAL_D1        |\
82				 V4L2_STD_PAL_K)
83#define V4L2_STD_PAL            (V4L2_STD_PAL_BG        |\
84				 V4L2_STD_PAL_DK        |\
85				 V4L2_STD_PAL_H         |\
86				 V4L2_STD_PAL_I)
87#define V4L2_STD_NTSC           (V4L2_STD_NTSC_M        |\
88				 V4L2_STD_NTSC_M_JP     |\
89				 V4L2_STD_NTSC_M_KR)
90#define V4L2_STD_MN             (V4L2_STD_PAL_M         |\
91				 V4L2_STD_PAL_N         |\
92				 V4L2_STD_PAL_Nc        |\
93				 V4L2_STD_NTSC)
94#define V4L2_STD_SECAM_DK       (V4L2_STD_SECAM_D       |\
95				 V4L2_STD_SECAM_K       |\
96				 V4L2_STD_SECAM_K1)
97#define V4L2_STD_DK             (V4L2_STD_PAL_DK        |\
98				 V4L2_STD_SECAM_DK)
99
100#define V4L2_STD_SECAM          (V4L2_STD_SECAM_B       |\
101				 V4L2_STD_SECAM_G       |\
102				 V4L2_STD_SECAM_H       |\
103				 V4L2_STD_SECAM_DK      |\
104				 V4L2_STD_SECAM_L       |\
105				 V4L2_STD_SECAM_LC)
106
107#define V4L2_STD_525_60         (V4L2_STD_PAL_M         |\
108				 V4L2_STD_PAL_60        |\
109				 V4L2_STD_NTSC          |\
110				 V4L2_STD_NTSC_443)
111#define V4L2_STD_625_50         (V4L2_STD_PAL           |\
112				 V4L2_STD_PAL_N         |\
113				 V4L2_STD_PAL_Nc        |\
114				 V4L2_STD_SECAM)
115
116#define V4L2_STD_UNKNOWN        0
117#define V4L2_STD_ALL            (V4L2_STD_525_60        |\
118				 V4L2_STD_625_50)
119</pre><div class="table"><a name="video-standards"></a><p class="title"><b>Table&#160;A.49.&#160;Video Standards (based on [<a class="xref" href="bi01.html#itu470" title='ITU-R Recommendation BT.470-6 "Conventional Television Systems"'>[<abbr class="abbrev">ITU&#160;BT.470</abbr>]</a>])</b></p><div class="table-contents"><table summary="Video Standards (based on [])" width="100%" border="1"><colgroup><col align="left" class="c1"><col align="center" class="c2"><col align="center" class="c3"><col align="center" class="c4"><col align="center" class="c5"><col><col align="center" class="c7"><col><col align="center" class="c9"><col><col><col align="center" class="c12"></colgroup><thead><tr><th align="left">Characteristics</th><th align="center"><p>M/NTSC<a href="#ftn.idp1113450236" class="footnote" name="idp1113450236"><sup class="footnote">[a]</sup></a></p></th><th align="center">M/PAL</th><th align="center"><p>N/PAL<a href="#ftn.idp1113451156" class="footnote" name="idp1113451156"><sup class="footnote">[b]</sup></a></p></th><th align="center">B, B1, G/PAL</th><th align="center">D, D1, K/PAL</th><th align="center">H/PAL</th><th align="center">I/PAL</th><th align="center">B, G/SECAM</th><th align="center">D, K/SECAM</th><th align="center">K1/SECAM</th><th align="center">L/SECAM</th></tr></thead><tbody valign="top"><tr><td align="left" valign="top">Frame lines</td><td colspan="2" align="center" valign="top">525</td><td colspan="9" align="center" valign="top">625</td></tr><tr><td align="left" valign="top">Frame period (s)</td><td colspan="2" align="center" valign="top">1001/30000</td><td colspan="9" align="center" valign="top">1/25</td></tr><tr><td align="left" valign="top">Chrominance sub-carrier frequency (Hz)</td><td align="center" valign="top">3579545 &#177;&#160;10</td><td align="center" valign="top">3579611.49 &#177;&#160;10</td><td align="center" valign="top">4433618.75 &#177;&#160;5 (3582056.25
120&#177;&#160;5)</td><td colspan="3" align="center" valign="top">4433618.75 &#177;&#160;5</td><td align="center" valign="top">4433618.75 &#177;&#160;1</td><td colspan="4" align="center" valign="top">f<sub>OR</sub>&#160;=
1214406250 &#177;&#160;2000, f<sub>OB</sub>&#160;= 4250000
122&#177;&#160;2000</td></tr><tr><td align="left" valign="top">Nominal radio-frequency channel bandwidth
123(MHz)</td><td align="center" valign="top">6</td><td align="center" valign="top">6</td><td align="center" valign="top">6</td><td align="center" valign="top">B: 7; B1, G: 8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td><td align="center" valign="top">8</td></tr><tr><td align="left" valign="top">Sound carrier relative to vision carrier
124(MHz)</td><td align="center" valign="top">+&#160;4.5</td><td align="center" valign="top">+&#160;4.5</td><td align="center" valign="top">+&#160;4.5</td><td align="center" valign="top"><p>+&#160;5.5 &#177;&#160;0.001
125<a href="#ftn.idp1113463516" class="footnote" name="idp1113463516"><sup class="footnote">[c]</sup></a> <a href="#ftn.idp1113463748" class="footnote" name="idp1113463748"><sup class="footnote">[d]</sup></a> <a href="#ftn.idp1113464540" class="footnote" name="idp1113464540"><sup class="footnote">[e]</sup></a> <a href="#ftn.idp1113464732" class="footnote" name="idp1113464732"><sup class="footnote">[f]</sup></a></p></td><td align="center" valign="top">+&#160;6.5 &#177;&#160;0.001</td><td align="center" valign="top">+&#160;5.5</td><td align="center" valign="top">+&#160;5.9996 &#177;&#160;0.0005</td><td align="center" valign="top">+&#160;5.5 &#177;&#160;0.001</td><td align="center" valign="top">+&#160;6.5 &#177;&#160;0.001</td><td align="center" valign="top">+&#160;6.5</td><td align="center" valign="top"><p>+&#160;6.5 <a href="#ftn.idp1113466852" class="footnote" name="idp1113466852"><sup class="footnote">[g]</sup></a></p></td></tr></tbody><tbody class="footnotes"><tr><td colspan="12"><div id="ftn.idp1113450236" class="footnote"><p><a href="#idp1113450236" class="para"><sup class="para">[a] </sup></a>Japan uses a standard
126similar to M/NTSC
127(V4L2_STD_NTSC_M_JP).</p></div><div id="ftn.idp1113451156" class="footnote"><p><a href="#idp1113451156" class="para"><sup class="para">[b] </sup></a> The values in
128brackets apply to the combination N/PAL a.k.a.
129N<sub>C</sub> used in Argentina
130(V4L2_STD_PAL_Nc).</p></div><div id="ftn.idp1113463516" class="footnote"><p><a href="#idp1113463516" class="para"><sup class="para">[c] </sup></a>In the Federal Republic of Germany, Austria, Italy,
131the Netherlands, Slovakia and Switzerland a system of two sound
132carriers is used, the frequency of the second carrier being
133242.1875&#160;kHz above the frequency of the first sound carrier. For
134stereophonic sound transmissions a similar system is used in
135Australia.</p></div><div id="ftn.idp1113463748" class="footnote"><p><a href="#idp1113463748" class="para"><sup class="para">[d] </sup></a>New Zealand uses a sound
136carrier displaced 5.4996 &#177;&#160;0.0005 MHz from the vision
137carrier.</p></div><div id="ftn.idp1113464540" class="footnote"><p><a href="#idp1113464540" class="para"><sup class="para">[e] </sup></a>In Denmark, Finland, New
138Zealand, Sweden and Spain a system of two sound carriers is used. In
139Iceland, Norway and Poland the same system is being introduced. The
140second carrier is 5.85&#160;MHz above the vision carrier and is DQPSK
141modulated with 728&#160;kbit/s sound and data multiplex. (NICAM
142system)</p></div><div id="ftn.idp1113464732" class="footnote"><p><a href="#idp1113464732" class="para"><sup class="para">[f] </sup></a>In the United Kingdom, a
143system of two sound carriers is used. The second sound carrier is
1446.552&#160;MHz above the vision carrier and is DQPSK modulated with a
145728&#160;kbit/s sound and data multiplex able to carry two sound
146channels. (NICAM system)</p></div><div id="ftn.idp1113466852" class="footnote"><p><a href="#idp1113466852" class="para"><sup class="para">[g] </sup></a>In France, a
147digital carrier 5.85 MHz away from the vision carrier may be used in
148addition to the main sound carrier. It is modulated in differentially
149encoded QPSK with a 728 kbit/s sound and data multiplexer capable of
150carrying two sound channels. (NICAM
151system)</p></div></td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1113467972"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct&#160;<a class="link" href="vidioc-enumstd.html#v4l2-standard" title="Table&#160;A.46.&#160;struct v4l2_standard">v4l2_standard</a> <em class="structfield"><code>index</code></em>
152is out of bounds.</p></dd><dt><span class="term"><span class="errorcode">ENODATA</span></span></dt><dd><p>Standard video timings are not supported for this input or output.</p></dd></dl></div></div><div class="footnotes"><br><hr style="width:100; text-align:left;margin-left: 0"><div id="ftn.idp1113413324" class="footnote"><p><a href="#idp1113413324" class="para"><sup class="para">[18] </sup></a>The supported standards may overlap and we need an
153unambiguous set to find the current standard returned by
154<code class="constant">VIDIOC_G_STD</code>.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-enumoutput.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="vidioc-expbuf.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_ENUMOUTPUT&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl VIDIOC_EXPBUF</td></tr></table></div></body></html>
155