1 .. -*- coding: utf-8; mode: rst -*-
12 VIDIOC_ENUMINPUT - Enumerate video inputs
18 .. c:function:: int ioctl( int fd, VIDIOC_ENUMINPUT, struct v4l2_input *argp )
19 :name: VIDIOC_ENUMINPUT
26 File descriptor returned by :ref:`open() <func-open>`.
29 Pointer to struct :c:type:`v4l2_input`.
35 To query the attributes of a video input applications initialize the
36 ``index`` field of struct :c:type:`v4l2_input` and call the
37 :ref:`VIDIOC_ENUMINPUT` with a pointer to this structure. Drivers
38 fill the rest of the structure or return an ``EINVAL`` error code when the
39 index is out of bounds. To enumerate all inputs applications shall begin
40 at index zero, incrementing by one until the driver returns ``EINVAL``.
43 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
45 .. c:type:: v4l2_input
47 .. flat-table:: struct v4l2_input
54 - Identifies the input, set by the application.
57 - Name of the video input, a NUL-terminated ASCII string, for
58 example: "Vin (Composite 2)". This information is intended for the
59 user, preferably the connector label on the device itself.
62 - Type of the input, see :ref:`input-type`.
65 - Drivers can enumerate up to 32 video and audio inputs. This field
66 shows which audio inputs were selectable as audio source if this
67 was the currently selected video input. It is a bit mask. The LSB
68 corresponds to audio input 0, the MSB to input 31. Any number of
69 bits can be set, or none.
71 When the driver does not enumerate audio inputs no bits must be
72 set. Applications shall not interpret this as lack of audio
73 support. Some drivers automatically select audio sources and do
74 not enumerate them since there is no choice anyway.
76 For details on audio inputs and how to select the current input
80 - Capture devices can have zero or more tuners (RF demodulators).
81 When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
82 RF connector and this field identifies the tuner. It corresponds
83 to struct :c:type:`v4l2_tuner` field ``index``. For
84 details on tuners see :ref:`tuner`.
85 * - :ref:`v4l2_std_id <v4l2-std-id>`
87 - Every video input supports one or more different video standards.
88 This field is a set of all supported standards. For details on
89 video standards and how to switch see :ref:`standard`.
92 - This field provides status information about the input. See
93 :ref:`input-status` for flags. With the exception of the sensor
94 orientation bits ``status`` is only valid when this is the current
98 - This field provides capabilities for the input. See
99 :ref:`input-capabilities` for flags.
102 - Reserved for future extensions. Drivers must set the array to
107 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
111 .. flat-table:: Input Types
116 * - ``V4L2_INPUT_TYPE_TUNER``
118 - This input uses a tuner (RF demodulator).
119 * - ``V4L2_INPUT_TYPE_CAMERA``
121 - Any non-tuner video input, for example Composite Video,
122 S-Video, HDMI, camera sensor. The naming as ``_TYPE_CAMERA`` is historical,
123 today we would have called it ``_TYPE_VIDEO``.
124 * - ``V4L2_INPUT_TYPE_TOUCH``
126 - This input is a touch device for capturing raw touch data.
130 .. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
134 .. flat-table:: Input Status Flags
138 * - :cspan:`2` General
139 * - ``V4L2_IN_ST_NO_POWER``
141 - Attached device is off.
142 * - ``V4L2_IN_ST_NO_SIGNAL``
145 * - ``V4L2_IN_ST_NO_COLOR``
147 - The hardware supports color decoding, but does not detect color
148 modulation in the signal.
149 * - :cspan:`2` Sensor Orientation
150 * - ``V4L2_IN_ST_HFLIP``
152 - The input is connected to a device that produces a signal that is
153 flipped horizontally and does not correct this before passing the
155 * - ``V4L2_IN_ST_VFLIP``
157 - The input is connected to a device that produces a signal that is
158 flipped vertically and does not correct this before passing the
160 .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
161 * - :cspan:`2` Analog Video
162 * - ``V4L2_IN_ST_NO_H_LOCK``
164 - No horizontal sync lock.
165 * - ``V4L2_IN_ST_COLOR_KILL``
167 - A color killer circuit automatically disables color decoding when
168 it detects no color modulation. When this flag is set the color
169 killer is enabled *and* has shut off color decoding.
170 * - ``V4L2_IN_ST_NO_V_LOCK``
172 - No vertical sync lock.
173 * - ``V4L2_IN_ST_NO_STD_LOCK``
175 - No standard format lock in case of auto-detection format
177 * - :cspan:`2` Digital Video
178 * - ``V4L2_IN_ST_NO_SYNC``
180 - No synchronization lock.
181 * - ``V4L2_IN_ST_NO_EQU``
184 * - ``V4L2_IN_ST_NO_CARRIER``
186 - Carrier recovery failed.
187 * - :cspan:`2` VCR and Set-Top Box
188 * - ``V4L2_IN_ST_MACROVISION``
190 - Macrovision is an analog copy prevention system mangling the video
191 signal to confuse video recorders. When this flag is set
192 Macrovision has been detected.
193 * - ``V4L2_IN_ST_NO_ACCESS``
195 - Conditional access denied.
196 * - ``V4L2_IN_ST_VTR``
198 - VTR time constant. [?]
202 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
204 .. _input-capabilities:
206 .. flat-table:: Input capabilities
211 * - ``V4L2_IN_CAP_DV_TIMINGS``
213 - This input supports setting video timings by using
214 ``VIDIOC_S_DV_TIMINGS``.
215 * - ``V4L2_IN_CAP_STD``
217 - This input supports setting the TV standard by using
219 * - ``V4L2_IN_CAP_NATIVE_SIZE``
221 - This input supports setting the native size using the
222 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
223 :ref:`v4l2-selections-common`.
229 On success 0 is returned, on error -1 and the ``errno`` variable is set
230 appropriately. The generic error codes are described at the
231 :ref:`Generic Error Codes <gen-errors>` chapter.
234 The struct :c:type:`v4l2_input` ``index`` is out of