1 .. -*- coding: utf-8; mode: rst -*-
12 VIDIOC_ENUMINPUT - Enumerate video inputs
18 .. cpp:function:: int ioctl( int fd, int request, struct v4l2_input *argp )
25 File descriptor returned by :ref:`open() <func-open>`.
36 To query the attributes of a video input applications initialize the
37 ``index`` field of struct :ref:`v4l2_input <v4l2-input>` and call the
38 :ref:`VIDIOC_ENUMINPUT` ioctl with a pointer to this structure. Drivers
39 fill the rest of the structure or return an ``EINVAL`` error code when the
40 index is out of bounds. To enumerate all inputs applications shall begin
41 at index zero, incrementing by one until the driver returns ``EINVAL``.
46 .. flat-table:: struct v4l2_input
58 - Identifies the input, set by the application.
66 - Name of the video input, a NUL-terminated ASCII string, for
67 example: "Vin (Composite 2)". This information is intended for the
68 user, preferably the connector label on the device itself.
76 - Type of the input, see :ref:`input-type`.
84 - Drivers can enumerate up to 32 video and audio inputs. This field
85 shows which audio inputs were selectable as audio source if this
86 was the currently selected video input. It is a bit mask. The LSB
87 corresponds to audio input 0, the MSB to input 31. Any number of
88 bits can be set, or none.
90 When the driver does not enumerate audio inputs no bits must be
91 set. Applications shall not interpret this as lack of audio
92 support. Some drivers automatically select audio sources and do
93 not enumerate them since there is no choice anyway.
95 For details on audio inputs and how to select the current input
104 - Capture devices can have zero or more tuners (RF demodulators).
105 When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
106 RF connector and this field identifies the tuner. It corresponds
107 to struct :ref:`v4l2_tuner <v4l2-tuner>` field ``index``. For
108 details on tuners see :ref:`tuner`.
112 - :ref:`v4l2_std_id <v4l2-std-id>`
116 - Every video input supports one or more different video standards.
117 This field is a set of all supported standards. For details on
118 video standards and how to switch see :ref:`standard`.
126 - This field provides status information about the input. See
127 :ref:`input-status` for flags. With the exception of the sensor
128 orientation bits ``status`` is only valid when this is the current
137 - This field provides capabilities for the input. See
138 :ref:`input-capabilities` for flags.
146 - Reserved for future extensions. Drivers must set the array to
153 .. flat-table:: Input Types
161 - ``V4L2_INPUT_TYPE_TUNER``
165 - This input uses a tuner (RF demodulator).
169 - ``V4L2_INPUT_TYPE_CAMERA``
173 - Analog baseband input, for example CVBS / Composite Video,
180 .. flat-table:: Input Status Flags
191 - ``V4L2_IN_ST_NO_POWER``
195 - Attached device is off.
199 - ``V4L2_IN_ST_NO_SIGNAL``
207 - ``V4L2_IN_ST_NO_COLOR``
211 - The hardware supports color decoding, but does not detect color
212 modulation in the signal.
216 - :cspan:`2` Sensor Orientation
220 - ``V4L2_IN_ST_HFLIP``
224 - The input is connected to a device that produces a signal that is
225 flipped horizontally and does not correct this before passing the
230 - ``V4L2_IN_ST_VFLIP``
234 - The input is connected to a device that produces a signal that is
235 flipped vertically and does not correct this before passing the
237 .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
241 - :cspan:`2` Analog Video
245 - ``V4L2_IN_ST_NO_H_LOCK``
249 - No horizontal sync lock.
253 - ``V4L2_IN_ST_COLOR_KILL``
257 - A color killer circuit automatically disables color decoding when
258 it detects no color modulation. When this flag is set the color
259 killer is enabled *and* has shut off color decoding.
263 - :cspan:`2` Digital Video
267 - ``V4L2_IN_ST_NO_SYNC``
271 - No synchronization lock.
275 - ``V4L2_IN_ST_NO_EQU``
283 - ``V4L2_IN_ST_NO_CARRIER``
287 - Carrier recovery failed.
291 - :cspan:`2` VCR and Set-Top Box
295 - ``V4L2_IN_ST_MACROVISION``
299 - Macrovision is an analog copy prevention system mangling the video
300 signal to confuse video recorders. When this flag is set
301 Macrovision has been detected.
305 - ``V4L2_IN_ST_NO_ACCESS``
309 - Conditional access denied.
317 - VTR time constant. [?]
321 .. _input-capabilities:
323 .. flat-table:: Input capabilities
331 - ``V4L2_IN_CAP_DV_TIMINGS``
335 - This input supports setting video timings by using
340 - ``V4L2_IN_CAP_STD``
344 - This input supports setting the TV standard by using
349 - ``V4L2_IN_CAP_NATIVE_SIZE``
353 - This input supports setting the native size using the
354 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
355 :ref:`v4l2-selections-common`.
361 On success 0 is returned, on error -1 and the ``errno`` variable is set
362 appropriately. The generic error codes are described at the
363 :ref:`Generic Error Codes <gen-errors>` chapter.
366 The struct :ref:`v4l2_input <v4l2-input>` ``index`` is out of