요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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_ENUMAUDIO:
**********************
ioctl VIDIOC_ENUMAUDIO
**********************
Name
====
VIDIOC_ENUMAUDIO - Enumerate audio inputs
Synopsis
========
.. c:macro:: VIDIOC_ENUMAUDIO
``int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_audio`.
Description
===========
To query the attributes of an audio input applications initialize the
``index`` field and zero out the ``reserved`` array of a struct
:c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
ioctl 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 audio inputs applications shall begin at index
zero, incrementing by one until the driver returns ``EINVAL``.
See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
:c:type:`v4l2_audio`.
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 number of the audio input is out of bounds.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
목적, 호출 형식과 인자
1-30`VIDIOC_ENUMAUDIO`는 비디오 장치의 audio input을 열거하는 ioctl입니다. 호출 형식은 `int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp)`입니다.
`fd`는 `open()`이 반환한 파일 디스크립터이고, `argp`는 조회할 입력 순번과 반환 속성을 담는 `struct v4l2_audio`를 가리킵니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_ENUMAUDIO:
**********************
ioctl VIDIOC_ENUMAUDIO
**********************
Name
====
VIDIOC_ENUMAUDIO - Enumerate audio inputs
Synopsis
========
.. c:macro:: VIDIOC_ENUMAUDIO
``int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_audio`.
Audio input 열거
31-44응용 프로그램은 `v4l2_audio.index`를 설정하고 `reserved` 배열을 0으로 만든 뒤 `VIDIOC_ENUMAUDIO`를 호출합니다. 드라이버는 나머지 구조체를 채우며, index가 범위를 벗어나면 `EINVAL`을 반환합니다.
모든 audio input을 얻으려면 index 0부터 시작해 한 번에 1씩 증가시키고 `EINVAL`이 나올 때 열거를 끝냅니다. `v4l2_audio` 각 필드의 의미는 `VIDIOC_G_AUDIO` 문서를 따릅니다.
입력 순번을 증가시키는 반복 호출입니다.
Description
===========
To query the attributes of an audio input applications initialize the
``index`` field and zero out the ``reserved`` array of a struct
:c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
ioctl 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 audio inputs applications shall begin at index
zero, incrementing by one until the driver returns ``EINVAL``.
See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
:c:type:`v4l2_audio`.
반환값과 EINVAL
45-53성공하면 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 number of the audio input is out of bounds.
요약·해설
vidioc-enumaudio.rst:1-53V4L2 장치의 audio input을 index 0부터 EINVAL까지 열거하고 v4l2_audio 초기화와 반환 규칙을 설명합니다.