1.. Permission is granted to copy, distribute and/or modify this
2.. document under the terms of the GNU Free Documentation License,
3.. Version 1.1 or any later version published by the Free Software
4.. Foundation, with no Invariant Sections, no Front-Cover Texts
5.. and no Back-Cover Texts. A copy of the license is included at
6.. Documentation/userspace-api/media/fdl-appendix.rst.
7..
8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10.. _VIDIOC_ENUMAUDIO:
11
12**********************
13ioctl VIDIOC_ENUMAUDIO
14**********************
15
16Name
17====
18
19VIDIOC_ENUMAUDIO - Enumerate audio inputs
20
21
22Synopsis
23========
24
25.. c:function:: int ioctl( int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp )
26    :name: VIDIOC_ENUMAUDIO
27
28
29Arguments
30=========
31
32``fd``
33    File descriptor returned by :ref:`open() <func-open>`.
34
35``argp``
36    Pointer to struct :c:type:`v4l2_audio`.
37
38
39Description
40===========
41
42To query the attributes of an audio input applications initialize the
43``index`` field and zero out the ``reserved`` array of a struct
44:c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
45ioctl with a pointer to this structure. Drivers fill the rest of the
46structure or return an ``EINVAL`` error code when the index is out of
47bounds. To enumerate all audio inputs applications shall begin at index
48zero, incrementing by one until the driver returns ``EINVAL``.
49
50See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
51:c:type:`v4l2_audio`.
52
53
54Return Value
55============
56
57On success 0 is returned, on error -1 and the ``errno`` variable is set
58appropriately. The generic error codes are described at the
59:ref:`Generic Error Codes <gen-errors>` chapter.
60
61EINVAL
62    The number of the audio input is out of bounds.
63