요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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_DV_TIMINGS:
***********************************************************
ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
***********************************************************
Name
====
VIDIOC_ENUM_DV_TIMINGS - VIDIOC_SUBDEV_ENUM_DV_TIMINGS - Enumerate supported Digital Video timings
Synopsis
========
.. c:macro:: VIDIOC_ENUM_DV_TIMINGS
``int ioctl(int fd, VIDIOC_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
.. c:macro:: VIDIOC_SUBDEV_ENUM_DV_TIMINGS
``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_enum_dv_timings`.
Description
===========
While some DV receivers or transmitters support a wide range of timings,
others support only a limited number of timings. With this ioctl
applications can enumerate a list of known supported timings. Call
:ref:`VIDIOC_DV_TIMINGS_CAP` to check if it
also supports other standards or even custom timings that are not in
this list.
To query the available timings, applications initialize the ``index``
field, set the ``pad`` field to 0, zero the reserved array of struct
:c:type:`v4l2_enum_dv_timings` and call the
``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node 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 supported
DV timings, applications shall begin at index zero, incrementing by one
until the driver returns ``EINVAL``.
.. note::
Drivers may enumerate a different set of DV timings after
switching the video input or output.
When implemented by the driver DV timings of subdevices can be queried
by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
subdevice node. The DV timings are specific to inputs (for DV receivers)
or outputs (for DV transmitters), applications must specify the desired
pad number in the struct
:c:type:`v4l2_enum_dv_timings` ``pad`` field.
Attempts to enumerate timings on a pad that doesn't support them will
return an ``EINVAL`` error code.
.. c:type:: v4l2_enum_dv_timings
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
.. flat-table:: struct v4l2_enum_dv_timings
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u32
- ``index``
- Number of the DV timings, set by the application.
* - __u32
- ``pad``
- Pad number as reported by the media controller API. This field is
only used when operating on a subdevice node. When operating on a
video node applications must set this field to zero.
* - __u32
- ``reserved``\ [2]
- Reserved for future extensions. Drivers and applications must set
the array to zero.
* - struct :c:type:`v4l2_dv_timings`
- ``timings``
- The timings.
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_enum_dv_timings`
``index`` is out of bounds or the ``pad`` number is invalid.
ENODATA
Digital video presets are not supported for this input or output.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름, 호출 형식과 인자
1-34`VIDIOC_ENUM_DV_TIMINGS`와 `VIDIOC_SUBDEV_ENUM_DV_TIMINGS`는 수신기 또는 송신기가 지원하는 알려진 디지털 비디오 timing을 하나씩 열거합니다. 두 호출 모두 `struct v4l2_enum_dv_timings *argp`를 사용합니다.
`fd`는 `open()`이 반환한 비디오 또는 sub-device 노드 파일 디스크립터이고, `argp`는 응용 프로그램이 index·pad·예약 필드를 초기화하고 드라이버가 timing을 반환하는 구조체입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_ENUM_DV_TIMINGS:
***********************************************************
ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
***********************************************************
Name
====
VIDIOC_ENUM_DV_TIMINGS - VIDIOC_SUBDEV_ENUM_DV_TIMINGS - Enumerate supported Digital Video timings
Synopsis
========
.. c:macro:: VIDIOC_ENUM_DV_TIMINGS
``int ioctl(int fd, VIDIOC_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
.. c:macro:: VIDIOC_SUBDEV_ENUM_DV_TIMINGS
``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_enum_dv_timings`.
알려진 타이밍 목록과 열거 절차
35-67일부 DV 수신기·송신기는 넓은 timing 범위를 지원하지만 다른 장치는 제한된 timing 집합만 지원합니다. 이 ioctl은 드라이버가 알고 있는 지원 목록을 열거합니다. 목록에 없는 다른 표준 또는 custom timing 지원 여부는 `VIDIOC_DV_TIMINGS_CAP`로 별도 확인해야 합니다.
비디오 노드에서는 `index`를 설정하고 `pad`를 0으로 두며 `reserved` 배열을 0으로 초기화한 뒤 `VIDIOC_ENUM_DV_TIMINGS`를 호출합니다. 드라이버는 나머지 필드를 채우고 index가 범위를 벗어나면 `EINVAL`을 반환합니다.
전체 목록은 index 0부터 시작해 하나씩 증가시키다가 `EINVAL`이 나오면 끝납니다. 비디오 입력이나 출력을 전환하면 같은 드라이버가 다른 DV timing 집합을 열거할 수 있으므로 전환 뒤에는 다시 조회해야 합니다.
sub-device 노드에서는 드라이버가 지원할 때 `VIDIOC_SUBDEV_ENUM_DV_TIMINGS`를 호출합니다. DV 수신기는 입력 pad, 송신기는 출력 pad마다 목록이 다를 수 있으므로 media controller의 원하는 pad 번호를 지정합니다. timing 열거를 지원하지 않는 pad는 `EINVAL`입니다.
index 증가와 종료 오류를 포함한 반복 절차입니다.
Description
===========
While some DV receivers or transmitters support a wide range of timings,
others support only a limited number of timings. With this ioctl
applications can enumerate a list of known supported timings. Call
:ref:`VIDIOC_DV_TIMINGS_CAP` to check if it
also supports other standards or even custom timings that are not in
this list.
To query the available timings, applications initialize the ``index``
field, set the ``pad`` field to 0, zero the reserved array of struct
:c:type:`v4l2_enum_dv_timings` and call the
``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node 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 supported
DV timings, applications shall begin at index zero, incrementing by one
until the driver returns ``EINVAL``.
.. note::
Drivers may enumerate a different set of DV timings after
switching the video input or output.
When implemented by the driver DV timings of subdevices can be queried
by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
subdevice node. The DV timings are specific to inputs (for DV receivers)
or outputs (for DV transmitters), applications must specify the desired
pad number in the struct
:c:type:`v4l2_enum_dv_timings` ``pad`` field.
Attempts to enumerate timings on a pad that doesn't support them will
return an ``EINVAL`` error code.
v4l2_enum_dv_timings 구조체
68-92응용 프로그램 입력과 드라이버 반환 필드를 원문 순서대로 정리합니다.
`index`, `pad`, `reserved`는 호출 전에 응용 프로그램이 설정하고, `timings`는 성공한 호출에서 드라이버가 채웁니다. 구조체를 매 반복마다 0으로 초기화하면 예약 필드 요구 사항을 안전하게 지킬 수 있습니다.
.. c:type:: v4l2_enum_dv_timings
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
.. flat-table:: struct v4l2_enum_dv_timings
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u32
- ``index``
- Number of the DV timings, set by the application.
* - __u32
- ``pad``
- Pad number as reported by the media controller API. This field is
only used when operating on a subdevice node. When operating on a
video node applications must set this field to zero.
* - __u32
- ``reserved``\ [2]
- Reserved for future extensions. Drivers and applications must set
the array to zero.
* - struct :c:type:`v4l2_dv_timings`
- ``timings``
- The timings.
반환값과 오류
93-105성공하면 0을 반환하고 실패하면 -1과 적절한 `errno`를 반환합니다. 일반 오류 코드는 Generic Error Codes 절을 따릅니다.
목록 끝·pad 오류와 기능 미지원 상태를 구분합니다.
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_enum_dv_timings`
``index`` is out of bounds or the ``pad`` number is invalid.
ENODATA
Digital video presets are not supported for this input or output.
요약·해설
vidioc-enum-dv-timings.rst:1-105비디오 노드 또는 sub-device pad에서 알려진 DV timing을 index 0부터 EINVAL까지 열거하고 capability 조회와 목록 변화 조건을 함께 설명합니다.