18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci.. c:namespace:: V4L
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci.. _VIDIOC_G_SLICED_VBI_CAP:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci*****************************
78c2ecf20Sopenharmony_ciioctl VIDIOC_G_SLICED_VBI_CAP
88c2ecf20Sopenharmony_ci*****************************
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciName
118c2ecf20Sopenharmony_ci====
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciVIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciSynopsis
168c2ecf20Sopenharmony_ci========
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci.. c:macro:: VIDIOC_G_SLICED_VBI_CAP
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci``int ioctl(int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp)``
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciArguments
238c2ecf20Sopenharmony_ci=========
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci``fd``
268c2ecf20Sopenharmony_ci    File descriptor returned by :c:func:`open()`.
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci``argp``
298c2ecf20Sopenharmony_ci    Pointer to struct :c:type:`v4l2_sliced_vbi_cap`.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciDescription
328c2ecf20Sopenharmony_ci===========
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciTo find out which data services are supported by a sliced VBI capture or
358c2ecf20Sopenharmony_cioutput device, applications initialize the ``type`` field of a struct
368c2ecf20Sopenharmony_ci:c:type:`v4l2_sliced_vbi_cap`, clear the
378c2ecf20Sopenharmony_ci``reserved`` array and call the :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl. The
388c2ecf20Sopenharmony_cidriver fills in the remaining fields or returns an ``EINVAL`` error code if
398c2ecf20Sopenharmony_cithe sliced VBI API is unsupported or ``type`` is invalid.
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci.. note::
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci   The ``type`` field was added, and the ioctl changed from read-only
448c2ecf20Sopenharmony_ci   to write-read, in Linux 2.6.19.
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci.. c:type:: v4l2_sliced_vbi_cap
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci.. flat-table:: struct v4l2_sliced_vbi_cap
518c2ecf20Sopenharmony_ci    :header-rows:  0
528c2ecf20Sopenharmony_ci    :stub-columns: 0
538c2ecf20Sopenharmony_ci    :widths:       3 3 2 2 2
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci    * - __u16
568c2ecf20Sopenharmony_ci      - ``service_set``
578c2ecf20Sopenharmony_ci      - :cspan:`2` A set of all data services supported by the driver.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci	Equal to the union of all elements of the ``service_lines`` array.
608c2ecf20Sopenharmony_ci    * - __u16
618c2ecf20Sopenharmony_ci      - ``service_lines``\ [2][24]
628c2ecf20Sopenharmony_ci      - :cspan:`2` Each element of this array contains a set of data
638c2ecf20Sopenharmony_ci	services the hardware can look for or insert into a particular
648c2ecf20Sopenharmony_ci	scan line. Data services are defined in :ref:`vbi-services`.
658c2ecf20Sopenharmony_ci	Array indices map to ITU-R line numbers\ [#f1]_ as follows:
668c2ecf20Sopenharmony_ci    * -
678c2ecf20Sopenharmony_ci      -
688c2ecf20Sopenharmony_ci      - Element
698c2ecf20Sopenharmony_ci      - 525 line systems
708c2ecf20Sopenharmony_ci      - 625 line systems
718c2ecf20Sopenharmony_ci    * -
728c2ecf20Sopenharmony_ci      -
738c2ecf20Sopenharmony_ci      - ``service_lines``\ [0][1]
748c2ecf20Sopenharmony_ci      - 1
758c2ecf20Sopenharmony_ci      - 1
768c2ecf20Sopenharmony_ci    * -
778c2ecf20Sopenharmony_ci      -
788c2ecf20Sopenharmony_ci      - ``service_lines``\ [0][23]
798c2ecf20Sopenharmony_ci      - 23
808c2ecf20Sopenharmony_ci      - 23
818c2ecf20Sopenharmony_ci    * -
828c2ecf20Sopenharmony_ci      -
838c2ecf20Sopenharmony_ci      - ``service_lines``\ [1][1]
848c2ecf20Sopenharmony_ci      - 264
858c2ecf20Sopenharmony_ci      - 314
868c2ecf20Sopenharmony_ci    * -
878c2ecf20Sopenharmony_ci      -
888c2ecf20Sopenharmony_ci      - ``service_lines``\ [1][23]
898c2ecf20Sopenharmony_ci      - 286
908c2ecf20Sopenharmony_ci      - 336
918c2ecf20Sopenharmony_ci    * -
928c2ecf20Sopenharmony_ci    * -
938c2ecf20Sopenharmony_ci      -
948c2ecf20Sopenharmony_ci      - :cspan:`2` The number of VBI lines the hardware can capture or
958c2ecf20Sopenharmony_ci	output per frame, or the number of services it can identify on a
968c2ecf20Sopenharmony_ci	given line may be limited. For example on PAL line 16 the hardware
978c2ecf20Sopenharmony_ci	may be able to look for a VPS or Teletext signal, but not both at
988c2ecf20Sopenharmony_ci	the same time. Applications can learn about these limits using the
998c2ecf20Sopenharmony_ci	:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
1008c2ecf20Sopenharmony_ci	:ref:`sliced`.
1018c2ecf20Sopenharmony_ci    * -
1028c2ecf20Sopenharmony_ci    * -
1038c2ecf20Sopenharmony_ci      -
1048c2ecf20Sopenharmony_ci      - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
1058c2ecf20Sopenharmony_ci	``service_lines``\ [1][0] to zero.
1068c2ecf20Sopenharmony_ci    * - __u32
1078c2ecf20Sopenharmony_ci      - ``type``
1088c2ecf20Sopenharmony_ci      - Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
1098c2ecf20Sopenharmony_ci	``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
1108c2ecf20Sopenharmony_ci	``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
1118c2ecf20Sopenharmony_ci    * - __u32
1128c2ecf20Sopenharmony_ci      - ``reserved``\ [3]
1138c2ecf20Sopenharmony_ci      - :cspan:`2` This array is reserved for future extensions.
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci	Applications and drivers must set it to zero.
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci.. [#f1]
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci   See also :ref:`vbi-525` and :ref:`vbi-625`.
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci.. raw:: latex
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci    \scriptsize
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{3.5cm}|p{1.0cm}|p{2.0cm}|p{2.0cm}|p{8.0cm}|
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci.. _vbi-services:
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci.. flat-table:: Sliced VBI services
1308c2ecf20Sopenharmony_ci    :header-rows:  1
1318c2ecf20Sopenharmony_ci    :stub-columns: 0
1328c2ecf20Sopenharmony_ci    :widths:       2 1 1 2 2
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci    * - Symbol
1358c2ecf20Sopenharmony_ci      - Value
1368c2ecf20Sopenharmony_ci      - Reference
1378c2ecf20Sopenharmony_ci      - Lines, usually
1388c2ecf20Sopenharmony_ci      - Payload
1398c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
1408c2ecf20Sopenharmony_ci      - 0x0001
1418c2ecf20Sopenharmony_ci      - :ref:`ets300706`,
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci	:ref:`itu653`
1448c2ecf20Sopenharmony_ci      - PAL/SECAM line 7-22, 320-335 (second field 7-22)
1458c2ecf20Sopenharmony_ci      - Last 42 of the 45 byte Teletext packet, that is without clock
1468c2ecf20Sopenharmony_ci	run-in and framing code, lsb first transmitted.
1478c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_VPS``
1488c2ecf20Sopenharmony_ci      - 0x0400
1498c2ecf20Sopenharmony_ci      - :ref:`ets300231`
1508c2ecf20Sopenharmony_ci      - PAL line 16
1518c2ecf20Sopenharmony_ci      - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
1528c2ecf20Sopenharmony_ci	first transmitted.
1538c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_CAPTION_525``
1548c2ecf20Sopenharmony_ci      - 0x1000
1558c2ecf20Sopenharmony_ci      - :ref:`cea608`
1568c2ecf20Sopenharmony_ci      - NTSC line 21, 284 (second field 21)
1578c2ecf20Sopenharmony_ci      - Two bytes in transmission order, including parity bit, lsb first
1588c2ecf20Sopenharmony_ci	transmitted.
1598c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_WSS_625``
1608c2ecf20Sopenharmony_ci      - 0x4000
1618c2ecf20Sopenharmony_ci      - :ref:`en300294`,
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci	:ref:`itu1119`
1648c2ecf20Sopenharmony_ci      - PAL/SECAM line 23
1658c2ecf20Sopenharmony_ci      -
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci	::
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	    Byte        0                 1
1708c2ecf20Sopenharmony_ci		 msb         lsb  msb           lsb
1718c2ecf20Sopenharmony_ci	    Bit  7 6 5 4 3 2 1 0  x x 13 12 11 10 9
1728c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_VBI_525``
1738c2ecf20Sopenharmony_ci      - 0x1000
1748c2ecf20Sopenharmony_ci      - :cspan:`2` Set of services applicable to 525 line systems.
1758c2ecf20Sopenharmony_ci    * - ``V4L2_SLICED_VBI_625``
1768c2ecf20Sopenharmony_ci      - 0x4401
1778c2ecf20Sopenharmony_ci      - :cspan:`2` Set of services applicable to 625 line systems.
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci.. raw:: latex
1808c2ecf20Sopenharmony_ci
1818c2ecf20Sopenharmony_ci    \normalsize
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ciReturn Value
1848c2ecf20Sopenharmony_ci============
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
1878c2ecf20Sopenharmony_ciappropriately. The generic error codes are described at the
1888c2ecf20Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ciEINVAL
1918c2ecf20Sopenharmony_ci    The value in the ``type`` field is wrong.
192