vidioc-enuminput.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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>capabilities</structfield></entry>
  121. <entry>This field provides capabilities for the
  122. input. See <xref linkend="input-capabilities" /> for flags.</entry>
  123. </row>
  124. <row>
  125. <entry>__u32</entry>
  126. <entry><structfield>reserved</structfield>[3]</entry>
  127. <entry>Reserved for future extensions. Drivers must set
  128. the array to zero.</entry>
  129. </row>
  130. </tbody>
  131. </tgroup>
  132. </table>
  133. <table frame="none" pgwide="1" id="input-type">
  134. <title>Input Types</title>
  135. <tgroup cols="3">
  136. &cs-def;
  137. <tbody valign="top">
  138. <row>
  139. <entry><constant>V4L2_INPUT_TYPE_TUNER</constant></entry>
  140. <entry>1</entry>
  141. <entry>This input uses a tuner (RF demodulator).</entry>
  142. </row>
  143. <row>
  144. <entry><constant>V4L2_INPUT_TYPE_CAMERA</constant></entry>
  145. <entry>2</entry>
  146. <entry>Analog baseband input, for example CVBS /
  147. Composite Video, S-Video, RGB.</entry>
  148. </row>
  149. </tbody>
  150. </tgroup>
  151. </table>
  152. <!-- Status flags based on proposal by Mark McClelland,
  153. video4linux-list@redhat.com on 18 Oct 2002, subject "Re: [V4L] Re:
  154. v4l2 api". "Why are some of them inverted? So that the driver doesn't
  155. have to lie about the status in cases where it can't tell one way or
  156. the other. Plus, a status of zero would generally mean that everything
  157. is OK." -->
  158. <table frame="none" pgwide="1" id="input-status">
  159. <title>Input Status Flags</title>
  160. <tgroup cols="3">
  161. <colspec colname="c1" />
  162. <colspec colname="c2" align="center" />
  163. <colspec colname="c3" />
  164. <spanspec namest="c1" nameend="c3" spanname="hspan"
  165. align="left" />
  166. <tbody valign="top">
  167. <row>
  168. <entry spanname="hspan">General</entry>
  169. </row>
  170. <row>
  171. <entry><constant>V4L2_IN_ST_NO_POWER</constant></entry>
  172. <entry>0x00000001</entry>
  173. <entry>Attached device is off.</entry>
  174. </row>
  175. <row>
  176. <entry><constant>V4L2_IN_ST_NO_SIGNAL</constant></entry>
  177. <entry>0x00000002</entry>
  178. <entry></entry>
  179. </row>
  180. <row>
  181. <entry><constant>V4L2_IN_ST_NO_COLOR</constant></entry>
  182. <entry>0x00000004</entry>
  183. <entry>The hardware supports color decoding, but does not
  184. detect color modulation in the signal.</entry>
  185. </row>
  186. <row>
  187. <entry spanname="hspan">Sensor Orientation</entry>
  188. </row>
  189. <row>
  190. <entry><constant>V4L2_IN_ST_HFLIP</constant></entry>
  191. <entry>0x00000010</entry>
  192. <entry>The input is connected to a device that produces a signal
  193. that is flipped horizontally and does not correct this before passing the
  194. signal to userspace.</entry>
  195. </row>
  196. <row>
  197. <entry><constant>V4L2_IN_ST_VFLIP</constant></entry>
  198. <entry>0x00000020</entry>
  199. <entry>The input is connected to a device that produces a signal
  200. that is flipped vertically and does not correct this before passing the
  201. signal to userspace. Note that a 180 degree rotation is the same as HFLIP | VFLIP</entry>
  202. </row>
  203. <row>
  204. <entry spanname="hspan">Analog Video</entry>
  205. </row>
  206. <row>
  207. <entry><constant>V4L2_IN_ST_NO_H_LOCK</constant></entry>
  208. <entry>0x00000100</entry>
  209. <entry>No horizontal sync lock.</entry>
  210. </row>
  211. <row>
  212. <entry><constant>V4L2_IN_ST_COLOR_KILL</constant></entry>
  213. <entry>0x00000200</entry>
  214. <entry>A color killer circuit automatically disables color
  215. decoding when it detects no color modulation. When this flag is set
  216. the color killer is enabled <emphasis>and</emphasis> has shut off
  217. color decoding.</entry>
  218. </row>
  219. <row>
  220. <entry spanname="hspan">Digital Video</entry>
  221. </row>
  222. <row>
  223. <entry><constant>V4L2_IN_ST_NO_SYNC</constant></entry>
  224. <entry>0x00010000</entry>
  225. <entry>No synchronization lock.</entry>
  226. </row>
  227. <row>
  228. <entry><constant>V4L2_IN_ST_NO_EQU</constant></entry>
  229. <entry>0x00020000</entry>
  230. <entry>No equalizer lock.</entry>
  231. </row>
  232. <row>
  233. <entry><constant>V4L2_IN_ST_NO_CARRIER</constant></entry>
  234. <entry>0x00040000</entry>
  235. <entry>Carrier recovery failed.</entry>
  236. </row>
  237. <row>
  238. <entry spanname="hspan">VCR and Set-Top Box</entry>
  239. </row>
  240. <row>
  241. <entry><constant>V4L2_IN_ST_MACROVISION</constant></entry>
  242. <entry>0x01000000</entry>
  243. <entry>Macrovision is an analog copy prevention system
  244. mangling the video signal to confuse video recorders. When this
  245. flag is set Macrovision has been detected.</entry>
  246. </row>
  247. <row>
  248. <entry><constant>V4L2_IN_ST_NO_ACCESS</constant></entry>
  249. <entry>0x02000000</entry>
  250. <entry>Conditional access denied.</entry>
  251. </row>
  252. <row>
  253. <entry><constant>V4L2_IN_ST_VTR</constant></entry>
  254. <entry>0x04000000</entry>
  255. <entry>VTR time constant. [?]</entry>
  256. </row>
  257. </tbody>
  258. </tgroup>
  259. </table>
  260. <!-- Capability flags based on video timings RFC by Muralidharan
  261. Karicheri, titled RFC (v1.2): V4L - Support for video timings at the
  262. input/output interface to linux-media@vger.kernel.org on 19 Oct 2009.
  263. -->
  264. <table frame="none" pgwide="1" id="input-capabilities">
  265. <title>Input capabilities</title>
  266. <tgroup cols="3">
  267. &cs-def;
  268. <tbody valign="top">
  269. <row>
  270. <entry><constant>V4L2_IN_CAP_DV_TIMINGS</constant></entry>
  271. <entry>0x00000002</entry>
  272. <entry>This input supports setting video timings by using VIDIOC_S_DV_TIMINGS.</entry>
  273. </row>
  274. <row>
  275. <entry><constant>V4L2_IN_CAP_STD</constant></entry>
  276. <entry>0x00000004</entry>
  277. <entry>This input supports setting the TV standard by using VIDIOC_S_STD.</entry>
  278. </row>
  279. <row>
  280. <entry><constant>V4L2_IN_CAP_NATIVE_SIZE</constant></entry>
  281. <entry>0x00000008</entry>
  282. <entry>This input supports setting the native size using
  283. the <constant>V4L2_SEL_TGT_NATIVE_SIZE</constant>
  284. selection target, see <xref
  285. linkend="v4l2-selections-common"/>.</entry>
  286. </row>
  287. </tbody>
  288. </tgroup>
  289. </table>
  290. </refsect1>
  291. <refsect1>
  292. &return-value;
  293. <variablelist>
  294. <varlistentry>
  295. <term><errorcode>EINVAL</errorcode></term>
  296. <listitem>
  297. <para>The &v4l2-input; <structfield>index</structfield> is
  298. out of bounds.</para>
  299. </listitem>
  300. </varlistentry>
  301. </variablelist>
  302. </refsect1>
  303. </refentry>