| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 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 | |
| 7 | <refnamediv> |
| 8 | <refname>VIDIOC_G_DV_TIMINGS</refname> |
| 9 | <refname>VIDIOC_S_DV_TIMINGS</refname> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 10 | <refpurpose>Get or set DV timings for input or output</refpurpose> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 11 | </refnamediv> |
| 12 | |
| 13 | <refsynopsisdiv> |
| 14 | <funcsynopsis> |
| 15 | <funcprototype> |
| 16 | <funcdef>int <function>ioctl</function></funcdef> |
| 17 | <paramdef>int <parameter>fd</parameter></paramdef> |
| 18 | <paramdef>int <parameter>request</parameter></paramdef> |
| Hans Verkuil | 5e765c6 | 2010-09-11 08:36:55 -0300 | [diff] [blame] | 19 | <paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 20 | </funcprototype> |
| 21 | </funcsynopsis> |
| 22 | </refsynopsisdiv> |
| 23 | |
| 24 | <refsect1> |
| 25 | <title>Arguments</title> |
| 26 | |
| 27 | <variablelist> |
| 28 | <varlistentry> |
| 29 | <term><parameter>fd</parameter></term> |
| 30 | <listitem> |
| 31 | <para>&fd;</para> |
| 32 | </listitem> |
| 33 | </varlistentry> |
| 34 | <varlistentry> |
| 35 | <term><parameter>request</parameter></term> |
| 36 | <listitem> |
| 37 | <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para> |
| 38 | </listitem> |
| 39 | </varlistentry> |
| 40 | <varlistentry> |
| 41 | <term><parameter>argp</parameter></term> |
| 42 | <listitem> |
| 43 | <para></para> |
| 44 | </listitem> |
| 45 | </varlistentry> |
| 46 | </variablelist> |
| 47 | </refsect1> |
| 48 | |
| 49 | <refsect1> |
| 50 | <title>Description</title> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 51 | <para>To set DV timings for the input or output, applications use the |
| 52 | <constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current timings, |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 53 | applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing |
| 54 | information is filled in using the structure &v4l2-dv-timings;. These ioctls take |
| 55 | a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported |
| 56 | or the timing values are not correct, the driver returns &EINVAL;.</para> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 57 | <para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the |
| 58 | timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" /> |
| 59 | standards.</para> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 60 | </refsect1> |
| 61 | |
| 62 | <refsect1> |
| 63 | &return-value; |
| 64 | |
| 65 | <variablelist> |
| 66 | <varlistentry> |
| 67 | <term><errorcode>EINVAL</errorcode></term> |
| 68 | <listitem> |
| 69 | <para>This ioctl is not supported, or the |
| 70 | <constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para> |
| 71 | </listitem> |
| 72 | </varlistentry> |
| 73 | <varlistentry> |
| 74 | <term><errorcode>EBUSY</errorcode></term> |
| 75 | <listitem> |
| 76 | <para>The device is busy and therefore can not change the timings.</para> |
| 77 | </listitem> |
| 78 | </varlistentry> |
| 79 | </variablelist> |
| 80 | |
| 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> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 89 | <entry>Width of the active video in pixels.</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 90 | </row> |
| 91 | <row> |
| 92 | <entry>__u32</entry> |
| 93 | <entry><structfield>height</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 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> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 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> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 132 | <entry>Vertical front porch in lines. For interlaced formats this refers to the |
| 133 | odd field (aka field 1).</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 134 | </row> |
| 135 | <row> |
| 136 | <entry>__u32</entry> |
| 137 | <entry><structfield>vsync</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 138 | <entry>Vertical sync length in lines. For interlaced formats this refers to the |
| 139 | odd field (aka field 1).</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 140 | </row> |
| 141 | <row> |
| 142 | <entry>__u32</entry> |
| 143 | <entry><structfield>vbackporch</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 144 | <entry>Vertical back porch in lines. For interlaced formats this refers to the |
| 145 | odd field (aka field 1).</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 146 | </row> |
| 147 | <row> |
| 148 | <entry>__u32</entry> |
| 149 | <entry><structfield>il_vfrontporch</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 150 | <entry>Vertical front porch in lines for the even field (aka field 2) of |
| 151 | interlaced field formats.</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 152 | </row> |
| 153 | <row> |
| 154 | <entry>__u32</entry> |
| 155 | <entry><structfield>il_vsync</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 156 | <entry>Vertical sync length in lines for the even field (aka field 2) of |
| 157 | interlaced field formats.</entry> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 158 | </row> |
| 159 | <row> |
| 160 | <entry>__u32</entry> |
| 161 | <entry><structfield>il_vbackporch</structfield></entry> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 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> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 178 | </row> |
| 179 | </tbody> |
| 180 | </tgroup> |
| 181 | </table> |
| 182 | |
| 183 | <table pgwide="1" frame="none" id="v4l2-dv-timings"> |
| 184 | <title>struct <structname>v4l2_dv_timings</structname></title> |
| 185 | <tgroup cols="4"> |
| 186 | &cs-str; |
| 187 | <tbody valign="top"> |
| 188 | <row> |
| 189 | <entry>__u32</entry> |
| 190 | <entry><structfield>type</structfield></entry> |
| 191 | <entry></entry> |
| 192 | <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry> |
| 193 | </row> |
| 194 | <row> |
| 195 | <entry>union</entry> |
| 196 | <entry><structfield></structfield></entry> |
| 197 | <entry></entry> |
| 198 | </row> |
| 199 | <row> |
| 200 | <entry></entry> |
| 201 | <entry>&v4l2-bt-timings;</entry> |
| 202 | <entry><structfield>bt</structfield></entry> |
| 203 | <entry>Timings defined by BT.656/1120 specifications</entry> |
| 204 | </row> |
| 205 | <row> |
| 206 | <entry></entry> |
| 207 | <entry>__u32</entry> |
| 208 | <entry><structfield>reserved</structfield>[32]</entry> |
| 209 | <entry></entry> |
| 210 | </row> |
| 211 | </tbody> |
| 212 | </tgroup> |
| 213 | </table> |
| 214 | |
| 215 | <table pgwide="1" frame="none" id="dv-timing-types"> |
| 216 | <title>DV Timing types</title> |
| 217 | <tgroup cols="3"> |
| 218 | &cs-str; |
| 219 | <tbody valign="top"> |
| 220 | <row> |
| 221 | <entry>Timing type</entry> |
| 222 | <entry>value</entry> |
| 223 | <entry>Description</entry> |
| 224 | </row> |
| 225 | <row> |
| 226 | <entry></entry> |
| 227 | <entry></entry> |
| 228 | <entry></entry> |
| 229 | </row> |
| 230 | <row> |
| 231 | <entry>V4L2_DV_BT_656_1120</entry> |
| 232 | <entry>0</entry> |
| 233 | <entry>BT.656/1120 timings</entry> |
| 234 | </row> |
| 235 | </tbody> |
| 236 | </tgroup> |
| 237 | </table> |
| Hans Verkuil | 7dcc606 | 2012-05-15 08:04:28 -0300 | [diff] [blame] | 238 | <table pgwide="1" frame="none" id="dv-bt-standards"> |
| 239 | <title>DV BT Timing standards</title> |
| 240 | <tgroup cols="2"> |
| 241 | &cs-str; |
| 242 | <tbody valign="top"> |
| 243 | <row> |
| 244 | <entry>Timing standard</entry> |
| 245 | <entry>Description</entry> |
| 246 | </row> |
| 247 | <row> |
| 248 | <entry></entry> |
| 249 | <entry></entry> |
| 250 | </row> |
| 251 | <row> |
| 252 | <entry>V4L2_DV_BT_STD_CEA861</entry> |
| 253 | <entry>The timings follow the CEA-861 Digital TV Profile standard</entry> |
| 254 | </row> |
| 255 | <row> |
| 256 | <entry>V4L2_DV_BT_STD_DMT</entry> |
| 257 | <entry>The timings follow the VESA Discrete Monitor Timings standard</entry> |
| 258 | </row> |
| 259 | <row> |
| 260 | <entry>V4L2_DV_BT_STD_CVT</entry> |
| 261 | <entry>The timings follow the VESA Coordinated Video Timings standard</entry> |
| 262 | </row> |
| 263 | <row> |
| 264 | <entry>V4L2_DV_BT_STD_GTF</entry> |
| 265 | <entry>The timings follow the VESA Generalized Timings Formula standard</entry> |
| 266 | </row> |
| 267 | </tbody> |
| 268 | </tgroup> |
| 269 | </table> |
| 270 | <table pgwide="1" frame="none" id="dv-bt-flags"> |
| 271 | <title>DV BT Timing flags</title> |
| 272 | <tgroup cols="2"> |
| 273 | &cs-str; |
| 274 | <tbody valign="top"> |
| 275 | <row> |
| 276 | <entry>Flag</entry> |
| 277 | <entry>Description</entry> |
| 278 | </row> |
| 279 | <row> |
| 280 | <entry></entry> |
| 281 | <entry></entry> |
| 282 | </row> |
| 283 | <row> |
| 284 | <entry>V4L2_DV_FL_REDUCED_BLANKING</entry> |
| 285 | <entry>CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary |
| 286 | GTF' curve (GTF). In both cases the horizontal and/or vertical blanking |
| 287 | intervals are reduced, allowing a higher resolution over the same |
| 288 | bandwidth. This is a read-only flag, applications must not set this. |
| 289 | </entry> |
| 290 | </row> |
| 291 | <row> |
| 292 | <entry>V4L2_DV_FL_CAN_REDUCE_FPS</entry> |
| 293 | <entry>CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple |
| 294 | of six. These formats can be optionally played at 1 / 1.001 speed to |
| 295 | be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of |
| 296 | 29.97 frames per second. If the transmitter can't generate such frequencies, then the |
| 297 | flag will also be cleared. This is a read-only flag, applications must not set this. |
| 298 | </entry> |
| 299 | </row> |
| 300 | <row> |
| 301 | <entry>V4L2_DV_FL_REDUCED_FPS</entry> |
| 302 | <entry>CEA-861 specific: only valid for video transmitters, the flag is cleared |
| 303 | by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag |
| 304 | set, for other formats the flag will be cleared by the driver. |
| 305 | |
| 306 | If the application sets this flag, then the pixelclock used to set up the transmitter is |
| 307 | divided by 1.001 to make it compatible with NTSC framerates. If the transmitter |
| 308 | can't generate such frequencies, then the flag will also be cleared. |
| 309 | </entry> |
| 310 | </row> |
| 311 | <row> |
| 312 | <entry>V4L2_DV_FL_HALF_LINE</entry> |
| 313 | <entry>Specific to interlaced formats: if set, then field 1 (aka the odd field) |
| 314 | is really one half-line longer and field 2 (aka the even field) is really one half-line |
| 315 | shorter, so each field has exactly the same number of half-lines. Whether half-lines can be |
| 316 | detected or used depends on the hardware. |
| 317 | </entry> |
| 318 | </row> |
| 319 | </tbody> |
| 320 | </tgroup> |
| 321 | </table> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 322 | </refsect1> |
| Mauro Carvalho Chehab | 43c1daa | 2011-07-05 11:22:28 -0300 | [diff] [blame] | 323 | <refsect1> |
| 324 | &return-value; |
| 325 | </refsect1> |
| Muralidharan Karicheri | 007701e | 2009-12-03 01:13:17 -0300 | [diff] [blame] | 326 | </refentry> |