← Documents Documentation/userspace-api/media/v4l/vidioc-enumoutput.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_ENUMOUTPUT ioctl

V4L2 비디오 출력을 index 순서로 열거하고 v4l2_output의 오디오 연결, RF modulator·표준, 출력 유형과 capability 및 오류 조건을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

vidioc-enumoutput.rst:1-153

V4L2 비디오 출력을 index 순서로 열거하고 v4l2_output의 오디오 연결, RF modulator·표준, 출력 유형과 capability 및 오류 조건을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_ENUMOUTPUT:
5
6 ***********************
7 ioctl VIDIOC_ENUMOUTPUT
8 ***********************
9
10 Name
11 ====
12
13 VIDIOC_ENUMOUTPUT - Enumerate video outputs
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_ENUMOUTPUT
19
20 ``int ioctl(int fd, VIDIOC_ENUMOUTPUT, struct v4l2_output *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_output`.
30
31 Description
32 ===========
33
34 To query the attributes of a video outputs applications initialize the
35 ``index`` field of struct :c:type:`v4l2_output` and call
36 the :ref:`VIDIOC_ENUMOUTPUT` with a pointer to this structure.
37 Drivers fill the rest of the structure or return an ``EINVAL`` error code
38 when the index is out of bounds. To enumerate all outputs applications
39 shall begin at index zero, incrementing by one until the driver returns
40 ``EINVAL``.
41
42 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
43
44 .. c:type:: v4l2_output
45
46 .. flat-table:: struct v4l2_output
47 :header-rows: 0
48 :stub-columns: 0
49 :widths: 1 1 2
50
51 * - __u32
52 - ``index``
53 - Identifies the output, set by the application.
54 * - __u8
55 - ``name``\ [32]
56 - Name of the video output, a NUL-terminated ASCII string, for
57 example: "Vout". This information is intended for the user,
58 preferably the connector label on the device itself.
59 * - __u32
60 - ``type``
61 - Type of the output, see :ref:`output-type`.
62 * - __u32
63 - ``audioset``
64 - Drivers can enumerate up to 32 video and audio outputs. This field
65 shows which audio outputs were selectable as the current output if
66 this was the currently selected video output. It is a bit mask.
67 The LSB corresponds to audio output 0, the MSB to output 31. Any
68 number of bits can be set, or none.
69
70 When the driver does not enumerate audio outputs no bits must be
71 set. Applications shall not interpret this as lack of audio
72 support. Drivers may automatically select audio outputs without
73 enumerating them.
74
75 For details on audio outputs and how to select the current output
76 see :ref:`audio`.
77 * - __u32
78 - ``modulator``
79 - Output devices can have zero or more RF modulators. When the
80 ``type`` is ``V4L2_OUTPUT_TYPE_MODULATOR`` this is an RF connector
81 and this field identifies the modulator. It corresponds to struct
82 :c:type:`v4l2_modulator` field ``index``. For
83 details on modulators see :ref:`tuner`.
84 * - :ref:`v4l2_std_id <v4l2-std-id>`
85 - ``std``
86 - Every video output supports one or more different video standards.
87 This field is a set of all supported standards. For details on
88 video standards and how to switch see :ref:`standard`.
89 * - __u32
90 - ``capabilities``
91 - This field provides capabilities for the output. See
92 :ref:`output-capabilities` for flags.
93 * - __u32
94 - ``reserved``\ [3]
95 - Reserved for future extensions. Drivers must set the array to
96 zero.
97
98
99 .. tabularcolumns:: |p{7.5cm}|p{0.6cm}|p{9.2cm}|
100
101 .. _output-type:
102
103 .. flat-table:: Output Type
104 :header-rows: 0
105 :stub-columns: 0
106 :widths: 3 1 4
107
108 * - ``V4L2_OUTPUT_TYPE_MODULATOR``
109 - 1
110 - This output is an analog TV modulator.
111 * - ``V4L2_OUTPUT_TYPE_ANALOG``
112 - 2
113 - Any non-modulator video output, for example Composite Video,
114 S-Video, HDMI. The naming as ``_TYPE_ANALOG`` is historical,
115 today we would have called it ``_TYPE_VIDEO``.
116 * - ``V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY``
117 - 3
118 - The video output will be copied to a :ref:`video overlay <overlay>`.
119
120
121 .. tabularcolumns:: |p{6.4cm}|p{2.4cm}|p{8.5cm}|
122
123 .. _output-capabilities:
124
125 .. flat-table:: Output capabilities
126 :header-rows: 0
127 :stub-columns: 0
128 :widths: 3 1 4
129
130 * - ``V4L2_OUT_CAP_DV_TIMINGS``
131 - 0x00000002
132 - This output supports setting video timings by using
133 ``VIDIOC_S_DV_TIMINGS``.
134 * - ``V4L2_OUT_CAP_STD``
135 - 0x00000004
136 - This output supports setting the TV standard by using
137 ``VIDIOC_S_STD``.
138 * - ``V4L2_OUT_CAP_NATIVE_SIZE``
139 - 0x00000008
140 - This output supports setting the native size using the
141 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
142 :ref:`v4l2-selections-common`.
143
144 Return Value
145 ============
146
147 On success 0 is returned, on error -1 and the ``errno`` variable is set
148 appropriately. The generic error codes are described at the
149 :ref:`Generic Error Codes <gen-errors>` chapter.
150
151 EINVAL
152 The struct :c:type:`v4l2_output` ``index`` is out of
153 bounds.
154

3. 한국어 전문 번역

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

목적, 호출 형식과 인자

1-30

`VIDIOC_ENUMOUTPUT`은 비디오 출력을 열거하는 ioctl입니다. 호출 형식은 `int ioctl(int fd, VIDIOC_ENUMOUTPUT, struct v4l2_output *argp)`입니다.

`fd`는 `open()`이 반환한 파일 디스크립터이며, `argp`는 조회할 출력 순번과 드라이버가 반환하는 출력 속성을 담는 `struct v4l2_output`을 가리킵니다.

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

.. _VIDIOC_ENUMOUTPUT:

***********************
ioctl VIDIOC_ENUMOUTPUT
***********************

Name
====

VIDIOC_ENUMOUTPUT - Enumerate video outputs

Synopsis
========

.. c:macro:: VIDIOC_ENUMOUTPUT

``int ioctl(int fd, VIDIOC_ENUMOUTPUT, struct v4l2_output *argp)``

Arguments
=========

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

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

비디오 출력 열거 절차

31-40

응용 프로그램은 `v4l2_output.index`에 조회할 출력 순번을 넣고 `VIDIOC_ENUMOUTPUT`을 호출합니다. 드라이버는 구조체의 나머지 필드를 채우며, index가 범위를 벗어나면 `EINVAL`을 반환합니다.

모든 출력을 조사하려면 index 0에서 시작해 한 번에 1씩 증가시키고, 드라이버가 `EINVAL`을 반환할 때 열거를 끝냅니다.

연속 열거에서 `EINVAL`은 더 이상 출력이 없다는 종료 표지이며, 특정 index를 직접 조회할 때는 요청한 순번이 유효하지 않다는 오류입니다.

비디오 출력 열거
v4l2_output 준비index=0 설정VIDIOC_ENUMOUTPUT 호출반환된 출력 속성 기록index를 1 증가EINVAL에서 종료

연속된 출력 순번을 조회해 장치가 제공하는 모든 출력을 수집합니다.

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

To query the attributes of a video outputs applications initialize the
``index`` field of struct :c:type:`v4l2_output` and call
the :ref:`VIDIOC_ENUMOUTPUT` with a pointer to this structure.
Drivers fill the rest of the structure or return an ``EINVAL`` error code
when the index is out of bounds. To enumerate all outputs applications
shall begin at index zero, incrementing by one until the driver returns
``EINVAL``.

v4l2_output 구조체

41-97
struct v4l2_output
형식필드의미
`__u32``index`응용 프로그램이 설정하는 비디오 출력 식별 순번
`__u8[32]``name`NUL로 끝나는 ASCII 출력 이름. 사용자에게 보여 줄 정보이며 장치 자체의 커넥터 라벨을 쓰는 것이 바람직함
`__u32``type`출력 유형. Output Type 표의 상수 사용
`__u32``audioset`현재 비디오 출력을 선택했을 때 현재 출력으로 선택할 수 있는 오디오 출력을 나타내는 32비트 마스크
`__u32``modulator``type`이 `V4L2_OUTPUT_TYPE_MODULATOR`일 때 이 RF 커넥터에 연결된 modulator 순번
`v4l2_std_id``std`이 비디오 출력이 지원하는 모든 비디오 표준의 집합
`__u32``capabilities`출력이 제공하는 기능 플래그
`__u32[3]``reserved`미래 확장용 배열. 드라이버가 모두 0으로 설정해야 함

응용 프로그램이 지정하는 값과 드라이버가 반환하는 출력 속성을 원문 순서대로 정리합니다.

`name`은 `Vout` 같은 NUL 종료 ASCII 문자열입니다. 사용자가 실제 단자를 식별할 수 있도록 장치에 인쇄된 커넥터 이름을 제공하는 것이 좋습니다.

`audioset`은 최대 32개의 오디오 출력과 비디오 출력 사이의 선택 가능 관계를 나타냅니다. 최하위 비트는 오디오 출력 0, 최상위 비트는 출력 31에 대응하며 비트가 여러 개 설정되거나 하나도 설정되지 않을 수 있습니다.

드라이버가 오디오 출력을 별도로 열거하지 않는다면 `audioset`의 모든 비트가 0이어야 합니다. 그러나 이를 오디오 미지원으로 해석해서는 안 됩니다. 드라이버가 오디오 출력을 열거하지 않고 자동 선택할 수 있기 때문입니다. 오디오 출력 조회와 현재 출력 선택은 `audio` 문서를 따릅니다.

`type`이 `V4L2_OUTPUT_TYPE_MODULATOR`이면 `modulator`는 `struct v4l2_modulator.index`와 같은 RF modulator 순번입니다. 관련 modulator 규칙은 `tuner` 문서에 정의됩니다.

`std`는 이 출력이 지원하는 비디오 표준 전체를 나타냅니다. 표준 전환 방법은 `standard` 문서를 따르며, `reserved[3]`은 드라이버가 반드시 0으로 반환해야 합니다.


.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

.. c:type:: v4l2_output

.. flat-table:: struct v4l2_output
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``index``
      - Identifies the output, set by the application.
    * - __u8
      - ``name``\ [32]
      - Name of the video output, a NUL-terminated ASCII string, for
	example: "Vout". This information is intended for the user,
	preferably the connector label on the device itself.
    * - __u32
      - ``type``
      - Type of the output, see :ref:`output-type`.
    * - __u32
      - ``audioset``
      - Drivers can enumerate up to 32 video and audio outputs. This field
	shows which audio outputs were selectable as the current output if
	this was the currently selected video output. It is a bit mask.
	The LSB corresponds to audio output 0, the MSB to output 31. Any
	number of bits can be set, or none.

	When the driver does not enumerate audio outputs no bits must be
	set. Applications shall not interpret this as lack of audio
	support. Drivers may automatically select audio outputs without
	enumerating them.

	For details on audio outputs and how to select the current output
	see :ref:`audio`.
    * - __u32
      - ``modulator``
      - Output devices can have zero or more RF modulators. When the
	``type`` is ``V4L2_OUTPUT_TYPE_MODULATOR`` this is an RF connector
	and this field identifies the modulator. It corresponds to struct
	:c:type:`v4l2_modulator` field ``index``. For
	details on modulators see :ref:`tuner`.
    * - :ref:`v4l2_std_id <v4l2-std-id>`
      - ``std``
      - Every video output supports one or more different video standards.
	This field is a set of all supported standards. For details on
	video standards and how to switch see :ref:`standard`.
    * - __u32
      - ``capabilities``
      - This field provides capabilities for the output. See
	:ref:`output-capabilities` for flags.
    * - __u32
      - ``reserved``\ [3]
      - Reserved for future extensions. Drivers must set the array to
	zero.

출력 유형

98-120
Output Type
상수의미
`V4L2_OUTPUT_TYPE_MODULATOR``1`아날로그 TV modulator 출력
`V4L2_OUTPUT_TYPE_ANALOG``2`Composite Video, S-Video, HDMI 등 modulator가 아닌 모든 비디오 출력
`V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY``3`비디오 출력을 video overlay로 복사하는 출력

`v4l2_output.type`에 반환되는 출력 유형입니다.

`V4L2_OUTPUT_TYPE_ANALOG`라는 이름은 역사적인 명칭입니다. HDMI도 이 유형에 포함되며, 현재 API를 새로 이름 붙였다면 `V4L2_OUTPUT_TYPE_VIDEO`에 가까운 의미입니다.


.. tabularcolumns:: |p{7.5cm}|p{0.6cm}|p{9.2cm}|

.. _output-type:

.. flat-table:: Output Type
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_OUTPUT_TYPE_MODULATOR``
      - 1
      - This output is an analog TV modulator.
    * - ``V4L2_OUTPUT_TYPE_ANALOG``
      - 2
      - Any non-modulator video output, for example Composite Video,
	S-Video, HDMI. The naming as ``_TYPE_ANALOG`` is historical,
	today we would have called it ``_TYPE_VIDEO``.
    * - ``V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY``
      - 3
      - The video output will be copied to a :ref:`video overlay <overlay>`.

출력 기능 플래그

121-143
Output Capabilities
상수의미
`V4L2_OUT_CAP_DV_TIMINGS``0x00000002``VIDIOC_S_DV_TIMINGS`로 비디오 timing 설정 지원
`V4L2_OUT_CAP_STD``0x00000004``VIDIOC_S_STD`로 TV 표준 설정 지원
`V4L2_OUT_CAP_NATIVE_SIZE``0x00000008``V4L2_SEL_TGT_NATIVE_SIZE` selection target으로 native size 설정 지원

`v4l2_output.capabilities`가 알리는 출력별 설정 기능입니다.

기능 비트는 해당 출력에서 사용할 설정 API를 고르는 기준입니다. native size 선택의 상세 규칙은 공통 V4L2 selection 문서를 따릅니다.

.. tabularcolumns:: |p{6.4cm}|p{2.4cm}|p{8.5cm}|

.. _output-capabilities:

.. flat-table:: Output capabilities
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_OUT_CAP_DV_TIMINGS``
      - 0x00000002
      - This output supports setting video timings by using
	``VIDIOC_S_DV_TIMINGS``.
    * - ``V4L2_OUT_CAP_STD``
      - 0x00000004
      - This output supports setting the TV standard by using
	``VIDIOC_S_STD``.
    * - ``V4L2_OUT_CAP_NATIVE_SIZE``
      - 0x00000008
      - This output supports setting the native size using the
	``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
	:ref:`v4l2-selections-common`.

반환값과 EINVAL

144-153

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

VIDIOC_ENUMOUTPUT 오류
errno조건
`EINVAL``struct v4l2_output.index`가 지원되는 출력 범위를 벗어남

출력 열거를 끝내거나 잘못된 순번을 판별하는 오류입니다.

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 struct :c:type:`v4l2_output` ``index`` is out of
    bounds.