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