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

Linux 6.18.37 · 사용자 공간 API

VIDIOC_ENUMAUDIO ioctl

V4L2 장치의 audio input을 index 0부터 EINVAL까지 열거하고 v4l2_audio 초기화와 반환 규칙을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

vidioc-enumaudio.rst:1-53

V4L2 장치의 audio input을 index 0부터 EINVAL까지 열거하고 v4l2_audio 초기화와 반환 규칙을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_ENUMAUDIO:
5
6 **********************
7 ioctl VIDIOC_ENUMAUDIO
8 **********************
9
10 Name
11 ====
12
13 VIDIOC_ENUMAUDIO - Enumerate audio inputs
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_ENUMAUDIO
19
20 ``int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *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_audio`.
30
31 Description
32 ===========
33
34 To query the attributes of an audio input applications initialize the
35 ``index`` field and zero out the ``reserved`` array of a struct
36 :c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
37 ioctl with a pointer to this structure. Drivers fill the rest of the
38 structure or return an ``EINVAL`` error code when the index is out of
39 bounds. To enumerate all audio inputs applications shall begin at index
40 zero, incrementing by one until the driver returns ``EINVAL``.
41
42 See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
43 :c:type:`v4l2_audio`.
44
45 Return Value
46 ============
47
48 On success 0 is returned, on error -1 and the ``errno`` variable is set
49 appropriately. The generic error codes are described at the
50 :ref:`Generic Error Codes <gen-errors>` chapter.
51
52 EINVAL
53 The number of the audio input is out of bounds.
54

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` 문서를 따릅니다.

Audio input 열거 절차
index=0reserved=0VIDIOC_ENUMAUDIO 호출속성 기록index 증가EINVAL에서 종료

입력 순번을 증가시키는 반복 호출입니다.

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 장을 따릅니다.

VIDIOC_ENUMAUDIO 오류
errno조건
`EINVAL`audio input 순번이 범위를 벗어남

열거 종료를 나타내는 오류 조건입니다.

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.