vidioc-enumaudio.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_ENUMAUDIO:
  4. **********************
  5. ioctl VIDIOC_ENUMAUDIO
  6. **********************
  7. Name
  8. ====
  9. VIDIOC_ENUMAUDIO - Enumerate audio inputs
  10. Synopsis
  11. ========
  12. .. c:macro:: VIDIOC_ENUMAUDIO
  13. ``int ioctl(int fd, VIDIOC_ENUMAUDIO, struct v4l2_audio *argp)``
  14. Arguments
  15. =========
  16. ``fd``
  17. File descriptor returned by :c:func:`open()`.
  18. ``argp``
  19. Pointer to struct :c:type:`v4l2_audio`.
  20. Description
  21. ===========
  22. To query the attributes of an audio input applications initialize the
  23. ``index`` field and zero out the ``reserved`` array of a struct
  24. :c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
  25. ioctl with a pointer to this structure. Drivers fill the rest of the
  26. structure or return an ``EINVAL`` error code when the index is out of
  27. bounds. To enumerate all audio inputs applications shall begin at index
  28. zero, incrementing by one until the driver returns ``EINVAL``.
  29. See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
  30. :c:type:`v4l2_audio`.
  31. Return Value
  32. ============
  33. On success 0 is returned, on error -1 and the ``errno`` variable is set
  34. appropriately. The generic error codes are described at the
  35. :ref:`Generic Error Codes <gen-errors>` chapter.
  36. EINVAL
  37. The number of the audio input is out of bounds.