aboutsummaryrefslogtreecommitdiff
path: root/Documentation/DocBook/media/v4l/vidioc-g-dv-timings.xml
blob: 764b635ed4cf7102e04eb3ae0de2a24f0a7f1238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<refentry id="vidioc-g-dv-timings">
  <refmeta>
    <refentrytitle>ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</refentrytitle>
    &manvol;
  </refmeta>

  <refnamediv>
    <refname>VIDIOC_G_DV_TIMINGS</refname>
    <refname>VIDIOC_S_DV_TIMINGS</refname>
    <refpurpose>Get or set DV timings for input or output</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <funcsynopsis>
      <funcprototype>
	<funcdef>int <function>ioctl</function></funcdef>
	<paramdef>int <parameter>fd</parameter></paramdef>
	<paramdef>int <parameter>request</parameter></paramdef>
	<paramdef>struct v4l2_dv_timings *<parameter>argp</parameter></paramdef>
      </funcprototype>
    </funcsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Arguments</title>

    <variablelist>
      <varlistentry>
	<term><parameter>fd</parameter></term>
	<listitem>
	  <para>&fd;</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter>request</parameter></term>
	<listitem>
	  <para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter>argp</parameter></term>
	<listitem>
	  <para></para>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Description</title>
    <para>To set DV timings for the input or output, applications use the
<constant>VIDIOC_S_DV_TIMINGS</constant> ioctl and to get the current timings,
applications use the <constant>VIDIOC_G_DV_TIMINGS</constant> ioctl. The detailed timing
information is filled in using the structure &v4l2-dv-timings;. These ioctls take
a pointer to the &v4l2-dv-timings; structure as argument. If the ioctl is not supported
or the timing values are not correct, the driver returns &EINVAL;.</para>
<para>The <filename>linux/v4l2-dv-timings.h</filename> header can be used to get the
timings of the formats in the <xref linkend="cea861" /> and <xref linkend="vesadmt" />
standards. If the current input or output does not support DV timings (e.g. if
&VIDIOC-ENUMINPUT; does not set the <constant>V4L2_IN_CAP_DV_TIMINGS</constant> flag), then
&ENODATA; is returned.</para>
  </refsect1>

  <refsect1>
    &return-value;

    <variablelist>
      <varlistentry>
	<term><errorcode>EINVAL</errorcode></term>
	<listitem>
	  <para>This ioctl is not supported, or the
<constant>VIDIOC_S_DV_TIMINGS</constant> parameter was unsuitable.</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><errorcode>ENODATA</errorcode></term>
	<listitem>
	  <para>Digital video timings are not supported for this input or output.</para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><errorcode>EBUSY</errorcode></term>
	<listitem>
	  <para>The device is busy and therefore can not change the timings.</para>
	</listitem>
      </varlistentry>
    </variablelist>

    <table pgwide="1" frame="none" id="v4l2-bt-timings">
      <title>struct <structname>v4l2_bt_timings</structname></title>
      <tgroup cols="3">
	&cs-str;
	<tbody valign="top">
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>width</structfield></entry>
	    <entry>Width of the active video in pixels.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>height</structfield></entry>
	    <entry>Height of the active video frame in lines. So for interlaced formats the
	    height of the active video in each field is <structfield>height</structfield>/2.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>interlaced</structfield></entry>
	    <entry>Progressive (0) or interlaced (1)</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>polarities</structfield></entry>
	    <entry>This is a bit mask that defines polarities of sync signals.
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
(1) it is positive polarity and if is cleared (0), it is negative polarity.</entry>
	  </row>
	  <row>
	    <entry>__u64</entry>
	    <entry><structfield>pixelclock</structfield></entry>
	    <entry>Pixel clock in Hz. Ex. 74.25MHz->74250000</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>hfrontporch</structfield></entry>
	    <entry>Horizontal front porch in pixels</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>hsync</structfield></entry>
	    <entry>Horizontal sync length in pixels</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>hbackporch</structfield></entry>
	    <entry>Horizontal back porch in pixels</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>vfrontporch</structfield></entry>
	    <entry>Vertical front porch in lines. For interlaced formats this refers to the
	    odd field (aka field 1).</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>vsync</structfield></entry>
	    <entry>Vertical sync length in lines. For interlaced formats this refers to the
	    odd field (aka field 1).</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>vbackporch</structfield></entry>
	    <entry>Vertical back porch in lines. For interlaced formats this refers to the
	    odd field (aka field 1).</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>il_vfrontporch</structfield></entry>
	    <entry>Vertical front porch in lines for the even field (aka field 2) of
	    interlaced field formats. Must be 0 for progressive formats.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>il_vsync</structfield></entry>
	    <entry>Vertical sync length in lines for the even field (aka field 2) of
	    interlaced field formats. Must be 0 for progressive formats.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>il_vbackporch</structfield></entry>
	    <entry>Vertical back porch in lines for the even field (aka field 2) of
	    interlaced field formats. Must be 0 for progressive formats.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>standards</structfield></entry>
	    <entry>The video standard(s) this format belongs to. This will be filled in by
	    the driver. Applications must set this to 0. See <xref linkend="dv-bt-standards"/>
	    for a list of standards.</entry>
	  </row>
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>flags</structfield></entry>
	    <entry>Several flags giving more information about the format.
	    See <xref linkend="dv-bt-flags"/> for a description of the flags.
	    </entry>
	  </row>
	</tbody>
      </tgroup>
    </table>

    <table pgwide="1" frame="none" id="v4l2-dv-timings">
      <title>struct <structname>v4l2_dv_timings</structname></title>
      <tgroup cols="4">
	&cs-str;
	<tbody valign="top">
	  <row>
	    <entry>__u32</entry>
	    <entry><structfield>type</structfield></entry>
	    <entry></entry>
	    <entry>Type of DV timings as listed in <xref linkend="dv-timing-types"/>.</entry>
	  </row>
	  <row>
	    <entry>union</entry>
	    <entry><structfield></structfield></entry>
	    <entry></entry>
	  </row>
	  <row>
	    <entry></entry>
	    <entry>&v4l2-bt-timings;</entry>
	    <entry><structfield>bt</structfield></entry>
	    <entry>Timings defined by BT.656/1120 specifications</entry>
	  </row>
	  <row>
	    <entry></entry>
	    <entry>__u32</entry>
	    <entry><structfield>reserved</structfield>[32]</entry>
	    <entry></entry>
	  </row>
	</tbody>
      </tgroup>
    </table>

    <table pgwide="1" frame="none" id="dv-timing-types">
      <title>DV Timing types</title>
      <tgroup cols="3">
	&cs-str;
	<tbody valign="top">
	  <row>
	    <entry>Timing type</entry>
	    <entry>value</entry>
	    <entry>Description</entry>
	  </row>
	  <row>
	    <entry></entry>
	    <entry></entry>
	    <entry></entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_BT_656_1120</entry>
	    <entry>0</entry>
	    <entry>BT.656/1120 timings</entry>
	  </row>
	</tbody>
      </tgroup>
    </table>
    <table pgwide="1" frame="none" id="dv-bt-standards">
      <title>DV BT Timing standards</title>
      <tgroup cols="2">
	&cs-str;
	<tbody valign="top">
	  <row>
	    <entry>Timing standard</entry>
	    <entry>Description</entry>
	  </row>
	  <row>
	    <entry></entry>
	    <entry></entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_BT_STD_CEA861</entry>
	    <entry>The timings follow the CEA-861 Digital TV Profile standard</entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_BT_STD_DMT</entry>
	    <entry>The timings follow the VESA Discrete Monitor Timings standard</entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_BT_STD_CVT</entry>
	    <entry>The timings follow the VESA Coordinated Video Timings standard</entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_BT_STD_GTF</entry>
	    <entry>The timings follow the VESA Generalized Timings Formula standard</entry>
	  </row>
	</tbody>
      </tgroup>
    </table>
    <table pgwide="1" frame="none" id="dv-bt-flags">
      <title>DV BT Timing flags</title>
      <tgroup cols="2">
	&cs-str;
	<tbody valign="top">
	  <row>
	    <entry>Flag</entry>
	    <entry>Description</entry>
	  </row>
	  <row>
	    <entry></entry>
	    <entry></entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_FL_REDUCED_BLANKING</entry>
	    <entry>CVT/GTF specific: the timings use reduced blanking (CVT) or the 'Secondary
GTF' curve (GTF). In both cases the horizontal and/or vertical blanking
intervals are reduced, allowing a higher resolution over the same
bandwidth. This is a read-only flag, applications must not set this.
	    </entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_FL_CAN_REDUCE_FPS</entry>
	    <entry>CEA-861 specific: set for CEA-861 formats with a framerate that is a multiple
of six. These formats can be optionally played at 1 / 1.001 speed to
be compatible with 60 Hz based standards such as NTSC and PAL-M that use a framerate of
29.97 frames per second. If the transmitter can't generate such frequencies, then the
flag will also be cleared. This is a read-only flag, applications must not set this.
	    </entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_FL_REDUCED_FPS</entry>
	    <entry>CEA-861 specific: only valid for video transmitters, the flag is cleared
by receivers. It is also only valid for formats with the V4L2_DV_FL_CAN_REDUCE_FPS flag
set, for other formats the flag will be cleared by the driver.

If the application sets this flag, then the pixelclock used to set up the transmitter is
divided by 1.001 to make it compatible with NTSC framerates. If the transmitter
can't generate such frequencies, then the flag will also be cleared.
	    </entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_FL_HALF_LINE</entry>
	    <entry>Specific to interlaced formats: if set, then the vertical frontporch
of field 1 (aka the odd field) is really one half-line longer and the vertical backporch
of field 2 (aka the even field) is really one half-line shorter, so each field has exactly
the same number of half-lines. Whether half-lines can be detected or used depends on
the hardware.
	    </entry>
	  </row>
	  <row>
	    <entry>V4L2_DV_FL_IS_CE_VIDEO</entry>
	    <entry>If set, then this is a Consumer Electronics (CE) video format.
Such formats differ from other formats (commonly called IT formats) in that if
R'G'B' encoding is used then by default the R'G'B' values use limited range
(i.e. 16-235) as opposed to full range (i.e. 0-255). All formats defined in CEA-861
except for the 640x480p59.94 format are CE formats.
	    </entry>
	  </row>
	</tbody>
      </tgroup>
    </table>
  </refsect1>
</refentry>