Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[cascardo/linux.git] / Documentation / media / uapi / v4l / vidioc-g-sliced-vbi-cap.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_G_SLICED_VBI_CAP:
4
5 *****************************
6 ioctl VIDIOC_G_SLICED_VBI_CAP
7 *****************************
8
9 Name
10 ====
11
12 VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities
13
14
15 Synopsis
16 ========
17
18 .. c:function:: int ioctl( int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp )
19     :name: VIDIOC_G_SLICED_VBI_CAP
20
21
22 Arguments
23 =========
24
25 ``fd``
26     File descriptor returned by :ref:`open() <func-open>`.
27
28 ``argp``
29
30
31 Description
32 ===========
33
34 To find out which data services are supported by a sliced VBI capture or
35 output device, applications initialize the ``type`` field of a struct
36 :c:type:`v4l2_sliced_vbi_cap`, clear the
37 ``reserved`` array and call the :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl. The
38 driver fills in the remaining fields or returns an ``EINVAL`` error code if
39 the sliced VBI API is unsupported or ``type`` is invalid.
40
41 .. note::
42
43    The ``type`` field was added, and the ioctl changed from read-only
44    to write-read, in Linux 2.6.19.
45
46
47 .. c:type:: v4l2_sliced_vbi_cap
48
49 .. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|
50
51 .. flat-table:: struct v4l2_sliced_vbi_cap
52     :header-rows:  0
53     :stub-columns: 0
54     :widths:       3 3 2 2 2
55
56     * - __u16
57       - ``service_set``
58       - :cspan:`2` A set of all data services supported by the driver.
59
60         Equal to the union of all elements of the ``service_lines`` array.
61     * - __u16
62       - ``service_lines``\ [2][24]
63       - :cspan:`2` Each element of this array contains a set of data
64         services the hardware can look for or insert into a particular
65         scan line. Data services are defined in :ref:`vbi-services`.
66         Array indices map to ITU-R line numbers\ [#f1]_ as follows:
67     * -
68       -
69       - Element
70       - 525 line systems
71       - 625 line systems
72     * -
73       -
74       - ``service_lines``\ [0][1]
75       - 1
76       - 1
77     * -
78       -
79       - ``service_lines``\ [0][23]
80       - 23
81       - 23
82     * -
83       -
84       - ``service_lines``\ [1][1]
85       - 264
86       - 314
87     * -
88       -
89       - ``service_lines``\ [1][23]
90       - 286
91       - 336
92     * -
93     * -
94       -
95       - :cspan:`2` The number of VBI lines the hardware can capture or
96         output per frame, or the number of services it can identify on a
97         given line may be limited. For example on PAL line 16 the hardware
98         may be able to look for a VPS or Teletext signal, but not both at
99         the same time. Applications can learn about these limits using the
100         :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
101         :ref:`sliced`.
102     * -
103     * -
104       -
105       - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
106         ``service_lines``\ [1][0] to zero.
107     * - __u32
108       - ``type``
109       - Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
110         ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
111         ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
112     * - __u32
113       - ``reserved``\ [3]
114       - :cspan:`2` This array is reserved for future extensions.
115
116         Applications and drivers must set it to zero.
117
118 .. [#f1]
119
120    See also :ref:`vbi-525` and :ref:`vbi-625`.
121
122
123 .. raw:: latex
124
125     \begin{adjustbox}{width=\columnwidth}
126
127 .. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}|
128
129 .. _vbi-services:
130
131 .. flat-table:: Sliced VBI services
132     :header-rows:  1
133     :stub-columns: 0
134     :widths:       2 1 1 2 2
135
136     * - Symbol
137       - Value
138       - Reference
139       - Lines, usually
140       - Payload
141     * - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
142       - 0x0001
143       - :ref:`ets300706`,
144
145         :ref:`itu653`
146       - PAL/SECAM line 7-22, 320-335 (second field 7-22)
147       - Last 42 of the 45 byte Teletext packet, that is without clock
148         run-in and framing code, lsb first transmitted.
149     * - ``V4L2_SLICED_VPS``
150       - 0x0400
151       - :ref:`ets300231`
152       - PAL line 16
153       - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
154         first transmitted.
155     * - ``V4L2_SLICED_CAPTION_525``
156       - 0x1000
157       - :ref:`cea608`
158       - NTSC line 21, 284 (second field 21)
159       - Two bytes in transmission order, including parity bit, lsb first
160         transmitted.
161     * - ``V4L2_SLICED_WSS_625``
162       - 0x4000
163       - :ref:`en300294`,
164
165         :ref:`itu1119`
166       - PAL/SECAM line 23
167       -
168
169         ::
170
171             Byte        0                 1
172                  msb         lsb  msb           lsb
173             Bit  7 6 5 4 3 2 1 0  x x 13 12 11 10 9
174     * - ``V4L2_SLICED_VBI_525``
175       - 0x1000
176       - :cspan:`2` Set of services applicable to 525 line systems.
177     * - ``V4L2_SLICED_VBI_625``
178       - 0x4401
179       - :cspan:`2` Set of services applicable to 625 line systems.
180
181 .. raw:: latex
182
183     \end{adjustbox}\newline\newline
184
185
186 Return Value
187 ============
188
189 On success 0 is returned, on error -1 and the ``errno`` variable is set
190 appropriately. The generic error codes are described at the
191 :ref:`Generic Error Codes <gen-errors>` chapter.
192
193 EINVAL
194     The value in the ``type`` field is wrong.