vidioc-g-dv-timings.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <refentry id="vidioc-g-dv-timings">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_DV_TIMINGS</refname>
  8. <refname>VIDIOC_S_DV_TIMINGS</refname>
  9. <refpurpose>Get or set DV timings for input or output</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>To set DV timings for the input or output, applications use the
  47. <constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current timings,
  48. applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
  49. information is filled in using the structure &v4l2-dv-timings;. These ioctls take
  50. a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
  51. or the timing values are not correct, the driver returns &EINVAL;.</para>
  52. <para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the
  53. timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" />
  54. standards. If the current input or output does not support DV timings (e.g. if
  55. &VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_DV_TIMINGS</constant> flag), then
  56. &ENODATA; is returned.</para>
  57. </refsect1>
  58. <refsect1>
  59. &return-value;
  60. <variablelist>
  61. <varlistentry>
  62. <term><errorcode>EINVAL</errorcode></term>
  63. <listitem>
  64. <para>This ioctl is not supported, or the
  65. <constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
  66. </listitem>
  67. </varlistentry>
  68. <varlistentry>
  69. <term><errorcode>ENODATA</errorcode></term>
  70. <listitem>
  71. <para>Digital video timings are not supported for this input or output.</para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term><errorcode>EBUSY</errorcode></term>
  76. <listitem>
  77. <para>The device is busy and therefore can not change the timings.</para>
  78. </listitem>
  79. </varlistentry>
  80. </variablelist>
  81. <table pgwide="1" frame="none" id="v4l2-bt-timings">
  82. <title>struct <structname>v4l2_bt_timings</structname></title>
  83. <tgroup cols="3">
  84. &cs-str;
  85. <tbody valign="top">
  86. <row>
  87. <entry>__u32</entry>
  88. <entry><structfield>width</structfield></entry>
  89. <entry>Width of the active video in pixels.</entry>
  90. </row>
  91. <row>
  92. <entry>__u32</entry>
  93. <entry><structfield>height</structfield></entry>
  94. <entry>Height of the active video frame in lines. So for interlaced formats the
  95. height of the active video in each field is <structfield>height</structfield>/2.</entry>
  96. </row>
  97. <row>
  98. <entry>__u32</entry>
  99. <entry><structfield>interlaced</structfield></entry>
  100. <entry>Progressive (0) or interlaced (1)</entry>
  101. </row>
  102. <row>
  103. <entry>__u32</entry>
  104. <entry><structfield>polarities</structfield></entry>
  105. <entry>This is a bit mask that defines polarities of sync signals.
  106. bit 0 (V4L2_DV_VSYNC_POS_POL) is for vertical sync polarity and bit 1 (V4L2_DV_HSYNC_POS_POL) is for horizontal sync polarity. If the bit is set
  107. (1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
  108. </row>
  109. <row>
  110. <entry>__u64</entry>
  111. <entry><structfield>pixelclock</structfield></entry>
  112. <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
  113. </row>
  114. <row>
  115. <entry>__u32</entry>
  116. <entry><structfield>hfrontporch</structfield></entry>
  117. <entry>Horizontal front porch in pixels</entry>
  118. </row>
  119. <row>
  120. <entry>__u32</entry>
  121. <entry><structfield>hsync</structfield></entry>
  122. <entry>Horizontal sync length in pixels</entry>
  123. </row>
  124. <row>
  125. <entry>__u32</entry>
  126. <entry><structfield>hbackporch</structfield></entry>
  127. <entry>Horizontal back porch in pixels</entry>
  128. </row>
  129. <row>
  130. <entry>__u32</entry>
  131. <entry><structfield>vfrontporch</structfield></entry>
  132. <entry>Vertical front porch in lines. For interlaced formats this refers to the
  133. odd field (aka field 1).</entry>
  134. </row>
  135. <row>
  136. <entry>__u32</entry>
  137. <entry><structfield>vsync</structfield></entry>
  138. <entry>Vertical sync length in lines. For interlaced formats this refers to the
  139. odd field (aka field 1).</entry>
  140. </row>
  141. <row>
  142. <entry>__u32</entry>
  143. <entry><structfield>vbackporch</structfield></entry>
  144. <entry>Vertical back porch in lines. For interlaced formats this refers to the
  145. odd field (aka field 1).</entry>
  146. </row>
  147. <row>
  148. <entry>__u32</entry>
  149. <entry><structfield>il_vfrontporch</structfield></entry>
  150. <entry>Vertical front porch in lines for the even field (aka field 2) of
  151. interlaced field formats.</entry>
  152. </row>
  153. <row>
  154. <entry>__u32</entry>
  155. <entry><structfield>il_vsync</structfield></entry>
  156. <entry>Vertical sync length in lines for the even field (aka field 2) of
  157. interlaced field formats.</entry>
  158. </row>
  159. <row>
  160. <entry>__u32</entry>
  161. <entry><structfield>il_vbackporch</structfield></entry>
  162. <entry>Vertical back porch in lines for the even field (aka field 2) of
  163. interlaced field formats.</entry>
  164. </row>
  165. <row>
  166. <entry>__u32</entry>
  167. <entry><structfield>standards</structfield></entry>
  168. <entry>The video standard(s) this format belongs to. This will be filled in by
  169. the driver. Applications must set this to 0. See <xref linkend="dv-bt-standards"/>
  170. for a list of standards.</entry>
  171. </row>
  172. <row>
  173. <entry>__u32</entry>
  174. <entry><structfield>flags</structfield></entry>
  175. <entry>Several flags giving more information about the format.
  176. See <xref linkend="dv-bt-flags"/> for a description of the flags.
  177. </entry>
  178. </row>
  179. </tbody>
  180. </tgroup>
  181. </table>
  182. <table pgwide="1" frame="none" id="v4l2-dv-timings">
  183. <title>struct <structname>v4l2_dv_timings</structname></title>
  184. <tgroup cols="4">
  185. &cs-str;
  186. <tbody valign="top">
  187. <row>
  188. <entry>__u32</entry>
  189. <entry><structfield>type</structfield></entry>
  190. <entry></entry>
  191. <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
  192. </row>
  193. <row>
  194. <entry>union</entry>
  195. <entry><structfield></structfield></entry>
  196. <entry></entry>
  197. </row>
  198. <row>
  199. <entry></entry>
  200. <entry>&v4l2-bt-timings;</entry>
  201. <entry><structfield>bt</structfield></entry>
  202. <entry>Timings defined by BT.656/1120 specifications</entry>
  203. </row>
  204. <row>
  205. <entry></entry>
  206. <entry>__u32</entry>
  207. <entry><structfield>reserved</structfield>[32]</entry>
  208. <entry></entry>
  209. </row>
  210. </tbody>
  211. </tgroup>
  212. </table>
  213. <table pgwide="1" frame="none" id="dv-timing-types">
  214. <title>DV Timing types</title>
  215. <tgroup cols="3">
  216. &cs-str;
  217. <tbody valign="top">
  218. <row>
  219. <entry>Timing type</entry>
  220. <entry>value</entry>
  221. <entry>Description</entry>
  222. </row>
  223. <row>
  224. <entry></entry>
  225. <entry></entry>
  226. <entry></entry>
  227. </row>
  228. <row>
  229. <entry>V4L2_DV_BT_656_1120</entry>
  230. <entry>0</entry>
  231. <entry>BT.656/1120 timings</entry>
  232. </row>
  233. </tbody>
  234. </tgroup>
  235. </table>
  236. <table pgwide="1" frame="none" id="dv-bt-standards">
  237. <title>DV BT Timing standards</title>
  238. <tgroup cols="2">
  239. &cs-str;
  240. <tbody valign="top">
  241. <row>
  242. <entry>Timing standard</entry>
  243. <entry>Description</entry>
  244. </row>
  245. <row>
  246. <entry></entry>
  247. <entry></entry>
  248. </row>
  249. <row>
  250. <entry>V4L2_DV_BT_STD_CEA861</entry>
  251. <entry>The timings follow the CEA-861 Digital TV Profile standard</entry>
  252. </row>
  253. <row>
  254. <entry>V4L2_DV_BT_STD_DMT</entry>
  255. <entry>The timings follow the VESA Discrete Monitor Timings standard</entry>
  256. </row>
  257. <row>
  258. <entry>V4L2_DV_BT_STD_CVT</entry>
  259. <entry>The timings follow the VESA Coordinated Video Timings standard</entry>
  260. </row>
  261. <row>
  262. <entry>V4L2_DV_BT_STD_GTF</entry>
  263. <entry>The timings follow the VESA Generalized Timings Formula standard</entry>
  264. </row>
  265. </tbody>
  266. </tgroup>
  267. </table>
  268. <table pgwide="1" frame="none" id="dv-bt-flags">
  269. <title>DV BT Timing flags</title>
  270. <tgroup cols="2">
  271. &cs-str;
  272. <tbody valign="top">
  273. <row>
  274. <entry>Flag</entry>
  275. <entry>Description</entry>
  276. </row>
  277. <row>
  278. <entry></entry>
  279. <entry></entry>
  280. </row>
  281. <row>
  282. <entry>V4L2_DV_FL_REDUCED_BLANKING</entry>
  283. <entry>CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary
  284. GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
  285. intervals are reduced, allowing a higher resolution over the same
  286. bandwidth. This is a read-only flag, applications must not set this.
  287. </entry>
  288. </row>
  289. <row>
  290. <entry>V4L2_DV_FL_CAN_REDUCE_FPS</entry>
  291. <entry>CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple
  292. of six. These formats can be optionally played at 1 / 1.001 speed to
  293. be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
  294. 29.97 frames per second. If the transmitter can't generate such frequencies, then the
  295. flag will also be cleared. This is a read-only flag, applications must not set this.
  296. </entry>
  297. </row>
  298. <row>
  299. <entry>V4L2_DV_FL_REDUCED_FPS</entry>
  300. <entry>CEA-861 specific: only valid for video transmitters, the flag is cleared
  301. by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag
  302. set, for other formats the flag will be cleared by the driver.
  303. If the application sets this flag, then the pixelclock used to set up the transmitter is
  304. divided by 1.001 to make it compatible with NTSC framerates. If the transmitter
  305. can't generate such frequencies, then the flag will also be cleared.
  306. </entry>
  307. </row>
  308. <row>
  309. <entry>V4L2_DV_FL_HALF_LINE</entry>
  310. <entry>Specific to interlaced formats: if set, then field 1 (aka the odd field)
  311. is really one half-line longer and field 2 (aka the even field) is really one half-line
  312. shorter, so each field has exactly the same number of half-lines. Whether half-lines can be
  313. detected or used depends on the hardware.
  314. </entry>
  315. </row>
  316. </tbody>
  317. </tgroup>
  318. </table>
  319. </refsect1>
  320. </refentry>