Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > 2c51d8eb79f8810ada971ee8c30ce1e5 > files > 2751

kernel-doc-2.6.32-71.14.1.el6.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>ioctl VIDIOC_QUERYCAP</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API" /><link rel="up" href="apa.html" title="Appendix&#160;A.&#160;Function Reference" /><link rel="prev" href="re55.html" title="ioctl VIDIOC_QUERYBUF" /><link rel="next" href="re57.html" title="ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_QUERYCAP</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re55.html">Prev</a>&#160;</td><th width="60%" align="center">Appendix&#160;A.&#160;Function Reference</th><td width="20%" align="right">&#160;<a accesskey="n" href="re57.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="ioctl VIDIOC_QUERYCAP"><a id="vidioc-querycap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_QUERYCAP &#8212; Query device capabilities</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">request</var>, </td></tr><tr><td>&#160;</td><td>struct v4l2_capability *<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1" title="Arguments"><a id="id2731010"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="re64.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_QUERYCAP</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2731078"></a><h2>Description</h2><p>All V4L2 devices support the
<code class="constant">VIDIOC_QUERYCAP</code> ioctl. It is used to identify
kernel devices compatible with this specification and to obtain
information about driver and hardware capabilities. The ioctl takes a
pointer to a struct&#160;<a class="link" href="re56.html#v4l2-capability" title="Table&#160;A.66.&#160;struct v4l2_capability">v4l2_capability</a> which is filled by the driver. When the
driver is not compatible with this specification the ioctl returns an
<span class="errorcode">EINVAL</span> error code.</p><div class="table"><a id="v4l2-capability"></a><p class="title"><b>Table&#160;A.66.&#160;struct <span class="structname">v4l2_capability</span></b></p><div class="table-contents"><table summary="struct v4l2_capability" width="100%" border="0"><colgroup><col /><col /><col /></colgroup><tbody valign="top"><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>driver</code></em>[16]</td><td valign="top"><p>Name of the driver, a unique NUL-terminated
ASCII string. For example: "bttv". Driver specific applications can
use this information to verify the driver identity. It is also useful
to work around known bugs, or to identify drivers in error reports.
The driver version is stored in the <em class="structfield"><code>version</code></em>
field.</p><p>Storing strings in fixed sized arrays is bad
practice but unavoidable here. Drivers and applications should take
precautions to never read or write beyond the end of the array and to
make sure the strings are properly NUL-terminated.</p></td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>card</code></em>[32]</td><td valign="top">Name of the device, a NUL-terminated ASCII string.
For example: "Yoyodyne TV/FM". One driver may support different brands
or models of video hardware. This information is intended for users,
for example in a menu of available devices. Since multiple TV cards of
the same brand may be installed which are supported by the same
driver, this name should be combined with the character device file
name (e.&#160;g. <code class="filename">/dev/video2</code>) or the
<em class="structfield"><code>bus_info</code></em> string to avoid
ambiguities.</td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>bus_info</code></em>[32]</td><td valign="top">Location of the device in the system, a
NUL-terminated ASCII string. For example: "PCI Slot 4". This
information is intended for users, to distinguish multiple
identical devices. If no such information is available the field may
simply count the devices controlled by the driver, or contain the
empty string (<em class="structfield"><code>bus_info</code></em>[0] = 0).</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>version</code></em></td><td valign="top"><p>Version number of the driver. Together with
the <em class="structfield"><code>driver</code></em> field this identifies a
particular driver. The version number is formatted using the
<code class="constant">KERNEL_VERSION()</code> macro:</p></td></tr><tr><td colspan="3" valign="top"><p>
</p><pre class="programlisting">
#define KERNEL_VERSION(a,b,c) (((a) &lt;&lt; 16) + ((b) &lt;&lt; 8) + (c))

__u32 version = KERNEL_VERSION(0, 8, 1);

printf ("Version: %u.%u.%u\n",
	(version &gt;&gt; 16) &amp; 0xFF,
	(version &gt;&gt; 8) &amp; 0xFF,
	 version &amp; 0xFF);
</pre></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>capabilities</code></em></td><td valign="top">Device capabilities, see <a class="xref" href="re56.html#device-capabilities" title="Table&#160;A.67.&#160;Device Capabilities Flags">Table&#160;A.67, &#8220;Device Capabilities Flags&#8221;</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[4]</td><td valign="top">Reserved for future extensions. Drivers must set
this array to zero.</td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="device-capabilities"></a><p class="title"><b>Table&#160;A.67.&#160;Device Capabilities Flags</b></p><div class="table-contents"><table summary="Device Capabilities Flags" width="100%" border="0"><colgroup><col /><col /><col /></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_CAP_VIDEO_CAPTURE</code></td><td valign="top">0x00000001</td><td valign="top">The device supports the <a class="link" href="ch04.html#capture" title="Video Capture Interface">Video Capture</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_VIDEO_OUTPUT</code></td><td valign="top">0x00000002</td><td valign="top">The device supports the <a class="link" href="ch04s03.html" title="Video Output Interface">Video Output</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_VIDEO_OVERLAY</code></td><td valign="top">0x00000004</td><td valign="top">The device supports the <a class="link" href="ch04s02.html" title="Video Overlay Interface">Video Overlay</a> interface. A video overlay device
typically stores captured images directly in the video memory of a
graphics card, with hardware clipping and scaling.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_VBI_CAPTURE</code></td><td valign="top">0x00000010</td><td valign="top">The device supports the <a class="link" href="ch04s07.html" title="Raw VBI Data Interface">Raw
VBI Capture</a> interface, providing Teletext and Closed Caption
data.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_VBI_OUTPUT</code></td><td valign="top">0x00000020</td><td valign="top">The device supports the <a class="link" href="ch04s07.html" title="Raw VBI Data Interface">Raw VBI Output</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_SLICED_VBI_CAPTURE</code></td><td valign="top">0x00000040</td><td valign="top">The device supports the <a class="link" href="ch04s08.html" title="Sliced VBI Data Interface">Sliced VBI Capture</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_SLICED_VBI_OUTPUT</code></td><td valign="top">0x00000080</td><td valign="top">The device supports the <a class="link" href="ch04s08.html" title="Sliced VBI Data Interface">Sliced VBI Output</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_RDS_CAPTURE</code></td><td valign="top">0x00000100</td><td valign="top">The device supports the <a class="link" href="ch04s11.html" title="RDS Interface">RDS</a> interface.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_VIDEO_OUTPUT_OVERLAY</code></td><td valign="top">0x00000200</td><td valign="top">The device supports the <a class="link" href="ch04s04.html" title="Video Output Overlay Interface">Video
Output Overlay</a> (OSD) interface. Unlike the <em class="wordasword">Video
Overlay</em> interface, this is a secondary function of video
output devices and overlays an image onto an outgoing video signal.
When the driver sets this flag, it must clear the
<code class="constant">V4L2_CAP_VIDEO_OVERLAY</code> flag and vice
versa.<sup>[<a id="id2731598" href="#ftn.id2731598" class="footnote">a</a>]</sup></td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_HW_FREQ_SEEK</code></td><td valign="top">0x00000400</td><td valign="top">The device supports the <a class="link" href="re60.html" title="ioctl VIDIOC_S_HW_FREQ_SEEK"><code class="constant">VIDIOC_S_HW_FREQ_SEEK</code></a> ioctl for
hardware frequency seeking.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_TUNER</code></td><td valign="top">0x00010000</td><td valign="top">The device has some sort of tuner to
receive RF-modulated video signals. For more information about
tuner programming see
<a class="xref" href="ch01s06.html" title="Tuners and Modulators">the section called &#8220;Tuners and Modulators&#8221;</a>.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_AUDIO</code></td><td valign="top">0x00020000</td><td valign="top">The device has audio inputs or outputs. It may or
may not support audio recording or playback, in PCM or compressed
formats. PCM audio support must be implemented as ALSA or OSS
interface. For more information on audio inputs and outputs see <a class="xref" href="ch01s05.html" title="Audio Inputs and Outputs">the section called &#8220;Audio Inputs and Outputs&#8221;</a>.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_RADIO</code></td><td valign="top">0x00040000</td><td valign="top">This is a radio receiver.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_MODULATOR</code></td><td valign="top">0x00080000</td><td valign="top">The device has some sort of modulator to
emit RF-modulated video/audio signals. For more information about
modulator programming see
<a class="xref" href="ch01s06.html" title="Tuners and Modulators">the section called &#8220;Tuners and Modulators&#8221;</a>.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_READWRITE</code></td><td valign="top">0x01000000</td><td valign="top">The device supports the <a class="link" href="ch03.html#rw" title="Read/Write">read()</a> and/or <a class="link" href="ch03.html#rw" title="Read/Write">write()</a>
I/O methods.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_ASYNCIO</code></td><td valign="top">0x02000000</td><td valign="top">The device supports the <a class="link" href="ch03s04.html" title="Asynchronous I/O">asynchronous</a> I/O methods.</td></tr><tr><td valign="top"><code class="constant">V4L2_CAP_STREAMING</code></td><td valign="top">0x04000000</td><td valign="top">The device supports the <a class="link" href="ch03s02.html" title="Streaming I/O (Memory Mapping)">streaming</a> I/O method.</td></tr></tbody><tbody class="footnotes"><tr><td colspan="3"><div class="footnote"><p><sup>[<a id="ftn.id2731598" href="#id2731598" class="para">a</a>] </sup>The struct&#160;<a class="link" href="re40.html#v4l2-framebuffer" title="Table&#160;A.43.&#160;struct v4l2_framebuffer">v4l2_framebuffer</a> lacks an
enum&#160;<a class="link" href="ch03s05.html#v4l2-buf-type" title="Table&#160;3.2.&#160;enum v4l2_buf_type">v4l2_buf_type</a> field, therefore the type of overlay is implied by the
driver capabilities.</p></div></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="refsect1" title="Return Value"><a id="id2731804"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately:</p><div class="variablelist"><dl><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The device is not compatible with this
specification.</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re55.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="apa.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re57.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_QUERYBUF&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</td></tr></table></div></body></html>