Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003 
0004 .. _VIDIOC_G_AUDOUT:
0005 
0006 **************************************
0007 ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
0008 **************************************
0009 
0010 Name
0011 ====
0012 
0013 VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - Query or select the current audio output
0014 
0015 Synopsis
0016 ========
0017 
0018 .. c:macro:: VIDIOC_G_AUDOUT
0019 
0020 ``int ioctl(int fd, VIDIOC_G_AUDOUT, struct v4l2_audioout *argp)``
0021 
0022 .. c:macro:: VIDIOC_S_AUDOUT
0023 
0024 ``int ioctl(int fd, VIDIOC_S_AUDOUT, const struct v4l2_audioout *argp)``
0025 
0026 Arguments
0027 =========
0028 
0029 ``fd``
0030     File descriptor returned by :c:func:`open()`.
0031 
0032 ``argp``
0033     Pointer to struct :c:type:`v4l2_audioout`.
0034 
0035 Description
0036 ===========
0037 
0038 To query the current audio output applications zero out the ``reserved``
0039 array of a struct :c:type:`v4l2_audioout` and call the
0040 ``VIDIOC_G_AUDOUT`` ioctl with a pointer to this structure. Drivers fill
0041 the rest of the structure or return an ``EINVAL`` error code when the device
0042 has no audio inputs, or none which combine with the current video
0043 output.
0044 
0045 Audio outputs have no writable properties. Nevertheless, to select the
0046 current audio output applications can initialize the ``index`` field and
0047 ``reserved`` array (which in the future may contain writable properties)
0048 of a struct :c:type:`v4l2_audioout` structure and call the
0049 ``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or
0050 return the ``EINVAL`` error code when the index is out of bounds. This is a
0051 write-only ioctl, it does not return the current audio output attributes
0052 as ``VIDIOC_G_AUDOUT`` does.
0053 
0054 .. note::
0055 
0056    Connectors on a TV card to loop back the received audio signal
0057    to a sound card are not audio outputs in this sense.
0058 
0059 .. c:type:: v4l2_audioout
0060 
0061 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
0062 
0063 .. flat-table:: struct v4l2_audioout
0064     :header-rows:  0
0065     :stub-columns: 0
0066     :widths:       1 1 2
0067 
0068     * - __u32
0069       - ``index``
0070       - Identifies the audio output, set by the driver or application.
0071     * - __u8
0072       - ``name``\ [32]
0073       - Name of the audio output, a NUL-terminated ASCII string, for
0074         example: "Line Out". This information is intended for the user,
0075         preferably the connector label on the device itself.
0076     * - __u32
0077       - ``capability``
0078       - Audio capability flags, none defined yet. Drivers must set this
0079         field to zero.
0080     * - __u32
0081       - ``mode``
0082       - Audio mode, none defined yet. Drivers and applications (on
0083         ``VIDIOC_S_AUDOUT``) must set this field to zero.
0084     * - __u32
0085       - ``reserved``\ [2]
0086       - Reserved for future extensions. Drivers and applications must set
0087         the array to zero.
0088 
0089 Return Value
0090 ============
0091 
0092 On success 0 is returned, on error -1 and the ``errno`` variable is set
0093 appropriately. The generic error codes are described at the
0094 :ref:`Generic Error Codes <gen-errors>` chapter.
0095 
0096 EINVAL
0097     No audio outputs combine with the current video output, or the
0098     number of the selected audio output is out of bounds or it does not
0099     combine.