1
<refentry id="vidioc-enuminput">
3
<refentrytitle>ioctl VIDIOC_ENUMINPUT</refentrytitle>
8
<refname>VIDIOC_ENUMINPUT</refname>
9
<refpurpose>Enumerate video inputs</refpurpose>
15
<funcdef>int <function>ioctl</function></funcdef>
16
<paramdef>int <parameter>fd</parameter></paramdef>
17
<paramdef>int <parameter>request</parameter></paramdef>
18
<paramdef>struct v4l2_input
19
*<parameter>argp</parameter></paramdef>
25
<title>Arguments</title>
29
<term><parameter>fd</parameter></term>
35
<term><parameter>request</parameter></term>
37
<para>VIDIOC_ENUMINPUT</para>
41
<term><parameter>argp</parameter></term>
50
<title>Description</title>
52
<para>To query the attributes of a video input applications
53
initialize the <structfield>index</structfield> field of &v4l2-input;
54
and call the <constant>VIDIOC_ENUMINPUT</constant> ioctl with a
55
pointer to this structure. Drivers fill the rest of the structure or
56
return an &EINVAL; when the index is out of bounds. To enumerate all
57
inputs applications shall begin at index zero, incrementing by one
58
until the driver returns <errorcode>EINVAL</errorcode>.</para>
60
<table frame="none" pgwide="1" id="v4l2-input">
61
<title>struct <structname>v4l2_input</structname></title>
67
<entry><structfield>index</structfield></entry>
68
<entry>Identifies the input, set by the
73
<entry><structfield>name</structfield>[32]</entry>
74
<entry>Name of the video input, a NUL-terminated ASCII
75
string, for example: "Vin (Composite 2)". This information is intended
76
for the user, preferably the connector label on the device itself.</entry>
80
<entry><structfield>type</structfield></entry>
81
<entry>Type of the input, see <xref
82
linkend="input-type" />.</entry>
86
<entry><structfield>audioset</structfield></entry>
87
<entry><para>Drivers can enumerate up to 32 video and
88
audio inputs. This field shows which audio inputs were selectable as
89
audio source if this was the currently selected video input. It is a
90
bit mask. The LSB corresponds to audio input 0, the MSB to input 31.
91
Any number of bits can be set, or none.</para><para>When the driver
92
does not enumerate audio inputs no bits must be set. Applications
93
shall not interpret this as lack of audio support. Some drivers
94
automatically select audio sources and do not enumerate them since
95
there is no choice anyway.</para><para>For details on audio inputs and
96
how to select the current input see <xref
97
linkend="audio" />.</para></entry>
101
<entry><structfield>tuner</structfield></entry>
102
<entry>Capture devices can have zero or more tuners (RF
103
demodulators). When the <structfield>type</structfield> is set to
104
<constant>V4L2_INPUT_TYPE_TUNER</constant> this is an RF connector and
105
this field identifies the tuner. It corresponds to
106
&v4l2-tuner; field <structfield>index</structfield>. For details on
107
tuners see <xref linkend="tuner" />.</entry>
110
<entry>&v4l2-std-id;</entry>
111
<entry><structfield>std</structfield></entry>
112
<entry>Every video input supports one or more different
113
video standards. This field is a set of all supported standards. For
114
details on video standards and how to switch see <xref
115
linkend="standard" />.</entry>
119
<entry><structfield>status</structfield></entry>
120
<entry>This field provides status information about the
121
input. See <xref linkend="input-status" /> for flags.
122
With the exception of the sensor orientation bits <structfield>status</structfield> is only valid when this is the
123
current input.</entry>
127
<entry><structfield>capabilities</structfield></entry>
128
<entry>This field provides capabilities for the
129
input. See <xref linkend="input-capabilities" /> for flags.</entry>
133
<entry><structfield>reserved</structfield>[3]</entry>
134
<entry>Reserved for future extensions. Drivers must set
135
the array to zero.</entry>
141
<table frame="none" pgwide="1" id="input-type">
142
<title>Input Types</title>
147
<entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
149
<entry>This input uses a tuner (RF demodulator).</entry>
152
<entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
154
<entry>Analog baseband input, for example CVBS /
155
Composite Video, S-Video, RGB.</entry>
161
<!-- Status flags based on proposal by Mark McClelland,
162
video4linux-list@redhat.com on 18 Oct 2002, subject "Re: [V4L] Re:
163
v4l2 api". "Why are some of them inverted? So that the driver doesn't
164
have to lie about the status in cases where it can't tell one way or
165
the other. Plus, a status of zero would generally mean that everything
168
<table frame="none" pgwide="1" id="input-status">
169
<title>Input Status Flags</title>
171
<colspec colname="c1" />
172
<colspec colname="c2" align="center" />
173
<colspec colname="c3" />
174
<spanspec namest="c1" nameend="c3" spanname="hspan"
178
<entry spanname="hspan">General</entry>
181
<entry><constant>V4L2_IN_ST_NO_POWER</constant></entry>
182
<entry>0x00000001</entry>
183
<entry>Attached device is off.</entry>
186
<entry><constant>V4L2_IN_ST_NO_SIGNAL</constant></entry>
187
<entry>0x00000002</entry>
191
<entry><constant>V4L2_IN_ST_NO_COLOR</constant></entry>
192
<entry>0x00000004</entry>
193
<entry>The hardware supports color decoding, but does not
194
detect color modulation in the signal.</entry>
197
<entry spanname="hspan">Sensor Orientation</entry>
200
<entry><constant>V4L2_IN_ST_HFLIP</constant></entry>
201
<entry>0x00000010</entry>
202
<entry>The input is connected to a device that produces a signal
203
that is flipped horizontally and does not correct this before passing the
204
signal to userspace.</entry>
207
<entry><constant>V4L2_IN_ST_VFLIP</constant></entry>
208
<entry>0x00000020</entry>
209
<entry>The input is connected to a device that produces a signal
210
that is flipped vertically and does not correct this before passing the
211
signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry>
214
<entry spanname="hspan">Analog Video</entry>
217
<entry><constant>V4L2_IN_ST_NO_H_LOCK</constant></entry>
218
<entry>0x00000100</entry>
219
<entry>No horizontal sync lock.</entry>
222
<entry><constant>V4L2_IN_ST_COLOR_KILL</constant></entry>
223
<entry>0x00000200</entry>
224
<entry>A color killer circuit automatically disables color
225
decoding when it detects no color modulation. When this flag is set
226
the color killer is enabled <emphasis>and</emphasis> has shut off
227
color decoding.</entry>
230
<entry spanname="hspan">Digital Video</entry>
233
<entry><constant>V4L2_IN_ST_NO_SYNC</constant></entry>
234
<entry>0x00010000</entry>
235
<entry>No synchronization lock.</entry>
238
<entry><constant>V4L2_IN_ST_NO_EQU</constant></entry>
239
<entry>0x00020000</entry>
240
<entry>No equalizer lock.</entry>
243
<entry><constant>V4L2_IN_ST_NO_CARRIER</constant></entry>
244
<entry>0x00040000</entry>
245
<entry>Carrier recovery failed.</entry>
248
<entry spanname="hspan">VCR and Set-Top Box</entry>
251
<entry><constant>V4L2_IN_ST_MACROVISION</constant></entry>
252
<entry>0x01000000</entry>
253
<entry>Macrovision is an analog copy prevention system
254
mangling the video signal to confuse video recorders. When this
255
flag is set Macrovision has been detected.</entry>
258
<entry><constant>V4L2_IN_ST_NO_ACCESS</constant></entry>
259
<entry>0x02000000</entry>
260
<entry>Conditional access denied.</entry>
263
<entry><constant>V4L2_IN_ST_VTR</constant></entry>
264
<entry>0x04000000</entry>
265
<entry>VTR time constant. [?]</entry>
271
<!-- Capability flags based on video timings RFC by Muralidharan
272
Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
273
input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
275
<table frame="none" pgwide="1" id="input-capabilities">
276
<title>Input capabilities</title>
281
<entry><constant>V4L2_IN_CAP_PRESETS</constant></entry>
282
<entry>0x00000001</entry>
283
<entry>This input supports setting DV presets by using VIDIOC_S_DV_PRESET.</entry>
286
<entry><constant>V4L2_IN_CAP_CUSTOM_TIMINGS</constant></entry>
287
<entry>0x00000002</entry>
288
<entry>This input supports setting custom video timings by using VIDIOC_S_DV_TIMINGS.</entry>
291
<entry><constant>V4L2_IN_CAP_STD</constant></entry>
292
<entry>0x00000004</entry>
293
<entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
305
<term><errorcode>EINVAL</errorcode></term>
307
<para>The &v4l2-input; <structfield>index</structfield> is
308
out of bounds.</para>
318
sgml-parent-document: "v4l2.sgml"
319
indent-tabs-mode: nil