vidioc-enuminput.rst 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_ENUMINPUT:
  3. **********************
  4. ioctl VIDIOC_ENUMINPUT
  5. **********************
  6. Name
  7. ====
  8. VIDIOC_ENUMINPUT - Enumerate video inputs
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_ENUMINPUT, struct v4l2_input *argp )
  12. :name: VIDIOC_ENUMINPUT
  13. Arguments
  14. =========
  15. ``fd``
  16. File descriptor returned by :ref:`open() <func-open>`.
  17. ``argp``
  18. Description
  19. ===========
  20. To query the attributes of a video input applications initialize the
  21. ``index`` field of struct :c:type:`v4l2_input` and call the
  22. :ref:`VIDIOC_ENUMINPUT` ioctl with a pointer to this structure. Drivers
  23. fill the rest of the structure or return an ``EINVAL`` error code when the
  24. index is out of bounds. To enumerate all inputs applications shall begin
  25. at index zero, incrementing by one until the driver returns ``EINVAL``.
  26. .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
  27. .. c:type:: v4l2_input
  28. .. flat-table:: struct v4l2_input
  29. :header-rows: 0
  30. :stub-columns: 0
  31. :widths: 1 1 2
  32. * - __u32
  33. - ``index``
  34. - Identifies the input, set by the application.
  35. * - __u8
  36. - ``name``\ [32]
  37. - Name of the video input, a NUL-terminated ASCII string, for
  38. example: "Vin (Composite 2)". This information is intended for the
  39. user, preferably the connector label on the device itself.
  40. * - __u32
  41. - ``type``
  42. - Type of the input, see :ref:`input-type`.
  43. * - __u32
  44. - ``audioset``
  45. - Drivers can enumerate up to 32 video and audio inputs. This field
  46. shows which audio inputs were selectable as audio source if this
  47. was the currently selected video input. It is a bit mask. The LSB
  48. corresponds to audio input 0, the MSB to input 31. Any number of
  49. bits can be set, or none.
  50. When the driver does not enumerate audio inputs no bits must be
  51. set. Applications shall not interpret this as lack of audio
  52. support. Some drivers automatically select audio sources and do
  53. not enumerate them since there is no choice anyway.
  54. For details on audio inputs and how to select the current input
  55. see :ref:`audio`.
  56. * - __u32
  57. - ``tuner``
  58. - Capture devices can have zero or more tuners (RF demodulators).
  59. When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
  60. RF connector and this field identifies the tuner. It corresponds
  61. to struct :c:type:`v4l2_tuner` field ``index``. For
  62. details on tuners see :ref:`tuner`.
  63. * - :ref:`v4l2_std_id <v4l2-std-id>`
  64. - ``std``
  65. - Every video input supports one or more different video standards.
  66. This field is a set of all supported standards. For details on
  67. video standards and how to switch see :ref:`standard`.
  68. * - __u32
  69. - ``status``
  70. - This field provides status information about the input. See
  71. :ref:`input-status` for flags. With the exception of the sensor
  72. orientation bits ``status`` is only valid when this is the current
  73. input.
  74. * - __u32
  75. - ``capabilities``
  76. - This field provides capabilities for the input. See
  77. :ref:`input-capabilities` for flags.
  78. * - __u32
  79. - ``reserved``\ [3]
  80. - Reserved for future extensions. Drivers must set the array to
  81. zero.
  82. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
  83. .. _input-type:
  84. .. flat-table:: Input Types
  85. :header-rows: 0
  86. :stub-columns: 0
  87. :widths: 3 1 4
  88. * - ``V4L2_INPUT_TYPE_TUNER``
  89. - 1
  90. - This input uses a tuner (RF demodulator).
  91. * - ``V4L2_INPUT_TYPE_CAMERA``
  92. - 2
  93. - Analog baseband input, for example CVBS / Composite Video,
  94. S-Video, RGB.
  95. * - ``V4L2_INPUT_TYPE_TOUCH``
  96. - 3
  97. - This input is a touch device for capturing raw touch data.
  98. .. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
  99. .. _input-status:
  100. .. flat-table:: Input Status Flags
  101. :header-rows: 0
  102. :stub-columns: 0
  103. * - :cspan:`2` General
  104. * - ``V4L2_IN_ST_NO_POWER``
  105. - 0x00000001
  106. - Attached device is off.
  107. * - ``V4L2_IN_ST_NO_SIGNAL``
  108. - 0x00000002
  109. -
  110. * - ``V4L2_IN_ST_NO_COLOR``
  111. - 0x00000004
  112. - The hardware supports color decoding, but does not detect color
  113. modulation in the signal.
  114. * - :cspan:`2` Sensor Orientation
  115. * - ``V4L2_IN_ST_HFLIP``
  116. - 0x00000010
  117. - The input is connected to a device that produces a signal that is
  118. flipped horizontally and does not correct this before passing the
  119. signal to userspace.
  120. * - ``V4L2_IN_ST_VFLIP``
  121. - 0x00000020
  122. - The input is connected to a device that produces a signal that is
  123. flipped vertically and does not correct this before passing the
  124. signal to userspace.
  125. .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
  126. * - :cspan:`2` Analog Video
  127. * - ``V4L2_IN_ST_NO_H_LOCK``
  128. - 0x00000100
  129. - No horizontal sync lock.
  130. * - ``V4L2_IN_ST_COLOR_KILL``
  131. - 0x00000200
  132. - A color killer circuit automatically disables color decoding when
  133. it detects no color modulation. When this flag is set the color
  134. killer is enabled *and* has shut off color decoding.
  135. * - ``V4L2_IN_ST_NO_V_LOCK``
  136. - 0x00000400
  137. - No vertical sync lock.
  138. * - ``V4L2_IN_ST_NO_STD_LOCK``
  139. - 0x00000800
  140. - No standard format lock in case of auto-detection format
  141. by the component.
  142. * - :cspan:`2` Digital Video
  143. * - ``V4L2_IN_ST_NO_SYNC``
  144. - 0x00010000
  145. - No synchronization lock.
  146. * - ``V4L2_IN_ST_NO_EQU``
  147. - 0x00020000
  148. - No equalizer lock.
  149. * - ``V4L2_IN_ST_NO_CARRIER``
  150. - 0x00040000
  151. - Carrier recovery failed.
  152. * - :cspan:`2` VCR and Set-Top Box
  153. * - ``V4L2_IN_ST_MACROVISION``
  154. - 0x01000000
  155. - Macrovision is an analog copy prevention system mangling the video
  156. signal to confuse video recorders. When this flag is set
  157. Macrovision has been detected.
  158. * - ``V4L2_IN_ST_NO_ACCESS``
  159. - 0x02000000
  160. - Conditional access denied.
  161. * - ``V4L2_IN_ST_VTR``
  162. - 0x04000000
  163. - VTR time constant. [?]
  164. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
  165. .. _input-capabilities:
  166. .. flat-table:: Input capabilities
  167. :header-rows: 0
  168. :stub-columns: 0
  169. :widths: 3 1 4
  170. * - ``V4L2_IN_CAP_DV_TIMINGS``
  171. - 0x00000002
  172. - This input supports setting video timings by using
  173. VIDIOC_S_DV_TIMINGS.
  174. * - ``V4L2_IN_CAP_STD``
  175. - 0x00000004
  176. - This input supports setting the TV standard by using
  177. VIDIOC_S_STD.
  178. * - ``V4L2_IN_CAP_NATIVE_SIZE``
  179. - 0x00000008
  180. - This input supports setting the native size using the
  181. ``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
  182. :ref:`v4l2-selections-common`.
  183. Return Value
  184. ============
  185. On success 0 is returned, on error -1 and the ``errno`` variable is set
  186. appropriately. The generic error codes are described at the
  187. :ref:`Generic Error Codes <gen-errors>` chapter.
  188. EINVAL
  189. The struct :c:type:`v4l2_input` ``index`` is out of
  190. bounds.