]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - Documentation/linux_tv/media/v4l/vidioc-g-audioout.rst
doc-rst: customize RTD theme, captions & inline literal
[mirror_ubuntu-artful-kernel.git] / Documentation / linux_tv / media / v4l / vidioc-g-audioout.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
af4a4d0d 3.. _VIDIOC_G_AUDIOOUT:
5377d91f
MH
4
5**************************************
6ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
7**************************************
8
586027ce
MCC
9NAME
10====
5377d91f 11
586027ce 12VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - Query or select the current audio output
5377d91f 13
586027ce 14SYNOPSIS
5377d91f
MH
15========
16
b7e67f6c 17.. cpp:function:: int ioctl( int fd, int request, struct v4l2_audioout *argp )
5377d91f 18
b7e67f6c 19.. cpp:function:: int ioctl( int fd, int request, const struct v4l2_audioout *argp )
5377d91f 20
586027ce
MCC
21
22ARGUMENTS
5377d91f
MH
23=========
24
25``fd``
26 File descriptor returned by :ref:`open() <func-open>`.
27
28``request``
29 VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
30
31``argp``
32
33
586027ce 34DESCRIPTION
5377d91f
MH
35===========
36
37To query the current audio output applications zero out the ``reserved``
38array of a struct :ref:`v4l2_audioout <v4l2-audioout>` and call the
39``VIDIOC_G_AUDOUT`` ioctl with a pointer to this structure. Drivers fill
cdb4af0f 40the rest of the structure or return an ``EINVAL`` error code when the device
5377d91f
MH
41has no audio inputs, or none which combine with the current video
42output.
43
44Audio outputs have no writable properties. Nevertheless, to select the
45current audio output applications can initialize the ``index`` field and
46``reserved`` array (which in the future may contain writable properties)
acf309a2 47of a :ref:`struct v4l2_audioout <v4l2-audioout>` structure and call the
5377d91f 48``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or
cdb4af0f 49return the ``EINVAL`` error code when the index is out of bounds. This is a
5377d91f
MH
50write-only ioctl, it does not return the current audio output attributes
51as ``VIDIOC_G_AUDOUT`` does.
52
53Note connectors on a TV card to loop back the received audio signal to a
54sound card are not audio outputs in this sense.
55
56
57.. _v4l2-audioout:
58
59.. flat-table:: struct v4l2_audioout
60 :header-rows: 0
61 :stub-columns: 0
62 :widths: 1 1 2
63
64
65 - .. row 1
66
67 - __u32
68
69 - ``index``
70
71 - Identifies the audio output, set by the driver or application.
72
73 - .. row 2
74
75 - __u8
76
77 - ``name``\ [32]
78
79 - Name of the audio output, a NUL-terminated ASCII string, for
0579e6e3
MCC
80 example: "Line Out". This information is intended for the user,
81 preferably the connector label on the device itself.
5377d91f
MH
82
83 - .. row 3
84
85 - __u32
86
87 - ``capability``
88
89 - Audio capability flags, none defined yet. Drivers must set this
0579e6e3 90 field to zero.
5377d91f
MH
91
92 - .. row 4
93
94 - __u32
95
96 - ``mode``
97
98 - Audio mode, none defined yet. Drivers and applications (on
0579e6e3 99 ``VIDIOC_S_AUDOUT``) must set this field to zero.
5377d91f
MH
100
101 - .. row 5
102
103 - __u32
104
105 - ``reserved``\ [2]
106
107 - Reserved for future extensions. Drivers and applications must set
0579e6e3 108 the array to zero.
5377d91f
MH
109
110
586027ce 111RETURN VALUE
5377d91f
MH
112============
113
114On success 0 is returned, on error -1 and the ``errno`` variable is set
115appropriately. The generic error codes are described at the
116:ref:`Generic Error Codes <gen-errors>` chapter.
117
118EINVAL
119 No audio outputs combine with the current video output, or the
120 number of the selected audio output is out of bounds or it does not
121 combine.