1<refentry id="vidioc-cropcap"> 2 <refmeta> 3 <refentrytitle>ioctl VIDIOC_CROPCAP</refentrytitle> 4 &manvol; 5 </refmeta> 6 7 <refnamediv> 8 <refname>VIDIOC_CROPCAP</refname> 9 <refpurpose>Information about the video cropping and scaling abilities</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_cropcap 19*<parameter>argp</parameter></paramdef> 20 </funcprototype> 21 </funcsynopsis> 22 </refsynopsisdiv> 23 24 <refsect1> 25 <title>Arguments</title> 26 27 <variablelist> 28 <varlistentry> 29 <term><parameter>fd</parameter></term> 30 <listitem> 31 <para>&fd;</para> 32 </listitem> 33 </varlistentry> 34 <varlistentry> 35 <term><parameter>request</parameter></term> 36 <listitem> 37 <para>VIDIOC_CROPCAP</para> 38 </listitem> 39 </varlistentry> 40 <varlistentry> 41 <term><parameter>argp</parameter></term> 42 <listitem> 43 <para></para> 44 </listitem> 45 </varlistentry> 46 </variablelist> 47 </refsect1> 48 49 <refsect1> 50 <title>Description</title> 51 52 <para>Applications use this function to query the cropping 53limits, the pixel aspect of images and to calculate scale factors. 54They set the <structfield>type</structfield> field of a v4l2_cropcap 55structure to the respective buffer (stream) type and call the 56<constant>VIDIOC_CROPCAP</constant> ioctl with a pointer to this 57structure. Drivers fill the rest of the structure. The results are 58constant except when switching the video standard. Remember this 59switch can occur implicit when switching the video input or 60output.</para> 61 62 <table pgwide="1" frame="none" id="v4l2-cropcap"> 63 <title>struct <structname>v4l2_cropcap</structname></title> 64 <tgroup cols="3"> 65 &cs-str; 66 <tbody valign="top"> 67 <row> 68 <entry>&v4l2-buf-type;</entry> 69 <entry><structfield>type</structfield></entry> 70 <entry>Type of the data stream, set by the application. 71Only these types are valid here: 72<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>, 73<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant>, 74<constant>V4L2_BUF_TYPE_VIDEO_OVERLAY</constant>, and custom (driver 75defined) types with code <constant>V4L2_BUF_TYPE_PRIVATE</constant> 76and higher.</entry> 77 </row> 78 <row> 79 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> 80 <entry><structfield>bounds</structfield></entry> 81 <entry>Defines the window within capturing or output is 82possible, this may exclude for example the horizontal and vertical 83blanking areas. The cropping rectangle cannot exceed these limits. 84Width and height are defined in pixels, the driver writer is free to 85choose origin and units of the coordinate system in the analog 86domain.</entry> 87 </row> 88 <row> 89 <entry>struct <link linkend="v4l2-rect-crop">v4l2_rect</link></entry> 90 <entry><structfield>defrect</structfield></entry> 91 <entry>Default cropping rectangle, it shall cover the 92"whole picture". Assuming pixel aspect 1/1 this could be for example a 93640 × 480 rectangle for NTSC, a 94768 × 576 rectangle for PAL and SECAM centered over 95the active picture area. The same co-ordinate system as for 96 <structfield>bounds</structfield> is used.</entry> 97 </row> 98 <row> 99 <entry>&v4l2-fract;</entry> 100 <entry><structfield>pixelaspect</structfield></entry> 101 <entry><para>This is the pixel aspect (y / x) when no 102scaling is applied, the ratio of the actual sampling 103frequency and the frequency required to get square 104pixels.</para><para>When cropping coordinates refer to square pixels, 105the driver sets <structfield>pixelaspect</structfield> to 1/1. Other 106common values are 54/59 for PAL and SECAM, 11/10 for NTSC sampled 107according to [<xref linkend="itu601" />].</para></entry> 108 </row> 109 </tbody> 110 </tgroup> 111 </table> 112 113 <!-- NB this table is duplicated in the overlay chapter. --> 114 115 <table pgwide="1" frame="none" id="v4l2-rect-crop"> 116 <title>struct <structname>v4l2_rect</structname></title> 117 <tgroup cols="3"> 118 &cs-str; 119 <tbody valign="top"> 120 <row> 121 <entry>__s32</entry> 122 <entry><structfield>left</structfield></entry> 123 <entry>Horizontal offset of the top, left corner of the 124rectangle, in pixels.</entry> 125 </row> 126 <row> 127 <entry>__s32</entry> 128 <entry><structfield>top</structfield></entry> 129 <entry>Vertical offset of the top, left corner of the 130rectangle, in pixels.</entry> 131 </row> 132 <row> 133 <entry>__s32</entry> 134 <entry><structfield>width</structfield></entry> 135 <entry>Width of the rectangle, in pixels.</entry> 136 </row> 137 <row> 138 <entry>__s32</entry> 139 <entry><structfield>height</structfield></entry> 140 <entry>Height of the rectangle, in pixels. Width 141and height cannot be negative, the fields are signed for 142hysterical reasons. <!-- video4linux-list@redhat.com 143on 22 Oct 2002 subject "Re:[V4L][patches!] Re:v4l2/kernel-2.5" --> 144</entry> 145 </row> 146 </tbody> 147 </tgroup> 148 </table> 149 </refsect1> 150 151 <refsect1> 152 &return-value; 153 154 <variablelist> 155 <varlistentry> 156 <term><errorcode>EINVAL</errorcode></term> 157 <listitem> 158 <para>The &v4l2-cropcap; <structfield>type</structfield> is 159invalid or the ioctl is not supported. This is not permitted for 160video capture, output and overlay devices, which must support 161<constant>VIDIOC_CROPCAP</constant>.</para> 162 </listitem> 163 </varlistentry> 164 </variablelist> 165 </refsect1> 166</refentry> 167 168<!-- 169Local Variables: 170mode: sgml 171sgml-parent-document: "v4l2.sgml" 172indent-tabs-mode: nil 173End: 174--> 175