Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
af4a4d0d | 3 | .. _VIDIOC_ENUMINPUT: |
5377d91f MH |
4 | |
5 | ********************** | |
6 | ioctl VIDIOC_ENUMINPUT | |
7 | ********************** | |
8 | ||
9 | *man VIDIOC_ENUMINPUT(2)* | |
10 | ||
11 | Enumerate video inputs | |
12 | ||
13 | ||
14 | Synopsis | |
15 | ======== | |
16 | ||
17 | .. c:function:: int ioctl( int fd, int request, struct v4l2_input *argp ) | |
18 | ||
19 | Arguments | |
20 | ========= | |
21 | ||
22 | ``fd`` | |
23 | File descriptor returned by :ref:`open() <func-open>`. | |
24 | ||
25 | ``request`` | |
26 | VIDIOC_ENUMINPUT | |
27 | ||
28 | ``argp`` | |
29 | ||
30 | ||
31 | Description | |
32 | =========== | |
33 | ||
34 | To query the attributes of a video input applications initialize the | |
35 | ``index`` field of struct :ref:`v4l2_input <v4l2-input>` and call the | |
36 | ``VIDIOC_ENUMINPUT`` ioctl with a pointer to this structure. Drivers | |
37 | fill the rest of the structure or return an EINVAL error code when the | |
38 | index is out of bounds. To enumerate all inputs applications shall begin | |
39 | at index zero, incrementing by one until the driver returns EINVAL. | |
40 | ||
41 | ||
42 | .. _v4l2-input: | |
43 | ||
44 | .. flat-table:: struct v4l2_input | |
45 | :header-rows: 0 | |
46 | :stub-columns: 0 | |
47 | :widths: 1 1 2 | |
48 | ||
49 | ||
50 | - .. row 1 | |
51 | ||
52 | - __u32 | |
53 | ||
54 | - ``index`` | |
55 | ||
56 | - Identifies the input, set by the application. | |
57 | ||
58 | - .. row 2 | |
59 | ||
60 | - __u8 | |
61 | ||
62 | - ``name``\ [32] | |
63 | ||
64 | - Name of the video input, a NUL-terminated ASCII string, for | |
65 | example: "Vin (Composite 2)". This information is intended for the | |
66 | user, preferably the connector label on the device itself. | |
67 | ||
68 | - .. row 3 | |
69 | ||
70 | - __u32 | |
71 | ||
72 | - ``type`` | |
73 | ||
74 | - Type of the input, see :ref:`input-type`. | |
75 | ||
76 | - .. row 4 | |
77 | ||
78 | - __u32 | |
79 | ||
80 | - ``audioset`` | |
81 | ||
82 | - Drivers can enumerate up to 32 video and audio inputs. This field | |
83 | shows which audio inputs were selectable as audio source if this | |
84 | was the currently selected video input. It is a bit mask. The LSB | |
85 | corresponds to audio input 0, the MSB to input 31. Any number of | |
86 | bits can be set, or none. | |
87 | ||
88 | When the driver does not enumerate audio inputs no bits must be | |
89 | set. Applications shall not interpret this as lack of audio | |
90 | support. Some drivers automatically select audio sources and do | |
91 | not enumerate them since there is no choice anyway. | |
92 | ||
93 | For details on audio inputs and how to select the current input | |
94 | see :ref:`audio`. | |
95 | ||
96 | - .. row 5 | |
97 | ||
98 | - __u32 | |
99 | ||
100 | - ``tuner`` | |
101 | ||
102 | - Capture devices can have zero or more tuners (RF demodulators). | |
103 | When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an | |
104 | RF connector and this field identifies the tuner. It corresponds | |
105 | to struct :ref:`v4l2_tuner <v4l2-tuner>` field ``index``. For | |
106 | details on tuners see :ref:`tuner`. | |
107 | ||
108 | - .. row 6 | |
109 | ||
110 | - :ref:`v4l2_std_id <v4l2-std-id>` | |
111 | ||
112 | - ``std`` | |
113 | ||
114 | - Every video input supports one or more different video standards. | |
115 | This field is a set of all supported standards. For details on | |
116 | video standards and how to switch see :ref:`standard`. | |
117 | ||
118 | - .. row 7 | |
119 | ||
120 | - __u32 | |
121 | ||
122 | - ``status`` | |
123 | ||
124 | - This field provides status information about the input. See | |
125 | :ref:`input-status` for flags. With the exception of the sensor | |
126 | orientation bits ``status`` is only valid when this is the current | |
127 | input. | |
128 | ||
129 | - .. row 8 | |
130 | ||
131 | - __u32 | |
132 | ||
133 | - ``capabilities`` | |
134 | ||
135 | - This field provides capabilities for the input. See | |
136 | :ref:`input-capabilities` for flags. | |
137 | ||
138 | - .. row 9 | |
139 | ||
140 | - __u32 | |
141 | ||
142 | - ``reserved``\ [3] | |
143 | ||
144 | - Reserved for future extensions. Drivers must set the array to | |
145 | zero. | |
146 | ||
147 | ||
148 | ||
149 | .. _input-type: | |
150 | ||
151 | .. flat-table:: Input Types | |
152 | :header-rows: 0 | |
153 | :stub-columns: 0 | |
154 | :widths: 3 1 4 | |
155 | ||
156 | ||
157 | - .. row 1 | |
158 | ||
159 | - ``V4L2_INPUT_TYPE_TUNER`` | |
160 | ||
161 | - 1 | |
162 | ||
163 | - This input uses a tuner (RF demodulator). | |
164 | ||
165 | - .. row 2 | |
166 | ||
167 | - ``V4L2_INPUT_TYPE_CAMERA`` | |
168 | ||
169 | - 2 | |
170 | ||
171 | - Analog baseband input, for example CVBS / Composite Video, | |
172 | S-Video, RGB. | |
173 | ||
174 | ||
175 | ||
176 | .. _input-status: | |
177 | ||
178 | .. flat-table:: Input Status Flags | |
179 | :header-rows: 0 | |
180 | :stub-columns: 0 | |
181 | ||
182 | ||
183 | - .. row 1 | |
184 | ||
185 | - :cspan:`2` General | |
186 | ||
187 | - .. row 2 | |
188 | ||
189 | - ``V4L2_IN_ST_NO_POWER`` | |
190 | ||
191 | - 0x00000001 | |
192 | ||
193 | - Attached device is off. | |
194 | ||
195 | - .. row 3 | |
196 | ||
197 | - ``V4L2_IN_ST_NO_SIGNAL`` | |
198 | ||
199 | - 0x00000002 | |
200 | ||
201 | - | |
202 | ||
203 | - .. row 4 | |
204 | ||
205 | - ``V4L2_IN_ST_NO_COLOR`` | |
206 | ||
207 | - 0x00000004 | |
208 | ||
209 | - The hardware supports color decoding, but does not detect color | |
210 | modulation in the signal. | |
211 | ||
212 | - .. row 5 | |
213 | ||
214 | - :cspan:`2` Sensor Orientation | |
215 | ||
216 | - .. row 6 | |
217 | ||
218 | - ``V4L2_IN_ST_HFLIP`` | |
219 | ||
220 | - 0x00000010 | |
221 | ||
222 | - The input is connected to a device that produces a signal that is | |
223 | flipped horizontally and does not correct this before passing the | |
224 | signal to userspace. | |
225 | ||
226 | - .. row 7 | |
227 | ||
228 | - ``V4L2_IN_ST_VFLIP`` | |
229 | ||
230 | - 0x00000020 | |
231 | ||
232 | - The input is connected to a device that produces a signal that is | |
233 | flipped vertically and does not correct this before passing the | |
234 | signal to userspace. Note that a 180 degree rotation is the same | |
235 | as HFLIP | VFLIP | |
236 | ||
237 | - .. row 8 | |
238 | ||
239 | - :cspan:`2` Analog Video | |
240 | ||
241 | - .. row 9 | |
242 | ||
243 | - ``V4L2_IN_ST_NO_H_LOCK`` | |
244 | ||
245 | - 0x00000100 | |
246 | ||
247 | - No horizontal sync lock. | |
248 | ||
249 | - .. row 10 | |
250 | ||
251 | - ``V4L2_IN_ST_COLOR_KILL`` | |
252 | ||
253 | - 0x00000200 | |
254 | ||
255 | - A color killer circuit automatically disables color decoding when | |
256 | it detects no color modulation. When this flag is set the color | |
257 | killer is enabled *and* has shut off color decoding. | |
258 | ||
259 | - .. row 11 | |
260 | ||
261 | - :cspan:`2` Digital Video | |
262 | ||
263 | - .. row 12 | |
264 | ||
265 | - ``V4L2_IN_ST_NO_SYNC`` | |
266 | ||
267 | - 0x00010000 | |
268 | ||
269 | - No synchronization lock. | |
270 | ||
271 | - .. row 13 | |
272 | ||
273 | - ``V4L2_IN_ST_NO_EQU`` | |
274 | ||
275 | - 0x00020000 | |
276 | ||
277 | - No equalizer lock. | |
278 | ||
279 | - .. row 14 | |
280 | ||
281 | - ``V4L2_IN_ST_NO_CARRIER`` | |
282 | ||
283 | - 0x00040000 | |
284 | ||
285 | - Carrier recovery failed. | |
286 | ||
287 | - .. row 15 | |
288 | ||
289 | - :cspan:`2` VCR and Set-Top Box | |
290 | ||
291 | - .. row 16 | |
292 | ||
293 | - ``V4L2_IN_ST_MACROVISION`` | |
294 | ||
295 | - 0x01000000 | |
296 | ||
297 | - Macrovision is an analog copy prevention system mangling the video | |
298 | signal to confuse video recorders. When this flag is set | |
299 | Macrovision has been detected. | |
300 | ||
301 | - .. row 17 | |
302 | ||
303 | - ``V4L2_IN_ST_NO_ACCESS`` | |
304 | ||
305 | - 0x02000000 | |
306 | ||
307 | - Conditional access denied. | |
308 | ||
309 | - .. row 18 | |
310 | ||
311 | - ``V4L2_IN_ST_VTR`` | |
312 | ||
313 | - 0x04000000 | |
314 | ||
315 | - VTR time constant. [?] | |
316 | ||
317 | ||
318 | ||
319 | .. _input-capabilities: | |
320 | ||
321 | .. flat-table:: Input capabilities | |
322 | :header-rows: 0 | |
323 | :stub-columns: 0 | |
324 | :widths: 3 1 4 | |
325 | ||
326 | ||
327 | - .. row 1 | |
328 | ||
329 | - ``V4L2_IN_CAP_DV_TIMINGS`` | |
330 | ||
331 | - 0x00000002 | |
332 | ||
333 | - This input supports setting video timings by using | |
334 | VIDIOC_S_DV_TIMINGS. | |
335 | ||
336 | - .. row 2 | |
337 | ||
338 | - ``V4L2_IN_CAP_STD`` | |
339 | ||
340 | - 0x00000004 | |
341 | ||
342 | - This input supports setting the TV standard by using | |
343 | VIDIOC_S_STD. | |
344 | ||
345 | - .. row 3 | |
346 | ||
347 | - ``V4L2_IN_CAP_NATIVE_SIZE`` | |
348 | ||
349 | - 0x00000008 | |
350 | ||
351 | - This input supports setting the native size using the | |
352 | ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see | |
353 | :ref:`v4l2-selections-common`. | |
354 | ||
355 | ||
356 | ||
357 | Return Value | |
358 | ============ | |
359 | ||
360 | On success 0 is returned, on error -1 and the ``errno`` variable is set | |
361 | appropriately. The generic error codes are described at the | |
362 | :ref:`Generic Error Codes <gen-errors>` chapter. | |
363 | ||
364 | EINVAL | |
365 | The struct :ref:`v4l2_input <v4l2-input>` ``index`` is out of | |
366 | bounds. | |
367 | ||
368 | ||
369 | .. ------------------------------------------------------------------------------ | |
370 | .. This file was automatically converted from DocBook-XML with the dbxml | |
371 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes | |
372 | .. from the linux kernel, refer to: | |
373 | .. | |
374 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook | |
375 | .. ------------------------------------------------------------------------------ |