← Documents Documentation/userspace-api/media/v4l/vidioc-g-sliced-vbi-cap.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_G_SLICED_VBI_CAP ioctl

Sliced VBI 장치의 서비스 집합과 주사선별 기능을 조회하고, 각 서비스의 표준·주사선·페이로드 및 WSS_625 비트 배치를 해석하는 방법을 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-g-sliced-vbi-cap.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

vidioc-g-sliced-vbi-cap.rst:1-202

기능 비트와 주사선 인덱스를 실제 방송 체계에 맞게 해석하고, 포맷 협상에서 동시 처리 한계를 별도로 확인해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_G_SLICED_VBI_CAP:
5
6 *****************************
7 ioctl VIDIOC_G_SLICED_VBI_CAP
8 *****************************
9
10 Name
11 ====
12
13 VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_G_SLICED_VBI_CAP
19
20 ``int ioctl(int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp)``
21
22 Arguments
23 =========
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``argp``
29 Pointer to struct :c:type:`v4l2_sliced_vbi_cap`.
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 .. c:type:: v4l2_sliced_vbi_cap
47
48 .. tabularcolumns:: |p{1.4cm}|p{4.4cm}|p{4.5cm}|p{3.6cm}|p{3.6cm}|
49
50 .. flat-table:: struct v4l2_sliced_vbi_cap
51 :header-rows: 0
52 :stub-columns: 0
53 :widths: 3 3 2 2 2
54
55 * - __u16
56 - ``service_set``
57 - :cspan:`2` A set of all data services supported by the driver.
58
59 Equal to the union of all elements of the ``service_lines`` array.
60 * - __u16
61 - ``service_lines``\ [2][24]
62 - :cspan:`2` Each element of this array contains a set of data
63 services the hardware can look for or insert into a particular
64 scan line. Data services are defined in :ref:`vbi-services`.
65 Array indices map to ITU-R line numbers\ [#f1]_ as follows:
66 * -
67 -
68 - Element
69 - 525 line systems
70 - 625 line systems
71 * -
72 -
73 - ``service_lines``\ [0][1]
74 - 1
75 - 1
76 * -
77 -
78 - ``service_lines``\ [0][23]
79 - 23
80 - 23
81 * -
82 -
83 - ``service_lines``\ [1][1]
84 - 264
85 - 314
86 * -
87 -
88 - ``service_lines``\ [1][23]
89 - 286
90 - 336
91 * -
92 * -
93 -
94 - :cspan:`2` The number of VBI lines the hardware can capture or
95 output per frame, or the number of services it can identify on a
96 given line may be limited. For example on PAL line 16 the hardware
97 may be able to look for a VPS or Teletext signal, but not both at
98 the same time. Applications can learn about these limits using the
99 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
100 :ref:`sliced`.
101 * -
102 * -
103 -
104 - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
105 ``service_lines``\ [1][0] to zero.
106 * - __u32
107 - ``type``
108 - Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
109 ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
110 ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
111 * - __u32
112 - ``reserved``\ [3]
113 - :cspan:`2` This array is reserved for future extensions.
114
115 Applications and drivers must set it to zero.
116
117 .. [#f1]
118
119 See also :ref:`vbi-525` and :ref:`vbi-625`.
120
121 .. raw:: latex
122
123 \scriptsize
124
125 .. tabularcolumns:: |p{3.9cm}|p{1.0cm}|p{2.0cm}|p{3.0cm}|p{7.0cm}|
126
127 .. _vbi-services:
128
129 .. flat-table:: Sliced VBI services
130 :header-rows: 1
131 :stub-columns: 0
132 :widths: 2 1 1 2 2
133
134 * - Symbol
135 - Value
136 - Reference
137 - Lines, usually
138 - Payload
139 * - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
140 - 0x0001
141 - :ref:`ets300706`,
142
143 :ref:`itu653`
144 - PAL/SECAM line 7-22, 320-335 (second field 7-22)
145 - Last 42 of the 45 byte Teletext packet, that is without clock
146 run-in and framing code, lsb first transmitted.
147 * - ``V4L2_SLICED_VPS``
148 - 0x0400
149 - :ref:`ets300231`
150 - PAL line 16
151 - Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
152 first transmitted.
153 * - ``V4L2_SLICED_CAPTION_525``
154 - 0x1000
155 - :ref:`cea608`
156 - NTSC line 21, 284 (second field 21)
157 - Two bytes in transmission order, including parity bit, lsb first
158 transmitted.
159 * - ``V4L2_SLICED_WSS_625``
160 - 0x4000
161 - :ref:`en300294`,
162
163 :ref:`itu1119`
164 - PAL/SECAM line 23
165 - See :ref:`v4l2-sliced-vbi-cap-wss-625-payload` below.
166 * - ``V4L2_SLICED_VBI_525``
167 - 0x1000
168 - :cspan:`2` Set of services applicable to 525 line systems.
169 * - ``V4L2_SLICED_VBI_625``
170 - 0x4401
171 - :cspan:`2` Set of services applicable to 625 line systems.
172
173
174 .. raw:: latex
175
176 \normalsize
177
178 .. _v4l2-sliced-vbi-cap-wss-625-payload:
179
180 V4L2_SLICED_VBI_CAP WSS_625 payload
181 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182
183 The payload for ``V4L2_SLICED_WSS_625`` is:
184
185 +-----+------------------+-----------------------+
186 |Byte | 0 | 1 |
187 +-----+--------+---------+-----------+-----------+
188 | | msb | lsb | msb | lsb |
189 | +-+-+-+--+--+-+-+--+--+-+--+---+---+--+-+--+
190 | Bit |7|6|5|4 | 3|2|1|0 | x|x|13|12 | 11|10|9|8 |
191 +-----+-+-+-+--+--+-+-+--+--+-+--+---+---+--+-+--+
192
193
194 Return Value
195 ============
196
197 On success 0 is returned, on error -1 and the ``errno`` variable is set
198 appropriately. The generic error codes are described at the
199 :ref:`Generic Error Codes <gen-errors>` chapter.
200
201 EINVAL
202 The value in the ``type`` field is wrong.
203

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

목적, 호출 형식과 인자

1-33

`VIDIOC_G_SLICED_VBI_CAP`은 sliced VBI 캡처 또는 출력 장치가 지원하는 데이터 서비스를 조회합니다. 호출자는 `struct v4l2_sliced_vbi_cap`을 가리키는 `argp`를 전달합니다.

호출 인자
항목내용
`fd``open()`이 반환한 파일 디스크립터
`argp``struct v4l2_sliced_vbi_cap`을 가리키는 포인터

ioctl 호출과 구조체 포인터의 역할입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _VIDIOC_G_SLICED_VBI_CAP:

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

Name
====

VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities

Synopsis
========

.. c:macro:: VIDIOC_G_SLICED_VBI_CAP

``int ioctl(int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to struct :c:type:`v4l2_sliced_vbi_cap`.

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

조회 절차와 Linux 2.6.19 변경

34-49

애플리케이션은 `type`에 조회할 데이터 스트림 형식을 지정하고 `reserved` 배열을 0으로 지운 다음 ioctl을 호출합니다. 드라이버는 나머지 필드를 채우며, sliced VBI API를 지원하지 않거나 `type`이 잘못되면 `EINVAL`을 반환합니다.

기능 조회 순서
1. `type`에 sliced VBI capture 또는 output 형식을 지정2. `reserved[3]`의 모든 원소를 0으로 초기화3. `VIDIOC_G_SLICED_VBI_CAP` 호출4. `service_set`과 `service_lines`에서 지원 기능 확인

입력 필드와 출력 필드를 구분해 호출해야 합니다.

`type` 필드는 Linux 2.6.19에서 추가되었습니다. 같은 시점에 이 ioctl의 방향도 읽기 전용에서 쓰기-읽기로 바뀌었으므로, 구조체의 입력 필드를 반드시 준비해야 합니다.

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.4cm}|p{4.4cm}|p{4.5cm}|p{3.6cm}|p{3.6cm}|

v4l2_sliced_vbi_cap 필드와 주사선 매핑

50-115
struct v4l2_sliced_vbi_cap
형식필드의미
`__u16``service_set`드라이버가 지원하는 모든 데이터 서비스의 집합. `service_lines` 전체 원소의 합집합과 같음
`__u16[2][24]``service_lines`특정 주사선에서 하드웨어가 찾거나 삽입할 수 있는 데이터 서비스의 집합
`__u32``type``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE` 또는 `V4L2_BUF_TYPE_SLICED_VBI_OUTPUT`
`__u32[3]``reserved[3]`향후 확장용. 애플리케이션과 드라이버가 모두 0으로 설정

드라이버가 보고하는 전체 서비스 집합과 주사선별 서비스 집합입니다.

service_lines 인덱스와 ITU-R 주사선
원소525줄 시스템625줄 시스템
`service_lines[0][1]`11
`service_lines[0][23]`2323
`service_lines[1][1]`264314
`service_lines[1][23]`286336

두 필드는 첫 번째·두 번째 field를 뜻하며, 시스템에 따라 실제 ITU-R 줄 번호가 달라집니다.

`service_lines[0][0]`과 `service_lines[1][0]`은 어떤 실제 주사선에도 대응하지 않으므로 드라이버가 반드시 0으로 설정합니다. 525줄·625줄 VBI 줄 번호에 관한 세부 사항은 원문의 `vbi-525`와 `vbi-625` 참조를 따릅니다.

하드웨어는 프레임당 캡처·출력할 VBI 줄 수나 한 줄에서 식별할 서비스 수에 제한이 있을 수 있습니다. 예를 들어 PAL 16번 줄에서 VPS와 Teletext를 각각 찾을 수 있어도 둘을 동시에 찾지는 못할 수 있습니다.

애플리케이션은 `VIDIOC_S_FMT`를 사용해 이러한 동시 처리 제한을 확인합니다. 단순히 `service_set`에 비트가 존재한다는 사실만으로 모든 서비스 조합이 동시에 가능하다고 가정하면 안 됩니다.

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

    * - __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.
    * - __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:
    * -
      -
      - Element
      - 525 line systems
      - 625 line systems
    * -
      -
      - ``service_lines``\ [0][1]
      - 1
      - 1
    * -
      -
      - ``service_lines``\ [0][23]
      - 23
      - 23
    * -
      -
      - ``service_lines``\ [1][1]
      - 264
      - 314
    * -
      -
      - ``service_lines``\ [1][23]
      - 286
      - 336
    * -
    * -
      -
      - :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`.
    * -
    * -
      -
      - :cspan:`2` Drivers must set ``service_lines`` [0][0] and
	``service_lines``\ [1][0] to zero.
    * - __u32
      - ``type``
      - Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
	``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
	``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
    * - __u32
      - ``reserved``\ [3]
      - :cspan:`2` This array is reserved for future extensions.

	Applications and drivers must set it to zero.

Sliced VBI 서비스 표의 정의

116-138

다음 서비스 값은 `service_set`과 `service_lines`의 비트 집합에 사용됩니다. 각 서비스는 적용 방송 체계, 통상적인 주사선, 전달되는 payload 형식을 함께 정의합니다.

원문의 LaTeX 전용 크기 지시문은 출력 표의 조판만 바꾸며 API 의미에는 영향을 주지 않습니다.


.. [#f1]

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

.. raw:: latex

    \scriptsize

.. tabularcolumns:: |p{3.9cm}|p{1.0cm}|p{2.0cm}|p{3.0cm}|p{7.0cm}|

.. _vbi-services:

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

    * - Symbol
      - Value
      - Reference
      - Lines, usually
      - Payload

지원 서비스와 페이로드

139-176
Sliced VBI 서비스
심볼주사선페이로드
`V4L2_SLICED_TELETEXT_B``0x0001`PAL/SECAM 7-22, 320-33545바이트 Teletext 패킷에서 clock run-in과 framing code를 뺀 마지막 42바이트, LSB 우선
`V4L2_SLICED_VPS``0x0400`PAL 16ETS 300 231 그림 9의 바이트 3-15, LSB 우선
`V4L2_SLICED_CAPTION_525``0x1000`NTSC 21, 284parity bit를 포함한 전송 순서의 2바이트, LSB 우선
`V4L2_SLICED_WSS_625``0x4000`PAL/SECAM 23아래 WSS_625 2바이트 비트 배치
`V4L2_SLICED_VBI_525``0x1000`525줄 시스템525줄 시스템에 적용되는 서비스 집합
`V4L2_SLICED_VBI_625``0x4401`625줄 시스템625줄 시스템에 적용되는 서비스 집합

값, 표준 참조, 통상적인 주사선과 사용자 공간에 전달되는 payload를 정리합니다.

Teletext System B는 ETS 300 706과 ITU 653을, VPS는 ETS 300 231을, 525-line caption은 CEA-608을, WSS 625는 EN 300 294와 ITU 1119를 참조합니다.

두 번째 field의 표기 320-335, 284는 괄호에 적힌 원래 field 내 줄 번호 7-22, 21에 대응합니다. 비트 값이 같은 `V4L2_SLICED_CAPTION_525`와 `V4L2_SLICED_VBI_525`는 각각 단일 서비스와 525줄 서비스 집합이라는 문맥으로 구분합니다.

    * - ``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.
    * - ``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.
    * - ``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.
    * - ``V4L2_SLICED_WSS_625``
      - 0x4000
      - :ref:`en300294`,

	:ref:`itu1119`
      - PAL/SECAM line 23
      - See :ref:`v4l2-sliced-vbi-cap-wss-625-payload` below.
    * - ``V4L2_SLICED_VBI_525``
      - 0x1000
      - :cspan:`2` Set of services applicable to 525 line systems.
    * - ``V4L2_SLICED_VBI_625``
      - 0x4401
      - :cspan:`2` Set of services applicable to 625 line systems.


.. raw:: latex

    \normalsize

WSS_625 페이로드 비트 배치

177-193

`V4L2_SLICED_WSS_625`의 payload는 2바이트입니다. 원문의 ASCII 그림을 같은 의미의 비트 표로 정리하면 다음과 같습니다.

WSS_625 2바이트 배치
바이트메모리 비트WSS 데이터
07 6 5 4 3 2 1 0WSS 비트 7 6 5 4 3 2 1 0
17 6 5 4 3 2 1 0미사용, 미사용, WSS 비트 13 12 11 10 9 8

바이트 0에는 WSS 비트 7-0, 바이트 1의 하위 6비트에는 WSS 비트 13-8이 들어갑니다.

두 바이트 모두 표의 왼쪽이 MSB, 오른쪽이 LSB입니다. 바이트 1의 상위 두 비트는 원문에서 `x`로 표시된 미사용 위치입니다.


.. _v4l2-sliced-vbi-cap-wss-625-payload:

V4L2_SLICED_VBI_CAP WSS_625 payload
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The payload for ``V4L2_SLICED_WSS_625`` is:

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

반환값과 오류

194-202

성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 설정하며, 공통 오류는 Generic Error Codes 절을 따릅니다.

전용 오류
errno조건
`EINVAL``type` 값이 잘못되었거나 sliced VBI API를 지원하지 않음

이 ioctl이 명시하는 추가 오류입니다.

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.