요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_ENUM_FREQ_BANDS:
****************************
ioctl VIDIOC_ENUM_FREQ_BANDS
****************************
Name
====
VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands
Synopsis
========
.. c:macro:: VIDIOC_ENUM_FREQ_BANDS
``int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_frequency_band`.
Description
===========
Enumerates the frequency bands that a tuner or modulator supports. To do
this applications initialize the ``tuner``, ``type`` and ``index``
fields, and zero out the ``reserved`` array of a struct
:c:type:`v4l2_frequency_band` and call the
:ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
of the corresponding tuner/modulator is set.
.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{2.4cm}|
.. c:type:: v4l2_frequency_band
.. flat-table:: struct v4l2_frequency_band
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2 1 1
* - __u32
- ``tuner``
- The tuner or modulator index number. This is the same value as in
the struct :c:type:`v4l2_input` ``tuner`` field and
the struct :c:type:`v4l2_tuner` ``index`` field, or
the struct :c:type:`v4l2_output` ``modulator`` field
and the struct :c:type:`v4l2_modulator` ``index``
field.
* - __u32
- ``type``
- The tuner type. This is the same value as in the struct
:c:type:`v4l2_tuner` ``type`` field. The type must be
set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
``V4L2_TUNER_RADIO`` for modulators (currently only radio
modulators are supported). See :c:type:`v4l2_tuner_type`
* - __u32
- ``index``
- Identifies the frequency band, set by the application.
* - __u32
- ``capability``
- :cspan:`2` The tuner/modulator capability flags for this
frequency band, see :ref:`tuner-capability`. The
``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
be the same for all frequency bands of the selected
tuner/modulator. So either all bands have that capability set, or
none of them have that capability.
* - __u32
- ``rangelow``
- :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
* - __u32
- ``rangehigh``
- :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
* - __u32
- ``modulation``
- :cspan:`2` The supported modulation systems of this frequency
band. See :ref:`band-modulation`.
.. note::
Currently only one modulation system per frequency band
is supported. More work will need to be done if multiple
modulation systems are possible. Contact the linux-media
mailing list
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
if you need such functionality.
* - __u32
- ``reserved``\ [9]
- Reserved for future extensions.
Applications and drivers must set the array to zero.
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
.. _band-modulation:
.. flat-table:: Band Modulation Systems
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
* - ``V4L2_BAND_MODULATION_VSB``
- 0x02
- Vestigial Sideband modulation, used for analog TV.
* - ``V4L2_BAND_MODULATION_FM``
- 0x04
- Frequency Modulation, commonly used for analog radio.
* - ``V4L2_BAND_MODULATION_AM``
- 0x08
- Amplitude Modulation, commonly used for analog radio.
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 ``tuner`` or ``index`` is out of bounds or the ``type`` field is
wrong.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
목적, 호출 형식과 인자
1-30`VIDIOC_ENUM_FREQ_BANDS`는 tuner 또는 modulator가 지원하는 주파수 대역을 열거하는 ioctl입니다. 호출 형식은 `int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)`입니다.
`fd`는 `open()`이 반환한 파일 디스크립터이고, `argp`는 조회할 tuner·유형·대역 순번과 반환 정보를 담는 `struct v4l2_frequency_band`를 가리킵니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_ENUM_FREQ_BANDS:
****************************
ioctl VIDIOC_ENUM_FREQ_BANDS
****************************
Name
====
VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands
Synopsis
========
.. c:macro:: VIDIOC_ENUM_FREQ_BANDS
``int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_frequency_band`.
지원 조건과 열거 절차
31-44응용 프로그램은 `v4l2_frequency_band`의 `tuner`, `type`, `index`를 초기화하고 `reserved` 배열을 0으로 만든 뒤 ioctl을 호출합니다. 대응하는 tuner 또는 modulator에 `V4L2_TUNER_CAP_FREQ_BANDS` capability가 설정된 경우에만 이 ioctl이 지원됩니다.
선택한 tuner 또는 modulator의 band를 순서대로 조사합니다.
Description
===========
Enumerates the frequency bands that a tuner or modulator supports. To do
this applications initialize the ``tuner``, ``type`` and ``index``
fields, and zero out the ``reserved`` array of a struct
:c:type:`v4l2_frequency_band` and call the
:ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
of the corresponding tuner/modulator is set.
.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{2.4cm}|
v4l2_frequency_band 구조체
45-112응용 프로그램 입력과 드라이버가 반환하는 대역 속성을 원문 순서대로 정리합니다.
`type`은 `v4l2_tuner.type`과 같은 값입니다. `/dev/radioX` 장치 노드는 `V4L2_TUNER_RADIO`, 그 밖의 노드는 `V4L2_TUNER_ANALOG_TV`를 사용합니다. 현재는 radio modulator만 지원하므로 modulator에도 `V4L2_TUNER_RADIO`를 설정합니다.
`capability`의 `V4L2_TUNER_CAP_LOW` 또는 `V4L2_TUNER_CAP_1HZ`는 선택한 tuner/modulator의 모든 주파수 band에서 같아야 합니다. 즉 모든 band에 해당 capability가 있거나 어느 band에도 없어야 합니다.
`rangelow`와 `rangehigh`의 기본 단위는 62.5 kHz입니다. `V4L2_TUNER_CAP_LOW`가 설정되면 62.5 Hz, `V4L2_TUNER_CAP_1HZ`가 설정되면 1 Hz 단위를 사용합니다.
현재는 주파수 band 하나당 변조 방식 하나만 지원합니다. 여러 변조 방식을 한 band에 표현해야 한다면 API 작업이 더 필요하며 원문이 안내한 linux-media 메일링 리스트에 논의해야 합니다.
.. c:type:: v4l2_frequency_band
.. flat-table:: struct v4l2_frequency_band
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2 1 1
* - __u32
- ``tuner``
- The tuner or modulator index number. This is the same value as in
the struct :c:type:`v4l2_input` ``tuner`` field and
the struct :c:type:`v4l2_tuner` ``index`` field, or
the struct :c:type:`v4l2_output` ``modulator`` field
and the struct :c:type:`v4l2_modulator` ``index``
field.
* - __u32
- ``type``
- The tuner type. This is the same value as in the struct
:c:type:`v4l2_tuner` ``type`` field. The type must be
set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
``V4L2_TUNER_RADIO`` for modulators (currently only radio
modulators are supported). See :c:type:`v4l2_tuner_type`
* - __u32
- ``index``
- Identifies the frequency band, set by the application.
* - __u32
- ``capability``
- :cspan:`2` The tuner/modulator capability flags for this
frequency band, see :ref:`tuner-capability`. The
``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
be the same for all frequency bands of the selected
tuner/modulator. So either all bands have that capability set, or
none of them have that capability.
* - __u32
- ``rangelow``
- :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
* - __u32
- ``rangehigh``
- :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
* - __u32
- ``modulation``
- :cspan:`2` The supported modulation systems of this frequency
band. See :ref:`band-modulation`.
.. note::
Currently only one modulation system per frequency band
is supported. More work will need to be done if multiple
modulation systems are possible. Contact the linux-media
mailing list
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
if you need such functionality.
* - __u32
- ``reserved``\ [9]
- Reserved for future extensions.
Applications and drivers must set the array to zero.
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
Band 변조 방식
113-129`modulation` 필드가 나타내는 지원 변조 방식입니다.
.. _band-modulation:
.. flat-table:: Band Modulation Systems
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
* - ``V4L2_BAND_MODULATION_VSB``
- 0x02
- Vestigial Sideband modulation, used for analog TV.
* - ``V4L2_BAND_MODULATION_FM``
- 0x04
- Frequency Modulation, commonly used for analog radio.
* - ``V4L2_BAND_MODULATION_AM``
- 0x08
- Amplitude Modulation, commonly used for analog radio.
반환값과 EINVAL
130-139성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 적절한 값으로 설정하며, 공통 오류 코드는 Generic Error Codes 장을 따릅니다.
입력 선택이나 열거 순번이 잘못된 경우입니다.
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 ``tuner`` or ``index`` is out of bounds or the ``type`` field is
wrong.
요약·해설
vidioc-enum-freq-bands.rst:1-139V4L2 tuner·modulator의 주파수 band를 열거하고 대역별 capability, 주파수 단위, 변조 방식과 오류 조건을 설명합니다.