vidioc-enuminput.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <refentry id="vidioc-enuminput">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_ENUMINPUT</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_ENUMINPUT</refname>
  8. <refpurpose>Enumerate video inputs</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct v4l2_input
  17. *<parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_ENUMINPUT</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>To query the attributes of a video input applications
  47. initialize the <structfield>index</structfield> field of &v4l2-input;
  48. and call the <constant>VIDIOC_ENUMINPUT</constant> ioctl with a
  49. pointer to this structure. Drivers fill the rest of the structure or
  50. return an &EINVAL; when the index is out of bounds. To enumerate all
  51. inputs applications shall begin at index zero, incrementing by one
  52. until the driver returns <errorcode>EINVAL</errorcode>.</para>
  53. <table frame="none" pgwide="1" id="v4l2-input">
  54. <title>struct <structname>v4l2_input</structname></title>
  55. <tgroup cols="3">
  56. &cs-str;
  57. <tbody valign="top">
  58. <row>
  59. <entry>__u32</entry>
  60. <entry><structfield>index</structfield></entry>
  61. <entry>Identifies the input, set by the
  62. application.</entry>
  63. </row>
  64. <row>
  65. <entry>__u8</entry>
  66. <entry><structfield>name</structfield>[32]</entry>
  67. <entry>Name of the video input, a NUL-terminated ASCII
  68. string, for example: "Vin (Composite 2)". This information is intended
  69. for the user, preferably the connector label on the device itself.</entry>
  70. </row>
  71. <row>
  72. <entry>__u32</entry>
  73. <entry><structfield>type</structfield></entry>
  74. <entry>Type of the input, see <xref
  75. linkend="input-type" />.</entry>
  76. </row>
  77. <row>
  78. <entry>__u32</entry>
  79. <entry><structfield>audioset</structfield></entry>
  80. <entry><para>Drivers can enumerate up to 32 video and
  81. audio inputs. This field shows which audio inputs were selectable as
  82. audio source if this was the currently selected video input. It is a
  83. bit mask. The LSB corresponds to audio input 0, the MSB to input 31.
  84. Any number of bits can be set, or none.</para><para>When the driver
  85. does not enumerate audio inputs no bits must be set. Applications
  86. shall not interpret this as lack of audio support. Some drivers
  87. automatically select audio sources and do not enumerate them since
  88. there is no choice anyway.</para><para>For details on audio inputs and
  89. how to select the current input see <xref
  90. linkend="audio" />.</para></entry>
  91. </row>
  92. <row>
  93. <entry>__u32</entry>
  94. <entry><structfield>tuner</structfield></entry>
  95. <entry>Capture devices can have zero or more tuners (RF
  96. demodulators). When the <structfield>type</structfield> is set to
  97. <constant>V4L2_INPUT_TYPE_TUNER</constant> this is an RF connector and
  98. this field identifies the tuner. It corresponds to
  99. &v4l2-tuner; field <structfield>index</structfield>. For details on
  100. tuners see <xref linkend="tuner" />.</entry>
  101. </row>
  102. <row>
  103. <entry>&v4l2-std-id;</entry>
  104. <entry><structfield>std</structfield></entry>
  105. <entry>Every video input supports one or more different
  106. video standards. This field is a set of all supported standards. For
  107. details on video standards and how to switch see <xref
  108. linkend="standard" />.</entry>
  109. </row>
  110. <row>
  111. <entry>__u32</entry>
  112. <entry><structfield>status</structfield></entry>
  113. <entry>This field provides status information about the
  114. input. See <xref linkend="input-status" /> for flags.
  115. With the exception of the sensor orientation bits <structfield>status</structfield> is only valid when this is the
  116. current input.</entry>
  117. </row>
  118. <row>
  119. <entry>__u32</entry>
  120. <entry><structfield>reserved</structfield>[4]</entry>
  121. <entry>Reserved for future extensions. Drivers must set
  122. the array to zero.</entry>
  123. </row>
  124. </tbody>
  125. </tgroup>
  126. </table>
  127. <table frame="none" pgwide="1" id="input-type">
  128. <title>Input Types</title>
  129. <tgroup cols="3">
  130. &cs-def;
  131. <tbody valign="top">
  132. <row>
  133. <entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
  134. <entry>1</entry>
  135. <entry>This input uses a tuner (RF demodulator).</entry>
  136. </row>
  137. <row>
  138. <entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
  139. <entry>2</entry>
  140. <entry>Analog baseband input, for example CVBS /
  141. Composite Video, S-Video, RGB.</entry>
  142. </row>
  143. </tbody>
  144. </tgroup>
  145. </table>
  146. <!-- Status flags based on proposal by Mark McClelland,
  147. video4linux-list@redhat.com on 18 Oct 2002, subject "Re: [V4L] Re:
  148. v4l2 api". "Why are some of them inverted? So that the driver doesn't
  149. have to lie about the status in cases where it can't tell one way or
  150. the other. Plus, a status of zero would generally mean that everything
  151. is OK." -->
  152. <table frame="none" pgwide="1" id="input-status">
  153. <title>Input Status Flags</title>
  154. <tgroup cols="3">
  155. <colspec colname="c1" />
  156. <colspec colname="c2" align="center" />
  157. <colspec colname="c3" />
  158. <spanspec namest="c1" nameend="c3" spanname="hspan"
  159. align="left" />
  160. <tbody valign="top">
  161. <row>
  162. <entry spanname="hspan">General</entry>
  163. </row>
  164. <row>
  165. <entry><constant>V4L2_IN_ST_NO_POWER</constant></entry>
  166. <entry>0x00000001</entry>
  167. <entry>Attached device is off.</entry>
  168. </row>
  169. <row>
  170. <entry><constant>V4L2_IN_ST_NO_SIGNAL</constant></entry>
  171. <entry>0x00000002</entry>
  172. <entry></entry>
  173. </row>
  174. <row>
  175. <entry><constant>V4L2_IN_ST_NO_COLOR</constant></entry>
  176. <entry>0x00000004</entry>
  177. <entry>The hardware supports color decoding, but does not
  178. detect color modulation in the signal.</entry>
  179. </row>
  180. <row>
  181. <entry spanname="hspan">Sensor Orientation</entry>
  182. </row>
  183. <row>
  184. <entry><constant>V4L2_IN_ST_HFLIP</constant></entry>
  185. <entry>0x00000010</entry>
  186. <entry>The input is connected to a device that produces a signal
  187. that is flipped horizontally and does not correct this before passing the
  188. signal to userspace.</entry>
  189. </row>
  190. <row>
  191. <entry><constant>V4L2_IN_ST_VFLIP</constant></entry>
  192. <entry>0x00000020</entry>
  193. <entry>The input is connected to a device that produces a signal
  194. that is flipped vertically and does not correct this before passing the
  195. signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry>
  196. </row>
  197. <row>
  198. <entry spanname="hspan">Analog Video</entry>
  199. </row>
  200. <row>
  201. <entry><constant>V4L2_IN_ST_NO_H_LOCK</constant></entry>
  202. <entry>0x00000100</entry>
  203. <entry>No horizontal sync lock.</entry>
  204. </row>
  205. <row>
  206. <entry><constant>V4L2_IN_ST_COLOR_KILL</constant></entry>
  207. <entry>0x00000200</entry>
  208. <entry>A color killer circuit automatically disables color
  209. decoding when it detects no color modulation. When this flag is set
  210. the color killer is enabled <emphasis>and</emphasis> has shut off
  211. color decoding.</entry>
  212. </row>
  213. <row>
  214. <entry spanname="hspan">Digital Video</entry>
  215. </row>
  216. <row>
  217. <entry><constant>V4L2_IN_ST_NO_SYNC</constant></entry>
  218. <entry>0x00010000</entry>
  219. <entry>No synchronization lock.</entry>
  220. </row>
  221. <row>
  222. <entry><constant>V4L2_IN_ST_NO_EQU</constant></entry>
  223. <entry>0x00020000</entry>
  224. <entry>No equalizer lock.</entry>
  225. </row>
  226. <row>
  227. <entry><constant>V4L2_IN_ST_NO_CARRIER</constant></entry>
  228. <entry>0x00040000</entry>
  229. <entry>Carrier recovery failed.</entry>
  230. </row>
  231. <row>
  232. <entry spanname="hspan">VCR and Set-Top Box</entry>
  233. </row>
  234. <row>
  235. <entry><constant>V4L2_IN_ST_MACROVISION</constant></entry>
  236. <entry>0x01000000</entry>
  237. <entry>Macrovision is an analog copy prevention system
  238. mangling the video signal to confuse video recorders. When this
  239. flag is set Macrovision has been detected.</entry>
  240. </row>
  241. <row>
  242. <entry><constant>V4L2_IN_ST_NO_ACCESS</constant></entry>
  243. <entry>0x02000000</entry>
  244. <entry>Conditional access denied.</entry>
  245. </row>
  246. <row>
  247. <entry><constant>V4L2_IN_ST_VTR</constant></entry>
  248. <entry>0x04000000</entry>
  249. <entry>VTR time constant. [?]</entry>
  250. </row>
  251. </tbody>
  252. </tgroup>
  253. </table>
  254. </refsect1>
  255. <refsect1>
  256. &return-value;
  257. <variablelist>
  258. <varlistentry>
  259. <term><errorcode>EINVAL</errorcode></term>
  260. <listitem>
  261. <para>The &v4l2-input; <structfield>index</structfield> is
  262. out of bounds.</para>
  263. </listitem>
  264. </varlistentry>
  265. </variablelist>
  266. </refsect1>
  267. </refentry>
  268. <!--
  269. Local Variables:
  270. mode: sgml
  271. sgml-parent-document: "v4l2.sgml"
  272. indent-tabs-mode: nil
  273. End:
  274. -->