selections-common.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <section id="v4l2-selections-common">
  2. <title>Common selection definitions</title>
  3. <para>While the <link linkend="selection-api">V4L2 selection
  4. API</link> and <link linkend="v4l2-subdev-selections">V4L2 subdev
  5. selection APIs</link> are very similar, there's one fundamental
  6. difference between the two. On sub-device API, the selection
  7. rectangle refers to the media bus format, and is bound to a
  8. sub-device's pad. On the V4L2 interface the selection rectangles
  9. refer to the in-memory pixel format.</para>
  10. <para>This section defines the common definitions of the
  11. selection interfaces on the two APIs.</para>
  12. <section id="v4l2-selection-targets">
  13. <title>Selection targets</title>
  14. <para>The precise meaning of the selection targets may be
  15. dependent on which of the two interfaces they are used.</para>
  16. <table pgwide="1" frame="none" id="v4l2-selection-targets-table">
  17. <title>Selection target definitions</title>
  18. <tgroup cols="5">
  19. <colspec colname="c1" />
  20. <colspec colname="c2" />
  21. <colspec colname="c3" />
  22. <colspec colname="c4" />
  23. <colspec colname="c5" />
  24. &cs-def;
  25. <thead>
  26. <row rowsep="1">
  27. <entry align="left">Target name</entry>
  28. <entry align="left">id</entry>
  29. <entry align="left">Definition</entry>
  30. <entry align="left">Valid for V4L2</entry>
  31. <entry align="left">Valid for V4L2 subdev</entry>
  32. </row>
  33. </thead>
  34. <tbody valign="top">
  35. <row>
  36. <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
  37. <entry>0x0000</entry>
  38. <entry>Crop rectangle. Defines the cropped area.</entry>
  39. <entry>Yes</entry>
  40. <entry>Yes</entry>
  41. </row>
  42. <row>
  43. <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
  44. <entry>0x0001</entry>
  45. <entry>Suggested cropping rectangle that covers the "whole picture".</entry>
  46. <entry>Yes</entry>
  47. <entry>No</entry>
  48. </row>
  49. <row>
  50. <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
  51. <entry>0x0002</entry>
  52. <entry>Bounds of the crop rectangle. All valid crop
  53. rectangles fit inside the crop bounds rectangle.
  54. </entry>
  55. <entry>Yes</entry>
  56. <entry>Yes</entry>
  57. </row>
  58. <row>
  59. <entry><constant>V4L2_SEL_TGT_NATIVE_SIZE</constant></entry>
  60. <entry>0x0003</entry>
  61. <entry>The native size of the device, e.g. a sensor's
  62. pixel array. <structfield>left</structfield> and
  63. <structfield>top</structfield> fields are zero for this
  64. target. Setting the native size will generally only make
  65. sense for memory to memory devices where the software can
  66. create a canvas of a given size in which for example a
  67. video frame can be composed. In that case
  68. V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
  69. of that canvas.
  70. </entry>
  71. <entry>Yes</entry>
  72. <entry>Yes</entry>
  73. </row>
  74. <row>
  75. <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
  76. <entry>0x0100</entry>
  77. <entry>Compose rectangle. Used to configure scaling
  78. and composition.</entry>
  79. <entry>Yes</entry>
  80. <entry>Yes</entry>
  81. </row>
  82. <row>
  83. <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
  84. <entry>0x0101</entry>
  85. <entry>Suggested composition rectangle that covers the "whole picture".</entry>
  86. <entry>Yes</entry>
  87. <entry>No</entry>
  88. </row>
  89. <row>
  90. <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
  91. <entry>0x0102</entry>
  92. <entry>Bounds of the compose rectangle. All valid compose
  93. rectangles fit inside the compose bounds rectangle.</entry>
  94. <entry>Yes</entry>
  95. <entry>Yes</entry>
  96. </row>
  97. <row>
  98. <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
  99. <entry>0x0103</entry>
  100. <entry>The active area and all padding pixels that are inserted or
  101. modified by hardware.</entry>
  102. <entry>Yes</entry>
  103. <entry>No</entry>
  104. </row>
  105. </tbody>
  106. </tgroup>
  107. </table>
  108. </section>
  109. <section id="v4l2-selection-flags">
  110. <title>Selection flags</title>
  111. <table pgwide="1" frame="none" id="v4l2-selection-flags-table">
  112. <title>Selection flag definitions</title>
  113. <tgroup cols="5">
  114. <colspec colname="c1" />
  115. <colspec colname="c2" />
  116. <colspec colname="c3" />
  117. <colspec colname="c4" />
  118. <colspec colname="c5" />
  119. &cs-def;
  120. <thead>
  121. <row rowsep="1">
  122. <entry align="left">Flag name</entry>
  123. <entry align="left">id</entry>
  124. <entry align="left">Definition</entry>
  125. <entry align="left">Valid for V4L2</entry>
  126. <entry align="left">Valid for V4L2 subdev</entry>
  127. </row>
  128. </thead>
  129. <tbody valign="top">
  130. <row>
  131. <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
  132. <entry>(1 &lt;&lt; 0)</entry>
  133. <entry>Suggest the driver it should choose greater or
  134. equal rectangle (in size) than was requested. Albeit the
  135. driver may choose a lesser size, it will only do so due to
  136. hardware limitations. Without this flag (and
  137. <constant>V4L2_SEL_FLAG_LE</constant>) the
  138. behaviour is to choose the closest possible
  139. rectangle.</entry>
  140. <entry>Yes</entry>
  141. <entry>Yes</entry>
  142. </row>
  143. <row>
  144. <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
  145. <entry>(1 &lt;&lt; 1)</entry>
  146. <entry>Suggest the driver it
  147. should choose lesser or equal rectangle (in size) than was
  148. requested. Albeit the driver may choose a greater size, it
  149. will only do so due to hardware limitations.</entry>
  150. <entry>Yes</entry>
  151. <entry>Yes</entry>
  152. </row>
  153. <row>
  154. <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
  155. <entry>(1 &lt;&lt; 2)</entry>
  156. <entry>The configuration must not be propagated to any
  157. further processing steps. If this flag is not given, the
  158. configuration is propagated inside the subdevice to all
  159. further processing steps.</entry>
  160. <entry>No</entry>
  161. <entry>Yes</entry>
  162. </row>
  163. </tbody>
  164. </tgroup>
  165. </table>
  166. </section>
  167. </section>