vidioc-querycap.xml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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 <link
  136. linkend="capture">Video Capture</link> interface.</entry>
  137. </row>
  138. <row>
  139. <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
  140. <entry>0x00000002</entry>
  141. <entry>The device supports the <link
  142. linkend="output">Video Output</link> interface.</entry>
  143. </row>
  144. <row>
  145. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  146. <entry>0x00000004</entry>
  147. <entry>The device supports the <link
  148. linkend="overlay">Video Overlay</link> interface. A video overlay device
  149. typically stores captured images directly in the video memory of a
  150. graphics card, with hardware clipping and scaling.</entry>
  151. </row>
  152. <row>
  153. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  154. <entry>0x00000010</entry>
  155. <entry>The device supports the <link linkend="raw-vbi">Raw
  156. VBI Capture</link> interface, providing Teletext and Closed Caption
  157. data.</entry>
  158. </row>
  159. <row>
  160. <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
  161. <entry>0x00000020</entry>
  162. <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
  163. </row>
  164. <row>
  165. <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
  166. <entry>0x00000040</entry>
  167. <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
  168. </row>
  169. <row>
  170. <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
  171. <entry>0x00000080</entry>
  172. <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
  173. </row>
  174. <row>
  175. <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
  176. <entry>0x00000100</entry>
  177. <entry>The device supports the <link linkend="rds">RDS</link> interface.</entry>
  178. </row>
  179. <row>
  180. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
  181. <entry>0x00000200</entry>
  182. <entry>The device supports the <link linkend="osd">Video
  183. Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
  184. Overlay</wordasword> interface, this is a secondary function of video
  185. output devices and overlays an image onto an outgoing video signal.
  186. When the driver sets this flag, it must clear the
  187. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
  188. versa.<footnote><para>The &v4l2-framebuffer; lacks an
  189. &v4l2-buf-type; field, therefore the type of overlay is implied by the
  190. driver capabilities.</para></footnote></entry>
  191. </row>
  192. <row>
  193. <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
  194. <entry>0x00000400</entry>
  195. <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
  196. hardware frequency seeking.</entry>
  197. </row>
  198. <row>
  199. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  200. <entry>0x00010000</entry>
  201. <entry>The device has some sort of tuner to
  202. receive RF-modulated video signals. For more information about
  203. tuner programming see
  204. <xref linkend="tuner" />.</entry>
  205. </row>
  206. <row>
  207. <entry><constant>V4L2_CAP_AUDIO</constant></entry>
  208. <entry>0x00020000</entry>
  209. <entry>The device has audio inputs or outputs. It may or
  210. may not support audio recording or playback, in PCM or compressed
  211. formats. PCM audio support must be implemented as ALSA or OSS
  212. interface. For more information on audio inputs and outputs see <xref
  213. linkend="audio" />.</entry>
  214. </row>
  215. <row>
  216. <entry><constant>V4L2_CAP_RADIO</constant></entry>
  217. <entry>0x00040000</entry>
  218. <entry>This is a radio receiver.</entry>
  219. </row>
  220. <row>
  221. <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
  222. <entry>0x00080000</entry>
  223. <entry>The device has some sort of modulator to
  224. emit RF-modulated video/audio signals. For more information about
  225. modulator programming see
  226. <xref linkend="tuner" />.</entry>
  227. </row>
  228. <row>
  229. <entry><constant>V4L2_CAP_READWRITE</constant></entry>
  230. <entry>0x01000000</entry>
  231. <entry>The device supports the <link
  232. linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
  233. I/O methods.</entry>
  234. </row>
  235. <row>
  236. <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
  237. <entry>0x02000000</entry>
  238. <entry>The device supports the <link
  239. linkend="async">asynchronous</link> I/O methods.</entry>
  240. </row>
  241. <row>
  242. <entry><constant>V4L2_CAP_STREAMING</constant></entry>
  243. <entry>0x04000000</entry>
  244. <entry>The device supports the <link
  245. linkend="mmap">streaming</link> I/O method.</entry>
  246. </row>
  247. </tbody>
  248. </tgroup>
  249. </table>
  250. </refsect1>
  251. <refsect1>
  252. &return-value;
  253. <variablelist>
  254. <varlistentry>
  255. <term><errorcode>EINVAL</errorcode></term>
  256. <listitem>
  257. <para>The device is not compatible with this
  258. specification.</para>
  259. </listitem>
  260. </varlistentry>
  261. </variablelist>
  262. </refsect1>
  263. </refentry>
  264. <!--
  265. Local Variables:
  266. mode: sgml
  267. sgml-parent-document: "v4l2.sgml"
  268. indent-tabs-mode: nil
  269. End:
  270. -->