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