230 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_ENUMINPUT:5 6**********************7ioctl VIDIOC_ENUMINPUT8**********************9 10Name11====12 13VIDIOC_ENUMINPUT - Enumerate video inputs14 15Synopsis16========17 18.. c:macro:: VIDIOC_ENUMINPUT19 20``int ioctl(int fd, VIDIOC_ENUMINPUT, struct v4l2_input *argp)``21 22Arguments23=========24 25``fd``26 File descriptor returned by :c:func:`open()`.27 28``argp``29 Pointer to struct :c:type:`v4l2_input`.30 31Description32===========33 34To query the attributes of a video input applications initialize the35``index`` field of struct :c:type:`v4l2_input` and call the36:ref:`VIDIOC_ENUMINPUT` with a pointer to this structure. Drivers37fill the rest of the structure or return an ``EINVAL`` error code when the38index is out of bounds. To enumerate all inputs applications shall begin39at index zero, incrementing by one until the driver returns ``EINVAL``.40 41.. tabularcolumns:: |p{3.0cm}|p{3.5cm}|p{10.8cm}|42 43.. c:type:: v4l2_input44 45.. flat-table:: struct v4l2_input46 :header-rows: 047 :stub-columns: 048 :widths: 1 1 249 50 * - __u3251 - ``index``52 - Identifies the input, set by the application.53 * - __u854 - ``name``\ [32]55 - Name of the video input, a NUL-terminated ASCII string, for56 example: "Vin (Composite 2)". This information is intended for the57 user, preferably the connector label on the device itself.58 * - __u3259 - ``type``60 - Type of the input, see :ref:`input-type`.61 * - __u3262 - ``audioset``63 - Drivers can enumerate up to 32 video and audio inputs. This field64 shows which audio inputs were selectable as audio source if this65 was the currently selected video input. It is a bit mask. The LSB66 corresponds to audio input 0, the MSB to input 31. Any number of67 bits can be set, or none.68 69 When the driver does not enumerate audio inputs no bits must be70 set. Applications shall not interpret this as lack of audio71 support. Some drivers automatically select audio sources and do72 not enumerate them since there is no choice anyway.73 74 For details on audio inputs and how to select the current input75 see :ref:`audio`.76 * - __u3277 - ``tuner``78 - Capture devices can have zero or more tuners (RF demodulators).79 When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an80 RF connector and this field identifies the tuner. It corresponds81 to struct :c:type:`v4l2_tuner` field ``index``. For82 details on tuners see :ref:`tuner`.83 * - :ref:`v4l2_std_id <v4l2-std-id>`84 - ``std``85 - Every video input supports one or more different video standards.86 This field is a set of all supported standards. For details on87 video standards and how to switch see :ref:`standard`.88 * - __u3289 - ``status``90 - This field provides status information about the input. See91 :ref:`input-status` for flags. With the exception of the sensor92 orientation bits ``status`` is only valid when this is the current93 input.94 * - __u3295 - ``capabilities``96 - This field provides capabilities for the input. See97 :ref:`input-capabilities` for flags.98 * - __u3299 - ``reserved``\ [3]100 - Reserved for future extensions. Drivers must set the array to101 zero.102 103 104.. tabularcolumns:: |p{6.6cm}|p{1.0cm}|p{9.7cm}|105 106.. _input-type:107 108.. flat-table:: Input Types109 :header-rows: 0110 :stub-columns: 0111 :widths: 3 1 4112 113 * - ``V4L2_INPUT_TYPE_TUNER``114 - 1115 - This input uses a tuner (RF demodulator).116 * - ``V4L2_INPUT_TYPE_CAMERA``117 - 2118 - Any non-tuner video input, for example Composite Video,119 S-Video, HDMI, camera sensor. The naming as ``_TYPE_CAMERA`` is historical,120 today we would have called it ``_TYPE_VIDEO``.121 * - ``V4L2_INPUT_TYPE_TOUCH``122 - 3123 - This input is a touch device for capturing raw touch data.124 125 126.. tabularcolumns:: |p{5.6cm}|p{2.6cm}|p{9.1cm}|127 128.. _input-status:129 130.. flat-table:: Input Status Flags131 :header-rows: 0132 :stub-columns: 0133 134 * - :cspan:`2` General135 * - ``V4L2_IN_ST_NO_POWER``136 - 0x00000001137 - Attached device is off.138 * - ``V4L2_IN_ST_NO_SIGNAL``139 - 0x00000002140 -141 * - ``V4L2_IN_ST_NO_COLOR``142 - 0x00000004143 - The hardware supports color decoding, but does not detect color144 modulation in the signal.145 * - :cspan:`2` Sensor Orientation146 * - ``V4L2_IN_ST_HFLIP``147 - 0x00000010148 - The input is connected to a device that produces a signal that is149 flipped horizontally and does not correct this before passing the150 signal to userspace.151 * - ``V4L2_IN_ST_VFLIP``152 - 0x00000020153 - The input is connected to a device that produces a signal that is154 flipped vertically and does not correct this before passing the155 signal to userspace.156 .. note:: A 180 degree rotation is the same as HFLIP | VFLIP157 * - :cspan:`2` Analog Video158 * - ``V4L2_IN_ST_NO_H_LOCK``159 - 0x00000100160 - No horizontal sync lock.161 * - ``V4L2_IN_ST_COLOR_KILL``162 - 0x00000200163 - A color killer circuit automatically disables color decoding when164 it detects no color modulation. When this flag is set the color165 killer is enabled *and* has shut off color decoding.166 * - ``V4L2_IN_ST_NO_V_LOCK``167 - 0x00000400168 - No vertical sync lock.169 * - ``V4L2_IN_ST_NO_STD_LOCK``170 - 0x00000800171 - No standard format lock in case of auto-detection format172 by the component.173 * - :cspan:`2` Digital Video174 * - ``V4L2_IN_ST_NO_SYNC``175 - 0x00010000176 - No synchronization lock.177 * - ``V4L2_IN_ST_NO_EQU``178 - 0x00020000179 - No equalizer lock.180 * - ``V4L2_IN_ST_NO_CARRIER``181 - 0x00040000182 - Carrier recovery failed.183 * - :cspan:`2` VCR and Set-Top Box184 * - ``V4L2_IN_ST_MACROVISION``185 - 0x01000000186 - Macrovision is an analog copy prevention system mangling the video187 signal to confuse video recorders. When this flag is set188 Macrovision has been detected.189 * - ``V4L2_IN_ST_NO_ACCESS``190 - 0x02000000191 - Conditional access denied.192 * - ``V4L2_IN_ST_VTR``193 - 0x04000000194 - VTR time constant. [?]195 196 197.. tabularcolumns:: |p{6.6cm}|p{2.4cm}|p{8.3cm}|198 199.. _input-capabilities:200 201.. flat-table:: Input capabilities202 :header-rows: 0203 :stub-columns: 0204 :widths: 3 1 4205 206 * - ``V4L2_IN_CAP_DV_TIMINGS``207 - 0x00000002208 - This input supports setting video timings by using209 ``VIDIOC_S_DV_TIMINGS``.210 * - ``V4L2_IN_CAP_STD``211 - 0x00000004212 - This input supports setting the TV standard by using213 ``VIDIOC_S_STD``.214 * - ``V4L2_IN_CAP_NATIVE_SIZE``215 - 0x00000008216 - This input supports setting the native size using the217 ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see218 :ref:`v4l2-selections-common`.219 220Return Value221============222 223On success 0 is returned, on error -1 and the ``errno`` variable is set224appropriately. The generic error codes are described at the225:ref:`Generic Error Codes <gen-errors>` chapter.226 227EINVAL228 The struct :c:type:`v4l2_input` ``index`` is out of229 bounds.230