Sophie

Sophie

distrib > Fedora > 18 > x86_64 > media > updates > by-pkgid > 1a595394b241504ff370a8d12ebfcea7 > files > 3803

kernel-doc-3.11.10-100.fc18.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_CROPCAP</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API" /><link rel="up" href="user-func.html" title="Appendix&#160;A.&#160;Function Reference" /><link rel="prev" href="vidioc-create-bufs.html" title="ioctl VIDIOC_CREATE_BUFS" /><link rel="next" href="vidioc-dbg-g-chip-info.html" title="ioctl VIDIOC_DBG_G_CHIP_INFO" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_CROPCAP</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-create-bufs.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="vidioc-dbg-g-chip-info.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="vidioc-cropcap"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_CROPCAP &#8212; Information about the video cropping and scaling abilities</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <strong class="fsfunc">ioctl</strong>(</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_cropcap
*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a id="idm140470012440128"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.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_CROPCAP</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"><a id="idm140470012432000"></a><h2>Description</h2><p>Applications use this function to query the cropping
limits, the pixel aspect of images and to calculate scale factors.
They set the <em class="structfield"><code>type</code></em> field of a v4l2_cropcap
structure to the respective buffer (stream) type and call the
<code class="constant">VIDIOC_CROPCAP</code> ioctl with a pointer to this
structure. Drivers fill the rest of the structure. The results are
constant except when switching the video standard. Remember this
switch can occur implicit when switching the video input or
output.</p><p>This ioctl must be implemented for video capture or output devices that
support cropping and/or scaling and/or have non-square pixels, and for overlay devices.</p><div class="table"><a id="v4l2-cropcap"></a><p class="title"><strong>Table&#160;A.2.&#160;struct <span class="structname">v4l2_cropcap</span></strong></p><div class="table-contents"><table summary="struct v4l2_cropcap" width="100%" border="0"><colgroup><col class="c1" /><col class="c2" /><col class="c3" /></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top">Type of the data stream, set by the application.
Only these types are valid here:
<code class="constant">V4L2_BUF_TYPE_VIDEO_CAPTURE</code>,
<code class="constant">V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</code>,
<code class="constant">V4L2_BUF_TYPE_VIDEO_OUTPUT</code>,
<code class="constant">V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</code> and
<code class="constant">V4L2_BUF_TYPE_VIDEO_OVERLAY</code>. See <a class="xref" href="buffer.html#v4l2-buf-type" title="Table&#160;3.3.&#160;enum v4l2_buf_type">Table&#160;3.3, &#8220;enum v4l2_buf_type&#8221;</a>.</td></tr><tr><td valign="top">struct <a class="link" href="vidioc-cropcap.html#v4l2-rect-crop" title="Table&#160;A.3.&#160;struct v4l2_rect">v4l2_rect</a></td><td valign="top"><em class="structfield"><code>bounds</code></em></td><td valign="top">Defines the window within capturing or output is
possible, this may exclude for example the horizontal and vertical
blanking areas. The cropping rectangle cannot exceed these limits.
Width and height are defined in pixels, the driver writer is free to
choose origin and units of the coordinate system in the analog
domain.</td></tr><tr><td valign="top">struct <a class="link" href="vidioc-cropcap.html#v4l2-rect-crop" title="Table&#160;A.3.&#160;struct v4l2_rect">v4l2_rect</a></td><td valign="top"><em class="structfield"><code>defrect</code></em></td><td valign="top">Default cropping rectangle, it shall cover the
"whole picture". Assuming pixel aspect 1/1 this could be for example a
640&#160;&#215;&#160;480 rectangle for NTSC, a
768&#160;&#215;&#160;576 rectangle for PAL and SECAM centered over
the active picture area. The same co-ordinate system as for
	    <em class="structfield"><code>bounds</code></em> is used.</td></tr><tr><td valign="top">struct&#160;<a class="link" href="vidioc-enumstd.html#v4l2-fract" title="Table&#160;A.43.&#160;struct v4l2_fract">v4l2_fract</a></td><td valign="top"><em class="structfield"><code>pixelaspect</code></em></td><td valign="top"><p>This is the pixel aspect (y / x) when no
scaling is applied, the ratio of the actual sampling
frequency and the frequency required to get square
pixels.</p><p>When cropping coordinates refer to square pixels,
the driver sets <em class="structfield"><code>pixelaspect</code></em> to 1/1. Other
common values are 54/59 for PAL and SECAM, 11/10 for NTSC sampled
according to [<a class="xref" href="bi01.html#itu601" title="ITU-R Recommendation BT.601-5 &quot;Studio Encoding Parameters of Digital Television for Standard 4:3 and Wide-Screen 16:9 Aspect Ratios&quot;">[<abbr class="abbrev">ITU&#160;BT.601</abbr>]</a>].</p></td></tr></tbody></table></div></div><br class="table-break" /><div class="table"><a id="v4l2-rect-crop"></a><p class="title"><strong>Table&#160;A.3.&#160;struct <span class="structname">v4l2_rect</span></strong></p><div class="table-contents"><table summary="struct v4l2_rect" width="100%" border="0"><colgroup><col class="c1" /><col class="c2" /><col class="c3" /></colgroup><tbody valign="top"><tr><td valign="top">__s32</td><td valign="top"><em class="structfield"><code>left</code></em></td><td valign="top">Horizontal offset of the top, left corner of the
rectangle, in pixels.</td></tr><tr><td valign="top">__s32</td><td valign="top"><em class="structfield"><code>top</code></em></td><td valign="top">Vertical offset of the top, left corner of the
rectangle, in pixels.</td></tr><tr><td valign="top">__s32</td><td valign="top"><em class="structfield"><code>width</code></em></td><td valign="top">Width of the rectangle, in pixels.</td></tr><tr><td valign="top">__s32</td><td valign="top"><em class="structfield"><code>height</code></em></td><td valign="top">Height of the rectangle, in pixels. Width
and height cannot be negative, the fields are signed for
hysterical reasons. 
</td></tr></tbody></table></div></div><br class="table-break" /></div><div class="refsect1"><a id="idm140470012393312"></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. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct&#160;<a class="link" href="vidioc-cropcap.html#v4l2-cropcap" title="Table&#160;A.2.&#160;struct v4l2_cropcap">v4l2_cropcap</a> <em class="structfield"><code>type</code></em> is
invalid.</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="vidioc-create-bufs.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="vidioc-dbg-g-chip-info.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_CREATE_BUFS&#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_DBG_G_CHIP_INFO</td></tr></table></div></body></html>