vidioc-enumstd.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <refentry id="vidioc-enumstd">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_ENUMSTD</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_ENUMSTD</refname>
  8. <refpurpose>Enumerate supported video standards</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct v4l2_standard *<parameter>argp</parameter></paramdef>
  17. </funcprototype>
  18. </funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Arguments</title>
  22. <variablelist>
  23. <varlistentry>
  24. <term><parameter>fd</parameter></term>
  25. <listitem>
  26. <para>&fd;</para>
  27. </listitem>
  28. </varlistentry>
  29. <varlistentry>
  30. <term><parameter>request</parameter></term>
  31. <listitem>
  32. <para>VIDIOC_ENUMSTD</para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><parameter>argp</parameter></term>
  37. <listitem>
  38. <para></para>
  39. </listitem>
  40. </varlistentry>
  41. </variablelist>
  42. </refsect1>
  43. <refsect1>
  44. <title>Description</title>
  45. <para>To query the attributes of a video standard,
  46. especially a custom (driver defined) one, applications initialize the
  47. <structfield>index</structfield> field of &v4l2-standard; and call the
  48. <constant>VIDIOC_ENUMSTD</constant> ioctl with a pointer to this
  49. structure. Drivers fill the rest of the structure or return an
  50. &EINVAL; when the index is out of bounds. To enumerate all standards
  51. applications shall begin at index zero, incrementing by one until the
  52. driver returns <errorcode>EINVAL</errorcode>. Drivers may enumerate a
  53. different set of standards after switching the video input or
  54. output.<footnote>
  55. <para>The supported standards may overlap and we need an
  56. unambiguous set to find the current standard returned by
  57. <constant>VIDIOC_G_STD</constant>.</para>
  58. </footnote></para>
  59. <table pgwide="1" frame="none" id="v4l2-standard">
  60. <title>struct <structname>v4l2_standard</structname></title>
  61. <tgroup cols="3">
  62. &cs-str;
  63. <tbody valign="top">
  64. <row>
  65. <entry>__u32</entry>
  66. <entry><structfield>index</structfield></entry>
  67. <entry>Number of the video standard, set by the
  68. application.</entry>
  69. </row>
  70. <row>
  71. <entry>&v4l2-std-id;</entry>
  72. <entry><structfield>id</structfield></entry>
  73. <entry>The bits in this field identify the standard as
  74. one of the common standards listed in <xref linkend="v4l2-std-id" />,
  75. or if bits 32 to 63 are set as custom standards. Multiple bits can be
  76. set if the hardware does not distinguish between these standards,
  77. however separate indices do not indicate the opposite. The
  78. <structfield>id</structfield> must be unique. No other enumerated
  79. <structname>v4l2_standard</structname> structure, for this input or
  80. output anyway, can contain the same set of bits.</entry>
  81. </row>
  82. <row>
  83. <entry>__u8</entry>
  84. <entry><structfield>name</structfield>[24]</entry>
  85. <entry>Name of the standard, a NUL-terminated ASCII
  86. string, for example: "PAL-B/G", "NTSC Japan". This information is
  87. intended for the user.</entry>
  88. </row>
  89. <row>
  90. <entry>&v4l2-fract;</entry>
  91. <entry><structfield>frameperiod</structfield></entry>
  92. <entry>The frame period (not field period) is numerator
  93. / denominator. For example M/NTSC has a frame period of 1001 /
  94. 30000 seconds.</entry>
  95. </row>
  96. <row>
  97. <entry>__u32</entry>
  98. <entry><structfield>framelines</structfield></entry>
  99. <entry>Total lines per frame including blanking,
  100. e.&nbsp;g. 625 for B/PAL.</entry>
  101. </row>
  102. <row>
  103. <entry>__u32</entry>
  104. <entry><structfield>reserved</structfield>[4]</entry>
  105. <entry>Reserved for future extensions. Drivers must set
  106. the array to zero.</entry>
  107. </row>
  108. </tbody>
  109. </tgroup>
  110. </table>
  111. <table pgwide="1" frame="none" id="v4l2-fract">
  112. <title>struct <structname>v4l2_fract</structname></title>
  113. <tgroup cols="3">
  114. &cs-str;
  115. <tbody valign="top">
  116. <row>
  117. <entry>__u32</entry>
  118. <entry><structfield>numerator</structfield></entry>
  119. <entry></entry>
  120. </row>
  121. <row>
  122. <entry>__u32</entry>
  123. <entry><structfield>denominator</structfield></entry>
  124. <entry></entry>
  125. </row>
  126. </tbody>
  127. </tgroup>
  128. </table>
  129. <table pgwide="1" frame="none" id="v4l2-std-id">
  130. <title>typedef <structname>v4l2_std_id</structname></title>
  131. <tgroup cols="3">
  132. &cs-str;
  133. <tbody valign="top">
  134. <row>
  135. <entry>__u64</entry>
  136. <entry><structfield>v4l2_std_id</structfield></entry>
  137. <entry>This type is a set, each bit representing another
  138. video standard as listed below and in <xref
  139. linkend="video-standards" />. The 32 most significant bits are reserved
  140. for custom (driver defined) video standards.</entry>
  141. </row>
  142. </tbody>
  143. </tgroup>
  144. </table>
  145. <para><programlisting>
  146. #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
  147. #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
  148. #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
  149. #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
  150. #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
  151. #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
  152. #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
  153. #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
  154. #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
  155. #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
  156. #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
  157. #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
  158. </programlisting></para><para><constant>V4L2_STD_PAL_60</constant> is
  159. a hybrid standard with 525 lines, 60 Hz refresh rate, and PAL color
  160. modulation with a 4.43 MHz color subcarrier. Some PAL video recorders
  161. can play back NTSC tapes in this mode for display on a 50/60 Hz agnostic
  162. PAL TV.</para><para><programlisting>
  163. #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
  164. #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
  165. #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
  166. </programlisting></para><para><constant>V4L2_STD_NTSC_443</constant>
  167. is a hybrid standard with 525 lines, 60 Hz refresh rate, and NTSC
  168. color modulation with a 4.43 MHz color
  169. subcarrier.</para><para><programlisting>
  170. #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
  171. #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
  172. #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
  173. #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
  174. #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
  175. #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
  176. #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
  177. #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
  178. #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
  179. /* ATSC/HDTV */
  180. #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
  181. #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
  182. </programlisting></para><para><!-- ATSC proposal by Mark McClelland,
  183. video4linux-list@redhat.com on 17 Oct 2002
  184. --><constant>V4L2_STD_ATSC_8_VSB</constant> and
  185. <constant>V4L2_STD_ATSC_16_VSB</constant> are U.S. terrestrial digital
  186. TV standards. Presently the V4L2 API does not support digital TV. See
  187. also the Linux DVB API at <ulink
  188. url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
  189. <para><programlisting>
  190. #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
  191. V4L2_STD_PAL_B1 |\
  192. V4L2_STD_PAL_G)
  193. #define V4L2_STD_B (V4L2_STD_PAL_B |\
  194. V4L2_STD_PAL_B1 |\
  195. V4L2_STD_SECAM_B)
  196. #define V4L2_STD_GH (V4L2_STD_PAL_G |\
  197. V4L2_STD_PAL_H |\
  198. V4L2_STD_SECAM_G |\
  199. V4L2_STD_SECAM_H)
  200. #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
  201. V4L2_STD_PAL_D1 |\
  202. V4L2_STD_PAL_K)
  203. #define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
  204. V4L2_STD_PAL_DK |\
  205. V4L2_STD_PAL_H |\
  206. V4L2_STD_PAL_I)
  207. #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
  208. V4L2_STD_NTSC_M_JP |\
  209. V4L2_STD_NTSC_M_KR)
  210. #define V4L2_STD_MN (V4L2_STD_PAL_M |\
  211. V4L2_STD_PAL_N |\
  212. V4L2_STD_PAL_Nc |\
  213. V4L2_STD_NTSC)
  214. #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\
  215. V4L2_STD_SECAM_K |\
  216. V4L2_STD_SECAM_K1)
  217. #define V4L2_STD_DK (V4L2_STD_PAL_DK |\
  218. V4L2_STD_SECAM_DK)
  219. #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\
  220. V4L2_STD_SECAM_G |\
  221. V4L2_STD_SECAM_H |\
  222. V4L2_STD_SECAM_DK |\
  223. V4L2_STD_SECAM_L |\
  224. V4L2_STD_SECAM_LC)
  225. #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
  226. V4L2_STD_PAL_60 |\
  227. V4L2_STD_NTSC |\
  228. V4L2_STD_NTSC_443)
  229. #define V4L2_STD_625_50 (V4L2_STD_PAL |\
  230. V4L2_STD_PAL_N |\
  231. V4L2_STD_PAL_Nc |\
  232. V4L2_STD_SECAM)
  233. #define V4L2_STD_UNKNOWN 0
  234. #define V4L2_STD_ALL (V4L2_STD_525_60 |\
  235. V4L2_STD_625_50)
  236. </programlisting></para>
  237. <table pgwide="1" id="video-standards" orient="land">
  238. <title>Video Standards (based on [<xref linkend="itu470" />])</title>
  239. <tgroup cols="12" colsep="1" rowsep="1" align="center">
  240. <colspec colname="c1" align="left" />
  241. <colspec colname="c2" />
  242. <colspec colname="c3" />
  243. <colspec colname="c4" />
  244. <colspec colname="c5" />
  245. <colspec colnum="7" colname="c7" />
  246. <colspec colnum="9" colname="c9" />
  247. <colspec colnum="12" colname="c12" />
  248. <spanspec namest="c2" nameend="c3" spanname="m" align="center" />
  249. <spanspec namest="c4" nameend="c12" spanname="x" align="center" />
  250. <spanspec namest="c5" nameend="c7" spanname="b" align="center" />
  251. <spanspec namest="c9" nameend="c12" spanname="s" align="center" />
  252. <thead>
  253. <row>
  254. <entry>Characteristics</entry>
  255. <entry><para>M/NTSC<footnote><para>Japan uses a standard
  256. similar to M/NTSC
  257. (V4L2_STD_NTSC_M_JP).</para></footnote></para></entry>
  258. <entry>M/PAL</entry>
  259. <entry><para>N/PAL<footnote><para> The values in
  260. brackets apply to the combination N/PAL a.k.a.
  261. N<subscript>C</subscript> used in Argentina
  262. (V4L2_STD_PAL_Nc).</para></footnote></para></entry>
  263. <entry align="center">B, B1, G/PAL</entry>
  264. <entry align="center">D, D1, K/PAL</entry>
  265. <entry align="center">H/PAL</entry>
  266. <entry align="center">I/PAL</entry>
  267. <entry align="center">B, G/SECAM</entry>
  268. <entry align="center">D, K/SECAM</entry>
  269. <entry align="center">K1/SECAM</entry>
  270. <entry align="center">L/SECAM</entry>
  271. </row>
  272. </thead>
  273. <tbody valign="top">
  274. <row>
  275. <entry>Frame lines</entry>
  276. <entry spanname="m">525</entry>
  277. <entry spanname="x">625</entry>
  278. </row>
  279. <row>
  280. <entry>Frame period (s)</entry>
  281. <entry spanname="m">1001/30000</entry>
  282. <entry spanname="x">1/25</entry>
  283. </row>
  284. <row>
  285. <entry>Chrominance sub-carrier frequency (Hz)</entry>
  286. <entry>3579545 &plusmn;&nbsp;10</entry>
  287. <entry>3579611.49 &plusmn;&nbsp;10</entry>
  288. <entry>4433618.75 &plusmn;&nbsp;5 (3582056.25
  289. &plusmn;&nbsp;5)</entry>
  290. <entry spanname="b">4433618.75 &plusmn;&nbsp;5</entry>
  291. <entry>4433618.75 &plusmn;&nbsp;1</entry>
  292. <entry spanname="s">f<subscript>OR</subscript>&nbsp;=
  293. 4406250 &plusmn;&nbsp;2000, f<subscript>OB</subscript>&nbsp;= 4250000
  294. &plusmn;&nbsp;2000</entry>
  295. </row>
  296. <row>
  297. <entry>Nominal radio-frequency channel bandwidth
  298. (MHz)</entry>
  299. <entry>6</entry>
  300. <entry>6</entry>
  301. <entry>6</entry>
  302. <entry>B: 7; B1, G: 8</entry>
  303. <entry>8</entry>
  304. <entry>8</entry>
  305. <entry>8</entry>
  306. <entry>8</entry>
  307. <entry>8</entry>
  308. <entry>8</entry>
  309. <entry>8</entry>
  310. </row>
  311. <row>
  312. <entry>Sound carrier relative to vision carrier
  313. (MHz)</entry>
  314. <entry>+&nbsp;4.5</entry>
  315. <entry>+&nbsp;4.5</entry>
  316. <entry>+&nbsp;4.5</entry>
  317. <entry><para>+&nbsp;5.5 &plusmn;&nbsp;0.001
  318. <footnote><para>In the Federal Republic of Germany, Austria, Italy,
  319. the Netherlands, Slovakia and Switzerland a system of two sound
  320. carriers is used, the frequency of the second carrier being
  321. 242.1875&nbsp;kHz above the frequency of the first sound carrier. For
  322. stereophonic sound transmissions a similar system is used in
  323. Australia.</para></footnote> <footnote><para>New Zealand uses a sound
  324. carrier displaced 5.4996 &plusmn;&nbsp;0.0005 MHz from the vision
  325. carrier.</para></footnote> <footnote><para>In Denmark, Finland, New
  326. Zealand, Sweden and Spain a system of two sound carriers is used. In
  327. Iceland, Norway and Poland the same system is being introduced. The
  328. second carrier is 5.85&nbsp;MHz above the vision carrier and is DQPSK
  329. modulated with 728&nbsp;kbit/s sound and data multiplex. (NICAM
  330. system)</para></footnote> <footnote><para>In the United Kingdom, a
  331. system of two sound carriers is used. The second sound carrier is
  332. 6.552&nbsp;MHz above the vision carrier and is DQPSK modulated with a
  333. 728&nbsp;kbit/s sound and data multiplex able to carry two sound
  334. channels. (NICAM system)</para></footnote></para></entry>
  335. <entry>+&nbsp;6.5 &plusmn;&nbsp;0.001</entry>
  336. <entry>+&nbsp;5.5</entry>
  337. <entry>+&nbsp;5.9996 &plusmn;&nbsp;0.0005</entry>
  338. <entry>+&nbsp;5.5 &plusmn;&nbsp;0.001</entry>
  339. <entry>+&nbsp;6.5 &plusmn;&nbsp;0.001</entry>
  340. <entry>+&nbsp;6.5</entry>
  341. <entry><para>+&nbsp;6.5 <footnote><para>In France, a
  342. digital carrier 5.85 MHz away from the vision carrier may be used in
  343. addition to the main sound carrier. It is modulated in differentially
  344. encoded QPSK with a 728 kbit/s sound and data multiplexer capable of
  345. carrying two sound channels. (NICAM
  346. system)</para></footnote></para></entry>
  347. </row>
  348. </tbody>
  349. </tgroup>
  350. </table>
  351. </refsect1>
  352. <refsect1>
  353. &return-value;
  354. <variablelist>
  355. <varlistentry>
  356. <term><errorcode>EINVAL</errorcode></term>
  357. <listitem>
  358. <para>The &v4l2-standard; <structfield>index</structfield>
  359. is out of bounds.</para>
  360. </listitem>
  361. </varlistentry>
  362. <varlistentry>
  363. <term><errorcode>ENODATA</errorcode></term>
  364. <listitem>
  365. <para>Standard video timings are not supported for this input or output.</para>
  366. </listitem>
  367. </varlistentry>
  368. </variablelist>
  369. </refsect1>
  370. </refentry>