vidioc-querycap.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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>Available capabilities of the physical device as a whole, see <xref
  119. linkend="device-capabilities" />. The same physical device can export
  120. multiple devices in /dev (e.g. /dev/videoX, /dev/vbiY and /dev/radioZ).
  121. The <structfield>capabilities</structfield> field should contain a union
  122. of all capabilities available around the several V4L2 devices exported
  123. to userspace.
  124. For all those devices the <structfield>capabilities</structfield> field
  125. returns the same set of capabilities. This allows applications to open
  126. just one of the devices (typically the video device) and discover whether
  127. video, vbi and/or radio are also supported.
  128. </entry>
  129. </row>
  130. <row>
  131. <entry>__u32</entry>
  132. <entry><structfield>device_caps</structfield></entry>
  133. <entry>Device capabilities of the opened device, see <xref
  134. linkend="device-capabilities" />. Should contain the available capabilities
  135. of that specific device node. So, for example, <structfield>device_caps</structfield>
  136. of a radio device will only contain radio related capabilities and
  137. no video or vbi capabilities. This field is only set if the <structfield>capabilities</structfield>
  138. field contains the <constant>V4L2_CAP_DEVICE_CAPS</constant> capability.
  139. Only the <structfield>capabilities</structfield> field can have the
  140. <constant>V4L2_CAP_DEVICE_CAPS</constant> capability, <structfield>device_caps</structfield>
  141. will never set <constant>V4L2_CAP_DEVICE_CAPS</constant>.
  142. </entry>
  143. </row>
  144. <row>
  145. <entry>__u32</entry>
  146. <entry><structfield>reserved</structfield>[3]</entry>
  147. <entry>Reserved for future extensions. Drivers must set
  148. this array to zero.</entry>
  149. </row>
  150. </tbody>
  151. </tgroup>
  152. </table>
  153. <table pgwide="1" frame="none" id="device-capabilities">
  154. <title>Device Capabilities Flags</title>
  155. <tgroup cols="3">
  156. &cs-def;
  157. <tbody valign="top">
  158. <row>
  159. <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
  160. <entry>0x00000001</entry>
  161. <entry>The device supports the single-planar API through the <link
  162. linkend="capture">Video Capture</link> interface.</entry>
  163. </row>
  164. <row>
  165. <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
  166. <entry>0x00001000</entry>
  167. <entry>The device supports the
  168. <link linkend="planar-apis">multi-planar API</link> through the
  169. <link linkend="capture">Video Capture</link> interface.</entry>
  170. </row>
  171. <row>
  172. <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
  173. <entry>0x00000002</entry>
  174. <entry>The device supports the single-planar API through the <link
  175. linkend="output">Video Output</link> interface.</entry>
  176. </row>
  177. <row>
  178. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
  179. <entry>0x00002000</entry>
  180. <entry>The device supports the
  181. <link linkend="planar-apis">multi-planar API</link> through the
  182. <link linkend="output">Video Output</link> interface.</entry>
  183. </row>
  184. <row>
  185. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  186. <entry>0x00000004</entry>
  187. <entry>The device supports the <link
  188. linkend="overlay">Video Overlay</link> interface. A video overlay device
  189. typically stores captured images directly in the video memory of a
  190. graphics card, with hardware clipping and scaling.</entry>
  191. </row>
  192. <row>
  193. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  194. <entry>0x00000010</entry>
  195. <entry>The device supports the <link linkend="raw-vbi">Raw
  196. VBI Capture</link> interface, providing Teletext and Closed Caption
  197. data.</entry>
  198. </row>
  199. <row>
  200. <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
  201. <entry>0x00000020</entry>
  202. <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
  203. </row>
  204. <row>
  205. <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
  206. <entry>0x00000040</entry>
  207. <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
  208. </row>
  209. <row>
  210. <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
  211. <entry>0x00000080</entry>
  212. <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
  213. </row>
  214. <row>
  215. <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
  216. <entry>0x00000100</entry>
  217. <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
  218. </row>
  219. <row>
  220. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
  221. <entry>0x00000200</entry>
  222. <entry>The device supports the <link linkend="osd">Video
  223. Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
  224. Overlay</wordasword> interface, this is a secondary function of video
  225. output devices and overlays an image onto an outgoing video signal.
  226. When the driver sets this flag, it must clear the
  227. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
  228. versa.<footnote><para>The &v4l2-framebuffer; lacks an
  229. &v4l2-buf-type; field, therefore the type of overlay is implied by the
  230. driver capabilities.</para></footnote></entry>
  231. </row>
  232. <row>
  233. <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
  234. <entry>0x00000400</entry>
  235. <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
  236. hardware frequency seeking.</entry>
  237. </row>
  238. <row>
  239. <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
  240. <entry>0x00000800</entry>
  241. <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
  242. </row>
  243. <row>
  244. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  245. <entry>0x00010000</entry>
  246. <entry>The device has some sort of tuner to
  247. receive RF-modulated video signals. For more information about
  248. tuner programming see
  249. <xref linkend="tuner" />.</entry>
  250. </row>
  251. <row>
  252. <entry><constant>V4L2_CAP_AUDIO</constant></entry>
  253. <entry>0x00020000</entry>
  254. <entry>The device has audio inputs or outputs. It may or
  255. may not support audio recording or playback, in PCM or compressed
  256. formats. PCM audio support must be implemented as ALSA or OSS
  257. interface. For more information on audio inputs and outputs see <xref
  258. linkend="audio" />.</entry>
  259. </row>
  260. <row>
  261. <entry><constant>V4L2_CAP_RADIO</constant></entry>
  262. <entry>0x00040000</entry>
  263. <entry>This is a radio receiver.</entry>
  264. </row>
  265. <row>
  266. <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
  267. <entry>0x00080000</entry>
  268. <entry>The device has some sort of modulator to
  269. emit RF-modulated video/audio signals. For more information about
  270. modulator programming see
  271. <xref linkend="tuner" />.</entry>
  272. </row>
  273. <row>
  274. <entry><constant>V4L2_CAP_READWRITE</constant></entry>
  275. <entry>0x01000000</entry>
  276. <entry>The device supports the <link
  277. linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
  278. I/O methods.</entry>
  279. </row>
  280. <row>
  281. <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
  282. <entry>0x02000000</entry>
  283. <entry>The device supports the <link
  284. linkend="async">asynchronous</link> I/O methods.</entry>
  285. </row>
  286. <row>
  287. <entry><constant>V4L2_CAP_STREAMING</constant></entry>
  288. <entry>0x04000000</entry>
  289. <entry>The device supports the <link
  290. linkend="mmap">streaming</link> I/O method.</entry>
  291. </row>
  292. <row>
  293. <entry><constant>V4L2_CAP_DEVICE_CAPS</constant></entry>
  294. <entry>0x80000000</entry>
  295. <entry>The driver fills the <structfield>device_caps</structfield>
  296. field. This capability can only appear in the <structfield>capabilities</structfield>
  297. field and never in the <structfield>device_caps</structfield> field.</entry>
  298. </row>
  299. </tbody>
  300. </tgroup>
  301. </table>
  302. </refsect1>
  303. <refsect1>
  304. &return-value;
  305. </refsect1>
  306. </refentry>