blob: c76f5682ad0ab54195b9d79e72554e9546cc3c88 [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
3.. _vidioc-g-sliced-vbi-cap:
4
5*****************************
6ioctl VIDIOC_G_SLICED_VBI_CAP
7*****************************
8
9*man VIDIOC_G_SLICED_VBI_CAP(2)*
10
11Query sliced VBI capabilities
12
13
14Synopsis
15========
16
17.. c:function:: int ioctl( int fd, int request, struct v4l2_sliced_vbi_cap *argp )
18
19Arguments
20=========
21
22``fd``
23 File descriptor returned by :ref:`open() <func-open>`.
24
25``request``
26 VIDIOC_G_SLICED_VBI_CAP
27
28``argp``
29
30
31Description
32===========
33
34To find out which data services are supported by a sliced VBI capture or
35output device, applications initialize the ``type`` field of a struct
36:ref:`v4l2_sliced_vbi_cap <v4l2-sliced-vbi-cap>`, clear the
37``reserved`` array and call the ``VIDIOC_G_SLICED_VBI_CAP`` ioctl. The
38driver fills in the remaining fields or returns an EINVAL error code if
39the sliced VBI API is unsupported or ``type`` is invalid.
40
41Note the ``type`` field was added, and the ioctl changed from read-only
42to write-read, in Linux 2.6.19.
43
44
45.. _v4l2-sliced-vbi-cap:
46
47.. flat-table:: struct v4l2_sliced_vbi_cap
48 :header-rows: 0
49 :stub-columns: 0
50 :widths: 3 3 2 2 2
51
52
53 - .. row 1
54
55 - __u16
56
57 - ``service_set``
58
59 - :cspan:`2` A set of all data services supported by the driver.
60 Equal to the union of all elements of the ``service_lines`` array.
61
62 - .. row 2
63
64 - __u16
65
66 - ``service_lines``\ [2][24]
67
68 - :cspan:`2` Each element of this array contains a set of data
69 services the hardware can look for or insert into a particular
70 scan line. Data services are defined in :ref:`vbi-services`.
71 Array indices map to ITU-R line numbers (see also :ref:`vbi-525`
72 and :ref:`vbi-625`) as follows:
73
74 - .. row 3
75
76 -
77 -
78 - Element
79
80 - 525 line systems
81
82 - 625 line systems
83
84 - .. row 4
85
86 -
87 -
88 - ``service_lines``\ [0][1]
89
90 - 1
91
92 - 1
93
94 - .. row 5
95
96 -
97 -
98 - ``service_lines``\ [0][23]
99
100 - 23
101
102 - 23
103
104 - .. row 6
105
106 -
107 -
108 - ``service_lines``\ [1][1]
109
110 - 264
111
112 - 314
113
114 - .. row 7
115
116 -
117 -
118 - ``service_lines``\ [1][23]
119
120 - 286
121
122 - 336
123
124 - .. row 8
125
126 -
127
128 - .. row 9
129
130 -
131 -
132 - :cspan:`2` The number of VBI lines the hardware can capture or
133 output per frame, or the number of services it can identify on a
134 given line may be limited. For example on PAL line 16 the hardware
135 may be able to look for a VPS or Teletext signal, but not both at
136 the same time. Applications can learn about these limits using the
137 :ref:`VIDIOC_S_FMT <vidioc-g-fmt>` ioctl as described in
138 :ref:`sliced`.
139
140 - .. row 10
141
142 -
143
144 - .. row 11
145
146 -
147 -
148 - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
149 ``service_lines``\ [1][0] to zero.
150
151 - .. row 12
152
153 - __u32
154
155 - ``type``
156
157 - Type of the data stream, see :ref:`v4l2-buf-type`. Should be
158 ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
159 ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
160
161 - .. row 13
162
163 - __u32
164
165 - ``reserved``\ [3]
166
167 - :cspan:`2` This array is reserved for future extensions.
168 Applications and drivers must set it to zero.
169
170
171
172.. _vbi-services:
173
174.. flat-table:: Sliced VBI services
175 :header-rows: 1
176 :stub-columns: 0
177 :widths: 2 1 1 2 2
178
179
180 - .. row 1
181
182 - Symbol
183
184 - Value
185
186 - Reference
187
188 - Lines, usually
189
190 - Payload
191
192 - .. row 2
193
194 - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
195
196 - 0x0001
197
198 - :ref:`ets300706`, :ref:`itu653`
199
200 - PAL/SECAM line 7-22, 320-335 (second field 7-22)
201
202 - Last 42 of the 45 byte Teletext packet, that is without clock
203 run-in and framing code, lsb first transmitted.
204
205 - .. row 3
206
207 - ``V4L2_SLICED_VPS``
208
209 - 0x0400
210
211 - :ref:`ets300231`
212
213 - PAL line 16
214
215 - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
216 first transmitted.
217
218 - .. row 4
219
220 - ``V4L2_SLICED_CAPTION_525``
221
222 - 0x1000
223
224 - :ref:`cea608`
225
226 - NTSC line 21, 284 (second field 21)
227
228 - Two bytes in transmission order, including parity bit, lsb first
229 transmitted.
230
231 - .. row 5
232
233 - ``V4L2_SLICED_WSS_625``
234
235 - 0x4000
236
237 - :ref:`en300294`, :ref:`itu1119`
238
239 - PAL/SECAM line 23
240
241 -
242
243 ::
244
245 Byte 0 1
246 msb lsb msb lsb
247 Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
248
249 - .. row 6
250
251 - ``V4L2_SLICED_VBI_525``
252
253 - 0x1000
254
255 - :cspan:`2` Set of services applicable to 525 line systems.
256
257 - .. row 7
258
259 - ``V4L2_SLICED_VBI_625``
260
261 - 0x4401
262
263 - :cspan:`2` Set of services applicable to 625 line systems.
264
265
266
267Return Value
268============
269
270On success 0 is returned, on error -1 and the ``errno`` variable is set
271appropriately. The generic error codes are described at the
272:ref:`Generic Error Codes <gen-errors>` chapter.
273
274EINVAL
275 The value in the ``type`` field is wrong.
276
277
278.. ------------------------------------------------------------------------------
279.. This file was automatically converted from DocBook-XML with the dbxml
280.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
281.. from the linux kernel, refer to:
282..
283.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
284.. ------------------------------------------------------------------------------