Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
9f97b306 | 3 | .. _VIDIOC_G_AUDOUT: |
5377d91f MH |
4 | |
5 | ************************************** | |
6 | ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT | |
7 | ************************************** | |
8 | ||
15e7d615 | 9 | Name |
586027ce | 10 | ==== |
5377d91f | 11 | |
586027ce | 12 | VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - Query or select the current audio output |
5377d91f | 13 | |
15e7d615 MCC |
14 | |
15 | Synopsis | |
5377d91f MH |
16 | ======== |
17 | ||
41d80465 MCC |
18 | .. c:function:: int ioctl( int fd, VIDIOC_G_AUDOUT, struct v4l2_audioout *argp ) |
19 | :name: VIDIOC_G_AUDOUT | |
5377d91f | 20 | |
41d80465 MCC |
21 | .. c:function:: int ioctl( int fd, VIDIOC_S_AUDOUT, const struct v4l2_audioout *argp ) |
22 | :name: VIDIOC_S_AUDOUT | |
5377d91f | 23 | |
586027ce | 24 | |
15e7d615 | 25 | Arguments |
5377d91f MH |
26 | ========= |
27 | ||
28 | ``fd`` | |
29 | File descriptor returned by :ref:`open() <func-open>`. | |
30 | ||
5377d91f MH |
31 | ``argp`` |
32 | ||
33 | ||
15e7d615 | 34 | Description |
5377d91f MH |
35 | =========== |
36 | ||
37 | To query the current audio output applications zero out the ``reserved`` | |
e8be7e97 | 38 | array of a struct :c:type:`v4l2_audioout` and call the |
5377d91f | 39 | ``VIDIOC_G_AUDOUT`` ioctl with a pointer to this structure. Drivers fill |
cdb4af0f | 40 | the rest of the structure or return an ``EINVAL`` error code when the device |
5377d91f MH |
41 | has no audio inputs, or none which combine with the current video |
42 | output. | |
43 | ||
44 | Audio outputs have no writable properties. Nevertheless, to select the | |
45 | current audio output applications can initialize the ``index`` field and | |
46 | ``reserved`` array (which in the future may contain writable properties) | |
fc78c7c7 | 47 | of a struct :c:type:`v4l2_audioout` structure and call the |
5377d91f | 48 | ``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or |
cdb4af0f | 49 | return the ``EINVAL`` error code when the index is out of bounds. This is a |
5377d91f MH |
50 | write-only ioctl, it does not return the current audio output attributes |
51 | as ``VIDIOC_G_AUDOUT`` does. | |
52 | ||
b6b6e678 MCC |
53 | .. note:: |
54 | ||
55 | Connectors on a TV card to loop back the received audio signal | |
706f8a99 | 56 | to a sound card are not audio outputs in this sense. |
5377d91f MH |
57 | |
58 | ||
e8be7e97 | 59 | .. c:type:: v4l2_audioout |
5377d91f | 60 | |
5bd4bb78 MCC |
61 | .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| |
62 | ||
5377d91f MH |
63 | .. flat-table:: struct v4l2_audioout |
64 | :header-rows: 0 | |
65 | :stub-columns: 0 | |
66 | :widths: 1 1 2 | |
67 | ||
68 | ||
69 | - .. row 1 | |
70 | ||
71 | - __u32 | |
72 | ||
73 | - ``index`` | |
74 | ||
75 | - Identifies the audio output, set by the driver or application. | |
76 | ||
77 | - .. row 2 | |
78 | ||
79 | - __u8 | |
80 | ||
8968da9b | 81 | - ``name``\ [32] |
5377d91f MH |
82 | |
83 | - Name of the audio output, a NUL-terminated ASCII string, for | |
0579e6e3 MCC |
84 | example: "Line Out". This information is intended for the user, |
85 | preferably the connector label on the device itself. | |
5377d91f MH |
86 | |
87 | - .. row 3 | |
88 | ||
89 | - __u32 | |
90 | ||
91 | - ``capability`` | |
92 | ||
93 | - Audio capability flags, none defined yet. Drivers must set this | |
0579e6e3 | 94 | field to zero. |
5377d91f MH |
95 | |
96 | - .. row 4 | |
97 | ||
98 | - __u32 | |
99 | ||
100 | - ``mode`` | |
101 | ||
102 | - Audio mode, none defined yet. Drivers and applications (on | |
0579e6e3 | 103 | ``VIDIOC_S_AUDOUT``) must set this field to zero. |
5377d91f MH |
104 | |
105 | - .. row 5 | |
106 | ||
107 | - __u32 | |
108 | ||
8968da9b | 109 | - ``reserved``\ [2] |
5377d91f MH |
110 | |
111 | - Reserved for future extensions. Drivers and applications must set | |
0579e6e3 | 112 | the array to zero. |
5377d91f MH |
113 | |
114 | ||
15e7d615 | 115 | Return Value |
5377d91f MH |
116 | ============ |
117 | ||
118 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
119 | appropriately. The generic error codes are described at the | |
120 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
121 | ||
122 | EINVAL | |
123 | No audio outputs combine with the current video output, or the | |
124 | number of the selected audio output is out of bounds or it does not | |
125 | combine. |