1 .. -*- coding: utf-8; mode: rst -*-
12 VIDIOC_ENUMINPUT - Enumerate video inputs
18 .. c: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``.
44 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
48 .. flat-table:: struct v4l2_input
60 - Identifies the input, set by the application.
68 - Name of the video input, a NUL-terminated ASCII string, for
69 example: "Vin (Composite 2)". This information is intended for the
70 user, preferably the connector label on the device itself.
78 - Type of the input, see :ref:`input-type`.
86 - Drivers can enumerate up to 32 video and audio inputs. This field
87 shows which audio inputs were selectable as audio source if this
88 was the currently selected video input. It is a bit mask. The LSB
89 corresponds to audio input 0, the MSB to input 31. Any number of
90 bits can be set, or none.
92 When the driver does not enumerate audio inputs no bits must be
93 set. Applications shall not interpret this as lack of audio
94 support. Some drivers automatically select audio sources and do
95 not enumerate them since there is no choice anyway.
97 For details on audio inputs and how to select the current input
106 - Capture devices can have zero or more tuners (RF demodulators).
107 When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
108 RF connector and this field identifies the tuner. It corresponds
109 to struct :ref:`v4l2_tuner <v4l2-tuner>` field ``index``. For
110 details on tuners see :ref:`tuner`.
114 - :ref:`v4l2_std_id <v4l2-std-id>`
118 - Every video input supports one or more different video standards.
119 This field is a set of all supported standards. For details on
120 video standards and how to switch see :ref:`standard`.
128 - This field provides status information about the input. See
129 :ref:`input-status` for flags. With the exception of the sensor
130 orientation bits ``status`` is only valid when this is the current
139 - This field provides capabilities for the input. See
140 :ref:`input-capabilities` for flags.
148 - Reserved for future extensions. Drivers must set the array to
153 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
157 .. flat-table:: Input Types
165 - ``V4L2_INPUT_TYPE_TUNER``
169 - This input uses a tuner (RF demodulator).
173 - ``V4L2_INPUT_TYPE_CAMERA``
177 - Analog baseband input, for example CVBS / Composite Video,
182 .. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
186 .. flat-table:: Input Status Flags
197 - ``V4L2_IN_ST_NO_POWER``
201 - Attached device is off.
205 - ``V4L2_IN_ST_NO_SIGNAL``
213 - ``V4L2_IN_ST_NO_COLOR``
217 - The hardware supports color decoding, but does not detect color
218 modulation in the signal.
222 - :cspan:`2` Sensor Orientation
226 - ``V4L2_IN_ST_HFLIP``
230 - The input is connected to a device that produces a signal that is
231 flipped horizontally and does not correct this before passing the
236 - ``V4L2_IN_ST_VFLIP``
240 - The input is connected to a device that produces a signal that is
241 flipped vertically and does not correct this before passing the
243 .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
247 - :cspan:`2` Analog Video
251 - ``V4L2_IN_ST_NO_H_LOCK``
255 - No horizontal sync lock.
259 - ``V4L2_IN_ST_COLOR_KILL``
263 - A color killer circuit automatically disables color decoding when
264 it detects no color modulation. When this flag is set the color
265 killer is enabled *and* has shut off color decoding.
269 - :cspan:`2` Digital Video
273 - ``V4L2_IN_ST_NO_SYNC``
277 - No synchronization lock.
281 - ``V4L2_IN_ST_NO_EQU``
289 - ``V4L2_IN_ST_NO_CARRIER``
293 - Carrier recovery failed.
297 - :cspan:`2` VCR and Set-Top Box
301 - ``V4L2_IN_ST_MACROVISION``
305 - Macrovision is an analog copy prevention system mangling the video
306 signal to confuse video recorders. When this flag is set
307 Macrovision has been detected.
311 - ``V4L2_IN_ST_NO_ACCESS``
315 - Conditional access denied.
323 - VTR time constant. [?]
327 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
329 .. _input-capabilities:
331 .. flat-table:: Input capabilities
339 - ``V4L2_IN_CAP_DV_TIMINGS``
343 - This input supports setting video timings by using
348 - ``V4L2_IN_CAP_STD``
352 - This input supports setting the TV standard by using
357 - ``V4L2_IN_CAP_NATIVE_SIZE``
361 - This input supports setting the native size using the
362 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
363 :ref:`v4l2-selections-common`.
369 On success 0 is returned, on error -1 and the ``errno`` variable is set
370 appropriately. The generic error codes are described at the
371 :ref:`Generic Error Codes <gen-errors>` chapter.
374 The struct :ref:`v4l2_input <v4l2-input>` ``index`` is out of