vidioc-querycap.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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.</para>
  64. <para>Storing strings in fixed sized arrays is bad
  65. practice but unavoidable here. Drivers and applications should take
  66. precautions to never read or write beyond the end of the array and to
  67. make sure the strings are properly NUL-terminated.</para></entry>
  68. </row>
  69. <row>
  70. <entry>__u8</entry>
  71. <entry><structfield>card</structfield>[32]</entry>
  72. <entry>Name of the device, a NUL-terminated ASCII string.
  73. For example: "Yoyodyne TV/FM". One driver may support different brands
  74. or models of video hardware. This information is intended for users,
  75. for example in a menu of available devices. Since multiple TV cards of
  76. the same brand may be installed which are supported by the same
  77. driver, this name should be combined with the character device file
  78. name (&eg; <filename>/dev/video2</filename>) or the
  79. <structfield>bus_info</structfield> string to avoid
  80. ambiguities.</entry>
  81. </row>
  82. <row>
  83. <entry>__u8</entry>
  84. <entry><structfield>bus_info</structfield>[32]</entry>
  85. <entry>Location of the device in the system, a
  86. NUL-terminated ASCII string. For example: "PCI Slot 4". This
  87. information is intended for users, to distinguish multiple
  88. identical devices. If no such information is available the field may
  89. simply count the devices controlled by the driver, or contain the
  90. empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry>
  91. </row>
  92. <row>
  93. <entry>__u32</entry>
  94. <entry><structfield>version</structfield></entry>
  95. <entry><para>Version number of the driver.</para>
  96. <para>Starting on kernel 3.1, the version reported is provided per
  97. V4L2 subsystem, following the same Kernel numberation scheme. However, it
  98. should not always return the same version as the kernel, if, for example,
  99. an stable or distribution-modified kernel uses the V4L2 stack from a
  100. newer kernel.</para>
  101. <para>The version number is formatted using the
  102. <constant>KERNEL_VERSION()</constant> macro:</para></entry>
  103. </row>
  104. <row>
  105. <entry spanname="hspan"><para>
  106. <programlisting>
  107. #define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
  108. __u32 version = KERNEL_VERSION(0, 8, 1);
  109. printf ("Version: %u.%u.%u\n",
  110. (version &gt;&gt; 16) &amp; 0xFF,
  111. (version &gt;&gt; 8) &amp; 0xFF,
  112. version &amp; 0xFF);
  113. </programlisting></para></entry>
  114. </row>
  115. <row>
  116. <entry>__u32</entry>
  117. <entry><structfield>capabilities</structfield></entry>
  118. <entry>Device capabilities, see <xref
  119. linkend="device-capabilities" />.</entry>
  120. </row>
  121. <row>
  122. <entry>__u32</entry>
  123. <entry><structfield>reserved</structfield>[4]</entry>
  124. <entry>Reserved for future extensions. Drivers must set
  125. this array to zero.</entry>
  126. </row>
  127. </tbody>
  128. </tgroup>
  129. </table>
  130. <table pgwide="1" frame="none" id="device-capabilities">
  131. <title>Device Capabilities Flags</title>
  132. <tgroup cols="3">
  133. &cs-def;
  134. <tbody valign="top">
  135. <row>
  136. <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
  137. <entry>0x00000001</entry>
  138. <entry>The device supports the single-planar API through the <link
  139. linkend="capture">Video Capture</link> interface.</entry>
  140. </row>
  141. <row>
  142. <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
  143. <entry>0x00001000</entry>
  144. <entry>The device supports the
  145. <link linkend="planar-apis">multi-planar API</link> through the
  146. <link linkend="capture">Video Capture</link> interface.</entry>
  147. </row>
  148. <row>
  149. <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
  150. <entry>0x00000002</entry>
  151. <entry>The device supports the single-planar API through the <link
  152. linkend="output">Video Output</link> interface.</entry>
  153. </row>
  154. <row>
  155. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
  156. <entry>0x00002000</entry>
  157. <entry>The device supports the
  158. <link linkend="planar-apis">multi-planar API</link> through the
  159. <link linkend="output">Video Output</link> interface.</entry>
  160. </row>
  161. <row>
  162. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  163. <entry>0x00000004</entry>
  164. <entry>The device supports the <link
  165. linkend="overlay">Video Overlay</link> interface. A video overlay device
  166. typically stores captured images directly in the video memory of a
  167. graphics card, with hardware clipping and scaling.</entry>
  168. </row>
  169. <row>
  170. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  171. <entry>0x00000010</entry>
  172. <entry>The device supports the <link linkend="raw-vbi">Raw
  173. VBI Capture</link> interface, providing Teletext and Closed Caption
  174. data.</entry>
  175. </row>
  176. <row>
  177. <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
  178. <entry>0x00000020</entry>
  179. <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
  180. </row>
  181. <row>
  182. <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
  183. <entry>0x00000040</entry>
  184. <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
  185. </row>
  186. <row>
  187. <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
  188. <entry>0x00000080</entry>
  189. <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
  190. </row>
  191. <row>
  192. <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
  193. <entry>0x00000100</entry>
  194. <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
  195. </row>
  196. <row>
  197. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
  198. <entry>0x00000200</entry>
  199. <entry>The device supports the <link linkend="osd">Video
  200. Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
  201. Overlay</wordasword> interface, this is a secondary function of video
  202. output devices and overlays an image onto an outgoing video signal.
  203. When the driver sets this flag, it must clear the
  204. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
  205. versa.<footnote><para>The &v4l2-framebuffer; lacks an
  206. &v4l2-buf-type; field, therefore the type of overlay is implied by the
  207. driver capabilities.</para></footnote></entry>
  208. </row>
  209. <row>
  210. <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
  211. <entry>0x00000400</entry>
  212. <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
  213. hardware frequency seeking.</entry>
  214. </row>
  215. <row>
  216. <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
  217. <entry>0x00000800</entry>
  218. <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
  219. </row>
  220. <row>
  221. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  222. <entry>0x00010000</entry>
  223. <entry>The device has some sort of tuner to
  224. receive RF-modulated video signals. For more information about
  225. tuner programming see
  226. <xref linkend="tuner" />.</entry>
  227. </row>
  228. <row>
  229. <entry><constant>V4L2_CAP_AUDIO</constant></entry>
  230. <entry>0x00020000</entry>
  231. <entry>The device has audio inputs or outputs. It may or
  232. may not support audio recording or playback, in PCM or compressed
  233. formats. PCM audio support must be implemented as ALSA or OSS
  234. interface. For more information on audio inputs and outputs see <xref
  235. linkend="audio" />.</entry>
  236. </row>
  237. <row>
  238. <entry><constant>V4L2_CAP_RADIO</constant></entry>
  239. <entry>0x00040000</entry>
  240. <entry>This is a radio receiver.</entry>
  241. </row>
  242. <row>
  243. <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
  244. <entry>0x00080000</entry>
  245. <entry>The device has some sort of modulator to
  246. emit RF-modulated video/audio signals. For more information about
  247. modulator programming see
  248. <xref linkend="tuner" />.</entry>
  249. </row>
  250. <row>
  251. <entry><constant>V4L2_CAP_READWRITE</constant></entry>
  252. <entry>0x01000000</entry>
  253. <entry>The device supports the <link
  254. linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
  255. I/O methods.</entry>
  256. </row>
  257. <row>
  258. <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
  259. <entry>0x02000000</entry>
  260. <entry>The device supports the <link
  261. linkend="async">asynchronous</link> I/O methods.</entry>
  262. </row>
  263. <row>
  264. <entry><constant>V4L2_CAP_STREAMING</constant></entry>
  265. <entry>0x04000000</entry>
  266. <entry>The device supports the <link
  267. linkend="mmap">streaming</link> I/O method.</entry>
  268. </row>
  269. </tbody>
  270. </tgroup>
  271. </table>
  272. </refsect1>
  273. <refsect1>
  274. &return-value;
  275. </refsect1>
  276. </refentry>