summaryrefslogtreecommitdiff
path: root/Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst
blob: 4df7227e0490da7953fba0892ce188c02732ab6d (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
.. -*- coding: utf-8; mode: rst -*-

.. _VIDIOC_G_SLICED_VBI_CAP:

*****************************
ioctl VIDIOC_G_SLICED_VBI_CAP
*****************************

Name
====

VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities


Synopsis
========

.. c:function:: int ioctl( int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp )
    :name: VIDIOC_G_SLICED_VBI_CAP


Arguments
=========

``fd``
    File descriptor returned by :ref:`open() <func-open>`.

``argp``


Description
===========

To find out which data services are supported by a sliced VBI capture or
output device, applications initialize the ``type`` field of a struct
:c:type:`v4l2_sliced_vbi_cap`, clear the
``reserved`` array and call the :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl. The
driver fills in the remaining fields or returns an ``EINVAL`` error code if
the sliced VBI API is unsupported or ``type`` is invalid.

.. note::

   The ``type`` field was added, and the ioctl changed from read-only
   to write-read, in Linux 2.6.19.


.. c:type:: v4l2_sliced_vbi_cap

.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|

.. flat-table:: struct v4l2_sliced_vbi_cap
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 3 2 2 2


    -  .. row 1

       -  __u16

       -  ``service_set``

       -  :cspan:`2` A set of all data services supported by the driver.

	  Equal to the union of all elements of the ``service_lines`` array.

    -  .. row 2

       -  __u16

       -  ``service_lines``\ [2][24]

       -  :cspan:`2` Each element of this array contains a set of data
	  services the hardware can look for or insert into a particular
	  scan line. Data services are defined in :ref:`vbi-services`.
	  Array indices map to ITU-R line numbers\ [#f1]_ as follows:

    -  .. row 3

       -
       -
       -  Element

       -  525 line systems

       -  625 line systems

    -  .. row 4

       -
       -
       -  ``service_lines``\ [0][1]

       -  1

       -  1

    -  .. row 5

       -
       -
       -  ``service_lines``\ [0][23]

       -  23

       -  23

    -  .. row 6

       -
       -
       -  ``service_lines``\ [1][1]

       -  264

       -  314

    -  .. row 7

       -
       -
       -  ``service_lines``\ [1][23]

       -  286

       -  336

    -  .. row 8

       -

    -  .. row 9

       -
       -
       -  :cspan:`2` The number of VBI lines the hardware can capture or
	  output per frame, or the number of services it can identify on a
	  given line may be limited. For example on PAL line 16 the hardware
	  may be able to look for a VPS or Teletext signal, but not both at
	  the same time. Applications can learn about these limits using the
	  :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
	  :ref:`sliced`.

    -  .. row 10

       -

    -  .. row 11

       -
       -
       -  :cspan:`2` Drivers must set ``service_lines`` [0][0] and
	  ``service_lines``\ [1][0] to zero.

    -  .. row 12

       -  __u32

       -  ``type``

       -  Type of the data stream, see :ref:`v4l2-buf-type`. Should be
	  ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
	  ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.

    -  .. row 13

       -  __u32

       -  ``reserved``\ [3]

       -  :cspan:`2` This array is reserved for future extensions.

	  Applications and drivers must set it to zero.

.. [#f1]

   See also :ref:`vbi-525` and :ref:`vbi-625`.


.. raw:: latex

    \begin{adjustbox}{width=\columnwidth}

.. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}|

.. _vbi-services:

.. flat-table:: Sliced VBI services
    :header-rows:  1
    :stub-columns: 0
    :widths:       2 1 1 2 2


    -  .. row 1

       -  Symbol

       -  Value

       -  Reference

       -  Lines, usually

       -  Payload

    -  .. row 2

       -  ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)

       -  0x0001

       -  :ref:`ets300706`,

	  :ref:`itu653`

       -  PAL/SECAM line 7-22, 320-335 (second field 7-22)

       -  Last 42 of the 45 byte Teletext packet, that is without clock
	  run-in and framing code, lsb first transmitted.

    -  .. row 3

       -  ``V4L2_SLICED_VPS``

       -  0x0400

       -  :ref:`ets300231`

       -  PAL line 16

       -  Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
	  first transmitted.

    -  .. row 4

       -  ``V4L2_SLICED_CAPTION_525``

       -  0x1000

       -  :ref:`cea608`

       -  NTSC line 21, 284 (second field 21)

       -  Two bytes in transmission order, including parity bit, lsb first
	  transmitted.

    -  .. row 5

       -  ``V4L2_SLICED_WSS_625``

       -  0x4000

       -  :ref:`en300294`,

	  :ref:`itu1119`

       -  PAL/SECAM line 23

       -

	  ::

	      Byte        0                 1
		   msb         lsb  msb           lsb
	      Bit  7 6 5 4 3 2 1 0  x x 13 12 11 10 9

    -  .. row 6

       -  ``V4L2_SLICED_VBI_525``

       -  0x1000

       -  :cspan:`2` Set of services applicable to 525 line systems.

    -  .. row 7

       -  ``V4L2_SLICED_VBI_625``

       -  0x4401

       -  :cspan:`2` Set of services applicable to 625 line systems.

.. raw:: latex

    \end{adjustbox}\newline\newline


Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.

EINVAL
    The value in the ``type`` field is wrong.