1 <section id="v4l2-selections-common">
3 <title>Common selection definitions</title>
5 <para>While the <link linkend="selection-api">V4L2 selection
6 API</link> and <link linkend="v4l2-subdev-selections">V4L2 subdev
7 selection APIs</link> are very similar, there's one fundamental
8 difference between the two. On sub-device API, the selection
9 rectangle refers to the media bus format, and is bound to a
10 sub-device's pad. On the V4L2 interface the selection rectangles
11 refer to the in-memory pixel format.</para>
13 <para>This section defines the common definitions of the
14 selection interfaces on the two APIs.</para>
16 <section id="v4l2-selection-targets">
18 <title>Selection targets</title>
20 <para>The precise meaning of the selection targets may be
21 dependent on which of the two interfaces they are used.</para>
23 <table pgwide="1" frame="none" id="v4l2-selection-targets-table">
24 <title>Selection target definitions</title>
26 <colspec colname="c1" />
27 <colspec colname="c2" />
28 <colspec colname="c3" />
29 <colspec colname="c4" />
30 <colspec colname="c5" />
34 <entry align="left">Target name</entry>
35 <entry align="left">id</entry>
36 <entry align="left">Definition</entry>
37 <entry align="left">Valid for V4L2</entry>
38 <entry align="left">Valid for V4L2 subdev</entry>
43 <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
45 <entry>Crop rectangle. Defines the cropped area.</entry>
50 <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
52 <entry>Suggested cropping rectangle that covers the "whole picture".</entry>
57 <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
59 <entry>Bounds of the crop rectangle. All valid crop
60 rectangles fit inside the crop bounds rectangle.
66 <entry><constant>V4L2_SEL_TGT_NATIVE_SIZE</constant></entry>
68 <entry>The native size of the device, e.g. a sensor's
69 pixel array. <structfield>left</structfield> and
70 <structfield>top</structfield> fields are zero for this
71 target. Setting the native size will generally only make
72 sense for memory to memory devices where the software can
73 create a canvas of a given size in which for example a
74 video frame can be composed. In that case
75 V4L2_SEL_TGT_NATIVE_SIZE can be used to configure the size
82 <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
84 <entry>Compose rectangle. Used to configure scaling
85 and composition.</entry>
90 <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
92 <entry>Suggested composition rectangle that covers the "whole picture".</entry>
97 <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
99 <entry>Bounds of the compose rectangle. All valid compose
100 rectangles fit inside the compose bounds rectangle.</entry>
105 <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
106 <entry>0x0103</entry>
107 <entry>The active area and all padding pixels that are inserted or
108 modified by hardware.</entry>
118 <section id="v4l2-selection-flags">
120 <title>Selection flags</title>
122 <table pgwide="1" frame="none" id="v4l2-selection-flags-table">
123 <title>Selection flag definitions</title>
125 <colspec colname="c1" />
126 <colspec colname="c2" />
127 <colspec colname="c3" />
128 <colspec colname="c4" />
129 <colspec colname="c5" />
133 <entry align="left">Flag name</entry>
134 <entry align="left">id</entry>
135 <entry align="left">Definition</entry>
136 <entry align="left">Valid for V4L2</entry>
137 <entry align="left">Valid for V4L2 subdev</entry>
142 <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
143 <entry>(1 << 0)</entry>
144 <entry>Suggest the driver it should choose greater or
145 equal rectangle (in size) than was requested. Albeit the
146 driver may choose a lesser size, it will only do so due to
147 hardware limitations. Without this flag (and
148 <constant>V4L2_SEL_FLAG_LE</constant>) the
149 behaviour is to choose the closest possible
155 <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
156 <entry>(1 << 1)</entry>
157 <entry>Suggest the driver it
158 should choose lesser or equal rectangle (in size) than was
159 requested. Albeit the driver may choose a greater size, it
160 will only do so due to hardware limitations.</entry>
165 <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
166 <entry>(1 << 2)</entry>
167 <entry>The configuration must not be propagated to any
168 further processing steps. If this flag is not given, the
169 configuration is propagated inside the subdevice to all
170 further processing steps.</entry>