vidioc-cropcap.xml 5.4 KB

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