1
<refentry id="vidioc-querycap">
3
<refentrytitle>ioctl VIDIOC_QUERYCAP</refentrytitle>
8
<refname>VIDIOC_QUERYCAP</refname>
9
<refpurpose>Query device capabilities</refpurpose>
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>
24
<title>Arguments</title>
28
<term><parameter>fd</parameter></term>
34
<term><parameter>request</parameter></term>
36
<para>VIDIOC_QUERYCAP</para>
40
<term><parameter>argp</parameter></term>
49
<title>Description</title>
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
59
<table pgwide="1" frame="none" id="v4l2-capability">
60
<title>struct <structname>v4l2_capability</structname></title>
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.</para>
71
<para>Storing strings in fixed sized arrays is bad
72
practice but unavoidable here. Drivers and applications should take
73
precautions to never read or write beyond the end of the array and to
74
make sure the strings are properly NUL-terminated.</para></entry>
78
<entry><structfield>card</structfield>[32]</entry>
79
<entry>Name of the device, a NUL-terminated ASCII string.
80
For example: "Yoyodyne TV/FM". One driver may support different brands
81
or models of video hardware. This information is intended for users,
82
for example in a menu of available devices. Since multiple TV cards of
83
the same brand may be installed which are supported by the same
84
driver, this name should be combined with the character device file
85
name (⪚ <filename>/dev/video2</filename>) or the
86
<structfield>bus_info</structfield> string to avoid
91
<entry><structfield>bus_info</structfield>[32]</entry>
92
<entry>Location of the device in the system, a
93
NUL-terminated ASCII string. For example: "PCI Slot 4". This
94
information is intended for users, to distinguish multiple
95
identical devices. If no such information is available the field may
96
simply count the devices controlled by the driver, or contain the
97
empty string (<structfield>bus_info</structfield>[0] = 0).<!-- XXX pci_dev->slot_name example --></entry>
101
<entry><structfield>version</structfield></entry>
102
<entry><para>Version number of the driver.</para>
103
<para>Starting on kernel 3.1, the version reported is provided per
104
V4L2 subsystem, following the same Kernel numberation scheme. However, it
105
should not always return the same version as the kernel, if, for example,
106
an stable or distribution-modified kernel uses the V4L2 stack from a
108
<para>The version number is formatted using the
109
<constant>KERNEL_VERSION()</constant> macro:</para></entry>
112
<entry spanname="hspan"><para>
114
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
116
__u32 version = KERNEL_VERSION(0, 8, 1);
118
printf ("Version: %u.%u.%u\n",
119
(version >> 16) & 0xFF,
120
(version >> 8) & 0xFF,
122
</programlisting></para></entry>
126
<entry><structfield>capabilities</structfield></entry>
127
<entry>Device capabilities, see <xref
128
linkend="device-capabilities" />.</entry>
132
<entry><structfield>reserved</structfield>[4]</entry>
133
<entry>Reserved for future extensions. Drivers must set
134
this array to zero.</entry>
140
<table pgwide="1" frame="none" id="device-capabilities">
141
<title>Device Capabilities Flags</title>
146
<entry><constant>V4L2_CAP_VIDEO_CAPTURE</constant></entry>
147
<entry>0x00000001</entry>
148
<entry>The device supports the single-planar API through the <link
149
linkend="capture">Video Capture</link> interface.</entry>
152
<entry><constant>V4L2_CAP_VIDEO_CAPTURE_MPLANE</constant></entry>
153
<entry>0x00001000</entry>
154
<entry>The device supports the
155
<link linkend="planar-apis">multi-planar API</link> through the
156
<link linkend="capture">Video Capture</link> interface.</entry>
159
<entry><constant>V4L2_CAP_VIDEO_OUTPUT</constant></entry>
160
<entry>0x00000002</entry>
161
<entry>The device supports the single-planar API through the <link
162
linkend="output">Video Output</link> interface.</entry>
165
<entry><constant>V4L2_CAP_VIDEO_OUTPUT_MPLANE</constant></entry>
166
<entry>0x00002000</entry>
167
<entry>The device supports the
168
<link linkend="planar-apis">multi-planar API</link> through the
169
<link linkend="output">Video Output</link> interface.</entry>
172
<entry><constant>V4L2_CAP_VIDEO_OVERLAY</constant></entry>
173
<entry>0x00000004</entry>
174
<entry>The device supports the <link
175
linkend="overlay">Video Overlay</link> interface. A video overlay device
176
typically stores captured images directly in the video memory of a
177
graphics card, with hardware clipping and scaling.</entry>
180
<entry><constant>V4L2_CAP_VBI_CAPTURE</constant></entry>
181
<entry>0x00000010</entry>
182
<entry>The device supports the <link linkend="raw-vbi">Raw
183
VBI Capture</link> interface, providing Teletext and Closed Caption
187
<entry><constant>V4L2_CAP_VBI_OUTPUT</constant></entry>
188
<entry>0x00000020</entry>
189
<entry>The device supports the <link linkend="raw-vbi">Raw VBI Output</link> interface.</entry>
192
<entry><constant>V4L2_CAP_SLICED_VBI_CAPTURE</constant></entry>
193
<entry>0x00000040</entry>
194
<entry>The device supports the <link linkend="sliced">Sliced VBI Capture</link> interface.</entry>
197
<entry><constant>V4L2_CAP_SLICED_VBI_OUTPUT</constant></entry>
198
<entry>0x00000080</entry>
199
<entry>The device supports the <link linkend="sliced">Sliced VBI Output</link> interface.</entry>
202
<entry><constant>V4L2_CAP_RDS_CAPTURE</constant></entry>
203
<entry>0x00000100</entry>
204
<entry>The device supports the <link linkend="rds">RDS</link> capture interface.</entry>
207
<entry><constant>V4L2_CAP_VIDEO_OUTPUT_OVERLAY</constant></entry>
208
<entry>0x00000200</entry>
209
<entry>The device supports the <link linkend="osd">Video
210
Output Overlay</link> (OSD) interface. Unlike the <wordasword>Video
211
Overlay</wordasword> interface, this is a secondary function of video
212
output devices and overlays an image onto an outgoing video signal.
213
When the driver sets this flag, it must clear the
214
<constant>V4L2_CAP_VIDEO_OVERLAY</constant> flag and vice
215
versa.<footnote><para>The &v4l2-framebuffer; lacks an
216
&v4l2-buf-type; field, therefore the type of overlay is implied by the
217
driver capabilities.</para></footnote></entry>
220
<entry><constant>V4L2_CAP_HW_FREQ_SEEK</constant></entry>
221
<entry>0x00000400</entry>
222
<entry>The device supports the &VIDIOC-S-HW-FREQ-SEEK; ioctl for
223
hardware frequency seeking.</entry>
226
<entry><constant>V4L2_CAP_RDS_OUTPUT</constant></entry>
227
<entry>0x00000800</entry>
228
<entry>The device supports the <link linkend="rds">RDS</link> output interface.</entry>
231
<entry><constant>V4L2_CAP_TUNER</constant></entry>
232
<entry>0x00010000</entry>
233
<entry>The device has some sort of tuner to
234
receive RF-modulated video signals. For more information about
235
tuner programming see
236
<xref linkend="tuner" />.</entry>
239
<entry><constant>V4L2_CAP_AUDIO</constant></entry>
240
<entry>0x00020000</entry>
241
<entry>The device has audio inputs or outputs. It may or
242
may not support audio recording or playback, in PCM or compressed
243
formats. PCM audio support must be implemented as ALSA or OSS
244
interface. For more information on audio inputs and outputs see <xref
245
linkend="audio" />.</entry>
248
<entry><constant>V4L2_CAP_RADIO</constant></entry>
249
<entry>0x00040000</entry>
250
<entry>This is a radio receiver.</entry>
253
<entry><constant>V4L2_CAP_MODULATOR</constant></entry>
254
<entry>0x00080000</entry>
255
<entry>The device has some sort of modulator to
256
emit RF-modulated video/audio signals. For more information about
257
modulator programming see
258
<xref linkend="tuner" />.</entry>
261
<entry><constant>V4L2_CAP_READWRITE</constant></entry>
262
<entry>0x01000000</entry>
263
<entry>The device supports the <link
264
linkend="rw">read()</link> and/or <link linkend="rw">write()</link>
268
<entry><constant>V4L2_CAP_ASYNCIO</constant></entry>
269
<entry>0x02000000</entry>
270
<entry>The device supports the <link
271
linkend="async">asynchronous</link> I/O methods.</entry>
274
<entry><constant>V4L2_CAP_STREAMING</constant></entry>
275
<entry>0x04000000</entry>
276
<entry>The device supports the <link
277
linkend="mmap">streaming</link> I/O method.</entry>