vidioc-querycap.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <refentry id="vidioc-querycap">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_QUERYCAP</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_QUERYCAP</refname>
  8. <refpurpose>Query device capabilities</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_capability *<parameter>argp</parameter></paramdef>
  17. </funcprototype>
  18. </funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Arguments</title>
  22. <variablelist>
  23. <varlistentry>
  24. <term><parameter>fd</parameter></term>
  25. <listitem>
  26. <para>&fd;</para>
  27. </listitem>
  28. </varlistentry>
  29. <varlistentry>
  30. <term><parameter>request</parameter></term>
  31. <listitem>
  32. <para>VIDIOC_QUERYCAP</para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><parameter>argp</parameter></term>
  37. <listitem>
  38. <para></para>
  39. </listitem>
  40. </varlistentry>
  41. </variablelist>
  42. </refsect1>
  43. <refsect1>
  44. <title>Description</title>
  45. <para>All V4L2 devices support the
  46. <constant>VIDIOC_QUERYCAP</constant> ioctl. It is used to identify
  47. kernel devices compatible with this specification and to obtain
  48. information about driver and hardware capabilities. The ioctl takes a
  49. pointer to a &v4l2-capability; which is filled by the driver. When the
  50. driver is not compatible with this specification the ioctl returns an
  51. &EINVAL;.</para>
  52. <table pgwide="1" frame="none" id="v4l2-capability">
  53. <title>struct <structname>v4l2_capability</structname></title>
  54. <tgroup cols="3">
  55. &cs-str;
  56. <tbody valign="top">
  57. <row>
  58. <entry>__u8</entry>
  59. <entry><structfield>driver</structfield>[16]</entry>
  60. <entry><para>Name of the driver, a unique NUL-terminated
  61. ASCII string. For example: "bttv". Driver specific applications can
  62. use this information to verify the driver identity. It is also useful
  63. to work around known bugs, or to identify drivers in error reports.
  64. The driver version is stored in the <structfield>version</structfield>
  65. field.</para><para>Storing strings in fixed sized arrays is bad
  66. practice but unavoidable here. Drivers and applications should take
  67. precautions to never read or write beyond the end of the array and to
  68. make sure the strings are properly NUL-terminated.</para></entry>
  69. </row>
  70. <row>
  71. <entry>__u8</entry>
  72. <entry><structfield>card</structfield>[32]</entry>
  73. <entry>Name of the device, a NUL-terminated ASCII string.
  74. For example: "Yoyodyne TV/FM". One driver may support different brands
  75. or models of video hardware. This information is intended for users,
  76. for example in a menu of available devices. Since multiple TV cards of
  77. the same brand may be installed which are supported by the same
  78. driver, this name should be combined with the character device file
  79. name (&eg; <filename>/dev/video2</filename>) or the
  80. <structfield>bus_info</structfield> string to avoid
  81. ambiguities.</entry>
  82. </row>
  83. <row>
  84. <entry>__u8</entry>
  85. <entry><structfield>bus_info</structfield>[32]</entry>
  86. <entry>Location of the device in the system, a
  87. NUL-terminated ASCII string. For example: "PCI Slot 4". This
  88. information is intended for users, to distinguish multiple
  89. identical devices. If no such information is available the field may
  90. simply count the devices controlled by the driver, or contain the
  91. empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry>
  92. </row>
  93. <row>
  94. <entry>__u32</entry>
  95. <entry><structfield>version</structfield></entry>
  96. <entry><para>Version number of the driver. Together with
  97. the <structfield>driver</structfield> field this identifies a
  98. particular driver. The version number is formatted using the
  99. <constant>KERNEL_VERSION()</constant> macro:</para></entry>
  100. </row>
  101. <row>
  102. <entry spanname="hspan"><para>
  103. <programlisting>
  104. #define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
  105. __u32 version = KERNEL_VERSION(0, 8, 1);
  106. printf ("Version: %u.%u.%u\n",
  107. (version &gt;&gt; 16) &amp; 0xFF,
  108. (version &gt;&gt; 8) &amp; 0xFF,
  109. version &amp; 0xFF);
  110. </programlisting></para></entry>
  111. </row>
  112. <row>
  113. <entry>__u32</entry>
  114. <entry><structfield>capabilities</structfield></entry>
  115. <entry>Device capabilities, see <xref
  116. linkend="device-capabilities" />.</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. this array to zero.</entry>
  123. </row>
  124. </tbody>
  125. </tgroup>
  126. </table>
  127. <table pgwide="1" frame="none" id="device-capabilities">
  128. <title>Device Capabilities Flags</title>
  129. <tgroup cols="3">
  130. &cs-def;
  131. <tbody valign="top">
  132. <row>
  133. <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
  134. <entry>0x00000001</entry>
  135. <entry>The device supports the single-planar API through the <link
  136. linkend="capture">Video Capture</link> interface.</entry>
  137. </row>
  138. <row>
  139. <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
  140. <entry>0x00001000</entry>
  141. <entry>The device supports the
  142. <link linkend="planar-apis">multi-planar API</link> through the
  143. <link linkend="capture">Video Capture</link> interface.</entry>
  144. </row>
  145. <row>
  146. <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
  147. <entry>0x00000002</entry>
  148. <entry>The device supports the single-planar API through the <link
  149. linkend="output">Video Output</link> interface.</entry>
  150. </row>
  151. <row>
  152. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
  153. <entry>0x00002000</entry>
  154. <entry>The device supports the
  155. <link linkend="planar-apis">multi-planar API</link> through the
  156. <link linkend="output">Video Output</link> interface.</entry>
  157. </row>
  158. <row>
  159. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  160. <entry>0x00000004</entry>
  161. <entry>The device supports the <link
  162. linkend="overlay">Video Overlay</link> interface. A video overlay device
  163. typically stores captured images directly in the video memory of a
  164. graphics card, with hardware clipping and scaling.</entry>
  165. </row>
  166. <row>
  167. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  168. <entry>0x00000010</entry>
  169. <entry>The device supports the <link linkend="raw-vbi">Raw
  170. VBI Capture</link> interface, providing Teletext and Closed Caption
  171. data.</entry>
  172. </row>
  173. <row>
  174. <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
  175. <entry>0x00000020</entry>
  176. <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
  177. </row>
  178. <row>
  179. <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
  180. <entry>0x00000040</entry>
  181. <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
  182. </row>
  183. <row>
  184. <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
  185. <entry>0x00000080</entry>
  186. <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
  187. </row>
  188. <row>
  189. <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
  190. <entry>0x00000100</entry>
  191. <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
  192. </row>
  193. <row>
  194. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
  195. <entry>0x00000200</entry>
  196. <entry>The device supports the <link linkend="osd">Video
  197. Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
  198. Overlay</wordasword> interface, this is a secondary function of video
  199. output devices and overlays an image onto an outgoing video signal.
  200. When the driver sets this flag, it must clear the
  201. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
  202. versa.<footnote><para>The &v4l2-framebuffer; lacks an
  203. &v4l2-buf-type; field, therefore the type of overlay is implied by the
  204. driver capabilities.</para></footnote></entry>
  205. </row>
  206. <row>
  207. <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
  208. <entry>0x00000400</entry>
  209. <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
  210. hardware frequency seeking.</entry>
  211. </row>
  212. <row>
  213. <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
  214. <entry>0x00000800</entry>
  215. <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
  216. </row>
  217. <row>
  218. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  219. <entry>0x00010000</entry>
  220. <entry>The device has some sort of tuner to
  221. receive RF-modulated video signals. For more information about
  222. tuner programming see
  223. <xref linkend="tuner" />.</entry>
  224. </row>
  225. <row>
  226. <entry><constant>V4L2_CAP_AUDIO</constant></entry>
  227. <entry>0x00020000</entry>
  228. <entry>The device has audio inputs or outputs. It may or
  229. may not support audio recording or playback, in PCM or compressed
  230. formats. PCM audio support must be implemented as ALSA or OSS
  231. interface. For more information on audio inputs and outputs see <xref
  232. linkend="audio" />.</entry>
  233. </row>
  234. <row>
  235. <entry><constant>V4L2_CAP_RADIO</constant></entry>
  236. <entry>0x00040000</entry>
  237. <entry>This is a radio receiver.</entry>
  238. </row>
  239. <row>
  240. <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
  241. <entry>0x00080000</entry>
  242. <entry>The device has some sort of modulator to
  243. emit RF-modulated video/audio signals. For more information about
  244. modulator programming see
  245. <xref linkend="tuner" />.</entry>
  246. </row>
  247. <row>
  248. <entry><constant>V4L2_CAP_READWRITE</constant></entry>
  249. <entry>0x01000000</entry>
  250. <entry>The device supports the <link
  251. linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
  252. I/O methods.</entry>
  253. </row>
  254. <row>
  255. <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
  256. <entry>0x02000000</entry>
  257. <entry>The device supports the <link
  258. linkend="async">asynchronous</link> I/O methods.</entry>
  259. </row>
  260. <row>
  261. <entry><constant>V4L2_CAP_STREAMING</constant></entry>
  262. <entry>0x04000000</entry>
  263. <entry>The device supports the <link
  264. linkend="mmap">streaming</link> I/O method.</entry>
  265. </row>
  266. </tbody>
  267. </tgroup>
  268. </table>
  269. </refsect1>
  270. <refsect1>
  271. &return-value;
  272. <variablelist>
  273. <varlistentry>
  274. <term><errorcode>EINVAL</errorcode></term>
  275. <listitem>
  276. <para>The device is not compatible with this
  277. specification.</para>
  278. </listitem>
  279. </varlistentry>
  280. </variablelist>
  281. </refsect1>
  282. </refentry>
  283. <!--
  284. Local Variables:
  285. mode: sgml
  286. sgml-parent-document: "v4l2.sgml"
  287. indent-tabs-mode: nil
  288. End:
  289. -->