vidioc-subdev-g-selection.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <refentry id="vidioc-subdev-g-selection">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_SUBDEV_G_SELECTION</refname>
  8. <refname>VIDIOC_SUBDEV_S_SELECTION</refname>
  9. <refpurpose>Get or set selection rectangles on a subdev pad</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>struct v4l2_subdev_selection *<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_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION</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. <note>
  47. <title>Experimental</title>
  48. <para>This is an <link linkend="experimental">experimental</link>
  49. interface and may change in the future.</para>
  50. </note>
  51. <para>The selections are used to configure various image
  52. processing functionality performed by the subdevs which affect the
  53. image size. This currently includes cropping, scaling and
  54. composition.</para>
  55. <para>The selection API replaces <link
  56. linkend="vidioc-subdev-g-crop">the old subdev crop API</link>. All
  57. the function of the crop API, and more, are supported by the
  58. selections API.</para>
  59. <para>See <xref linkend="subdev"></xref> for
  60. more information on how each selection target affects the image
  61. processing pipeline inside the subdevice.</para>
  62. <refsect2>
  63. <title>Types of selection targets</title>
  64. <para>There are two types of selection targets: actual and bounds. The
  65. actual targets are the targets which configure the hardware. The BOUNDS
  66. target will return a rectangle that contain all possible actual
  67. rectangles.</para>
  68. </refsect2>
  69. <refsect2>
  70. <title>Discovering supported features</title>
  71. <para>To discover which targets are supported, the user can
  72. perform <constant>VIDIOC_SUBDEV_G_SELECTION</constant> on them.
  73. Any unsupported target will return
  74. <constant>EINVAL</constant>.</para>
  75. <para>Selection targets and flags are documented in <xref
  76. linkend="v4l2-selections-common"/>.</para>
  77. <table pgwide="1" frame="none" id="v4l2-subdev-selection">
  78. <title>struct <structname>v4l2_subdev_selection</structname></title>
  79. <tgroup cols="3">
  80. &cs-str;
  81. <tbody valign="top">
  82. <row>
  83. <entry>__u32</entry>
  84. <entry><structfield>which</structfield></entry>
  85. <entry>Active or try selection, from
  86. &v4l2-subdev-format-whence;.</entry>
  87. </row>
  88. <row>
  89. <entry>__u32</entry>
  90. <entry><structfield>pad</structfield></entry>
  91. <entry>Pad number as reported by the media framework.</entry>
  92. </row>
  93. <row>
  94. <entry>__u32</entry>
  95. <entry><structfield>target</structfield></entry>
  96. <entry>Target selection rectangle. See
  97. <xref linkend="v4l2-selections-common" />.</entry>
  98. </row>
  99. <row>
  100. <entry>__u32</entry>
  101. <entry><structfield>flags</structfield></entry>
  102. <entry>Flags. See
  103. <xref linkend="v4l2-selection-flags" />.</entry>
  104. </row>
  105. <row>
  106. <entry>&v4l2-rect;</entry>
  107. <entry><structfield>r</structfield></entry>
  108. <entry>Selection rectangle, in pixels.</entry>
  109. </row>
  110. <row>
  111. <entry>__u32</entry>
  112. <entry><structfield>reserved</structfield>[8]</entry>
  113. <entry>Reserved for future extensions. Applications and drivers must
  114. set the array to zero.</entry>
  115. </row>
  116. </tbody>
  117. </tgroup>
  118. </table>
  119. </refsect2>
  120. </refsect1>
  121. <refsect1>
  122. &return-value;
  123. <variablelist>
  124. <varlistentry>
  125. <term><errorcode>EBUSY</errorcode></term>
  126. <listitem>
  127. <para>The selection rectangle can't be changed because the
  128. pad is currently busy. This can be caused, for instance, by
  129. an active video stream on the pad. The ioctl must not be
  130. retried without performing another action to fix the problem
  131. first. Only returned by
  132. <constant>VIDIOC_SUBDEV_S_SELECTION</constant></para>
  133. </listitem>
  134. </varlistentry>
  135. <varlistentry>
  136. <term><errorcode>EINVAL</errorcode></term>
  137. <listitem>
  138. <para>The &v4l2-subdev-selection;
  139. <structfield>pad</structfield> references a non-existing
  140. pad, the <structfield>which</structfield> field references a
  141. non-existing format, or the selection target is not
  142. supported on the given subdev pad.</para>
  143. </listitem>
  144. </varlistentry>
  145. </variablelist>
  146. </refsect1>
  147. </refentry>