vidioc-querycap.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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 UTF-8 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:0000:05:06.0". This
  87. information is intended for users, to distinguish multiple
  88. identical devices. If no such information is available the field must
  89. simply count the devices controlled by the driver ("platform:vivi-000").
  90. The bus_info must start with "PCI:" for PCI boards, "PCIe:" for PCI Express boards,
  91. "usb-" for USB devices, "I2C:" for i2c devices, "ISA:" for ISA devices,
  92. "parport" for parallel port devices and "platform:" for platform devices.</entry>
  93. </row>
  94. <row>
  95. <entry>__u32</entry>
  96. <entry><structfield>version</structfield></entry>
  97. <entry><para>Version number of the driver.</para>
  98. <para>Starting with kernel 3.1, the version reported is provided by the
  99. V4L2 subsystem following the kernel numbering scheme. However, it
  100. may not always return the same version as the kernel if, for example,
  101. a stable or distribution-modified kernel uses the V4L2 stack from a
  102. newer kernel.</para>
  103. <para>The version number is formatted using the
  104. <constant>KERNEL_VERSION()</constant> macro:</para></entry>
  105. </row>
  106. <row>
  107. <entry spanname="hspan"><para>
  108. <programlisting>
  109. #define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))
  110. __u32 version = KERNEL_VERSION(0, 8, 1);
  111. printf ("Version: %u.%u.%u\n",
  112. (version &gt;&gt; 16) &amp; 0xFF,
  113. (version &gt;&gt; 8) &amp; 0xFF,
  114. version &amp; 0xFF);
  115. </programlisting></para></entry>
  116. </row>
  117. <row>
  118. <entry>__u32</entry>
  119. <entry><structfield>capabilities</structfield></entry>
  120. <entry>Available capabilities of the physical device as a whole, see <xref
  121. linkend="device-capabilities" />. The same physical device can export
  122. multiple devices in /dev (e.g. /dev/videoX, /dev/vbiY and /dev/radioZ).
  123. The <structfield>capabilities</structfield> field should contain a union
  124. of all capabilities available around the several V4L2 devices exported
  125. to userspace.
  126. For all those devices the <structfield>capabilities</structfield> field
  127. returns the same set of capabilities. This allows applications to open
  128. just one of the devices (typically the video device) and discover whether
  129. video, vbi and/or radio are also supported.
  130. </entry>
  131. </row>
  132. <row>
  133. <entry>__u32</entry>
  134. <entry><structfield>device_caps</structfield></entry>
  135. <entry>Device capabilities of the opened device, see <xref
  136. linkend="device-capabilities" />. Should contain the available capabilities
  137. of that specific device node. So, for example, <structfield>device_caps</structfield>
  138. of a radio device will only contain radio related capabilities and
  139. no video or vbi capabilities. This field is only set if the <structfield>capabilities</structfield>
  140. field contains the <constant>V4L2_CAP_DEVICE_CAPS</constant> capability.
  141. Only the <structfield>capabilities</structfield> field can have the
  142. <constant>V4L2_CAP_DEVICE_CAPS</constant> capability, <structfield>device_caps</structfield>
  143. will never set <constant>V4L2_CAP_DEVICE_CAPS</constant>.
  144. </entry>
  145. </row>
  146. <row>
  147. <entry>__u32</entry>
  148. <entry><structfield>reserved</structfield>[3]</entry>
  149. <entry>Reserved for future extensions. Drivers must set
  150. this array to zero.</entry>
  151. </row>
  152. </tbody>
  153. </tgroup>
  154. </table>
  155. <table pgwide="1" frame="none" id="device-capabilities">
  156. <title>Device Capabilities Flags</title>
  157. <tgroup cols="3">
  158. &cs-def;
  159. <tbody valign="top">
  160. <row>
  161. <entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
  162. <entry>0x00000001</entry>
  163. <entry>The device supports the single-planar API through the <link
  164. linkend="capture">Video Capture</link> interface.</entry>
  165. </row>
  166. <row>
  167. <entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
  168. <entry>0x00001000</entry>
  169. <entry>The device supports the
  170. <link linkend="planar-apis">multi-planar API</link> through the
  171. <link linkend="capture">Video Capture</link> interface.</entry>
  172. </row>
  173. <row>
  174. <entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
  175. <entry>0x00000002</entry>
  176. <entry>The device supports the single-planar API through the <link
  177. linkend="output">Video Output</link> interface.</entry>
  178. </row>
  179. <row>
  180. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
  181. <entry>0x00002000</entry>
  182. <entry>The device supports the
  183. <link linkend="planar-apis">multi-planar API</link> through the
  184. <link linkend="output">Video Output</link> interface.</entry>
  185. </row>
  186. <row>
  187. <entry><constant>V4L2_CAP_VIDEO_M2M</constant></entry>
  188. <entry>0x00004000</entry>
  189. <entry>The device supports the single-planar API through the
  190. Video Memory-To-Memory interface.</entry>
  191. </row>
  192. <row>
  193. <entry><constant>V4L2_CAP_VIDEO_M2M_MPLANE</constant></entry>
  194. <entry>0x00008000</entry>
  195. <entry>The device supports the
  196. <link linkend="planar-apis">multi-planar API</link> through the
  197. Video Memory-To-Memory interface.</entry>
  198. </row>
  199. <row>
  200. <entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
  201. <entry>0x00000004</entry>
  202. <entry>The device supports the <link
  203. linkend="overlay">Video Overlay</link> interface. A video overlay device
  204. typically stores captured images directly in the video memory of a
  205. graphics card, with hardware clipping and scaling.</entry>
  206. </row>
  207. <row>
  208. <entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
  209. <entry>0x00000010</entry>
  210. <entry>The device supports the <link linkend="raw-vbi">Raw
  211. VBI Capture</link> interface, providing Teletext and Closed Caption
  212. data.</entry>
  213. </row>
  214. <row>
  215. <entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
  216. <entry>0x00000020</entry>
  217. <entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
  218. </row>
  219. <row>
  220. <entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
  221. <entry>0x00000040</entry>
  222. <entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
  223. </row>
  224. <row>
  225. <entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
  226. <entry>0x00000080</entry>
  227. <entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
  228. </row>
  229. <row>
  230. <entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
  231. <entry>0x00000100</entry>
  232. <entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
  233. </row>
  234. <row>
  235. <entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
  236. <entry>0x00000200</entry>
  237. <entry>The device supports the <link linkend="osd">Video
  238. Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
  239. Overlay</wordasword> interface, this is a secondary function of video
  240. output devices and overlays an image onto an outgoing video signal.
  241. When the driver sets this flag, it must clear the
  242. <constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
  243. versa.<footnote><para>The &v4l2-framebuffer; lacks an
  244. &v4l2-buf-type; field, therefore the type of overlay is implied by the
  245. driver capabilities.</para></footnote></entry>
  246. </row>
  247. <row>
  248. <entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
  249. <entry>0x00000400</entry>
  250. <entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
  251. hardware frequency seeking.</entry>
  252. </row>
  253. <row>
  254. <entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
  255. <entry>0x00000800</entry>
  256. <entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
  257. </row>
  258. <row>
  259. <entry><constant>V4L2_CAP_TUNER</constant></entry>
  260. <entry>0x00010000</entry>
  261. <entry>The device has some sort of tuner to
  262. receive RF-modulated video signals. For more information about
  263. tuner programming see
  264. <xref linkend="tuner" />.</entry>
  265. </row>
  266. <row>
  267. <entry><constant>V4L2_CAP_AUDIO</constant></entry>
  268. <entry>0x00020000</entry>
  269. <entry>The device has audio inputs or outputs. It may or
  270. may not support audio recording or playback, in PCM or compressed
  271. formats. PCM audio support must be implemented as ALSA or OSS
  272. interface. For more information on audio inputs and outputs see <xref
  273. linkend="audio" />.</entry>
  274. </row>
  275. <row>
  276. <entry><constant>V4L2_CAP_RADIO</constant></entry>
  277. <entry>0x00040000</entry>
  278. <entry>This is a radio receiver.</entry>
  279. </row>
  280. <row>
  281. <entry><constant>V4L2_CAP_MODULATOR</constant></entry>
  282. <entry>0x00080000</entry>
  283. <entry>The device has some sort of modulator to
  284. emit RF-modulated video/audio signals. For more information about
  285. modulator programming see
  286. <xref linkend="tuner" />.</entry>
  287. </row>
  288. <row>
  289. <entry><constant>V4L2_CAP_SDR_CAPTURE</constant></entry>
  290. <entry>0x00100000</entry>
  291. <entry>The device supports the
  292. <link linkend="sdr">SDR Capture</link> interface.</entry>
  293. </row>
  294. <row>
  295. <entry><constant>V4L2_CAP_EXT_PIX_FORMAT</constant></entry>
  296. <entry>0x00200000</entry>
  297. <entry>The device supports the &v4l2-pix-format; extended
  298. fields.</entry>
  299. </row>
  300. <row>
  301. <entry><constant>V4L2_CAP_SDR_OUTPUT</constant></entry>
  302. <entry>0x00400000</entry>
  303. <entry>The device supports the
  304. <link linkend="sdr">SDR Output</link> interface.</entry>
  305. </row>
  306. <row>
  307. <entry><constant>V4L2_CAP_READWRITE</constant></entry>
  308. <entry>0x01000000</entry>
  309. <entry>The device supports the <link
  310. linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
  311. I/O methods.</entry>
  312. </row>
  313. <row>
  314. <entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
  315. <entry>0x02000000</entry>
  316. <entry>The device supports the <link
  317. linkend="async">asynchronous</link> I/O methods.</entry>
  318. </row>
  319. <row>
  320. <entry><constant>V4L2_CAP_STREAMING</constant></entry>
  321. <entry>0x04000000</entry>
  322. <entry>The device supports the <link
  323. linkend="mmap">streaming</link> I/O method.</entry>
  324. </row>
  325. <row>
  326. <entry><constant>V4L2_CAP_DEVICE_CAPS</constant></entry>
  327. <entry>0x80000000</entry>
  328. <entry>The driver fills the <structfield>device_caps</structfield>
  329. field. This capability can only appear in the <structfield>capabilities</structfield>
  330. field and never in the <structfield>device_caps</structfield> field.</entry>
  331. </row>
  332. </tbody>
  333. </tgroup>
  334. </table>
  335. </refsect1>
  336. <refsect1>
  337. &return-value;
  338. </refsect1>
  339. </refentry>