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_COMPOSE</constant></entry>
68 <entry>Compose rectangle. Used to configure scaling
69 and composition.</entry>
74 <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
76 <entry>Suggested composition rectangle that covers the "whole picture".</entry>
81 <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
83 <entry>Bounds of the compose rectangle. All valid compose
84 rectangles fit inside the compose bounds rectangle.</entry>
89 <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
91 <entry>The active area and all padding pixels that are inserted or
92 modified by hardware.</entry>
102 <section id="v4l2-selection-flags">
104 <title>Selection flags</title>
106 <table pgwide="1" frame="none" id="v4l2-selection-flags-table">
107 <title>Selection flag definitions</title>
109 <colspec colname="c1" />
110 <colspec colname="c2" />
111 <colspec colname="c3" />
112 <colspec colname="c4" />
113 <colspec colname="c5" />
117 <entry align="left">Flag name</entry>
118 <entry align="left">id</entry>
119 <entry align="left">Definition</entry>
120 <entry align="left">Valid for V4L2</entry>
121 <entry align="left">Valid for V4L2 subdev</entry>
126 <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
127 <entry>(1 << 0)</entry>
128 <entry>Suggest the driver it should choose greater or
129 equal rectangle (in size) than was requested. Albeit the
130 driver may choose a lesser size, it will only do so due to
131 hardware limitations. Without this flag (and
132 <constant>V4L2_SEL_FLAG_LE</constant>) the
133 behaviour is to choose the closest possible
139 <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
140 <entry>(1 << 1)</entry>
141 <entry>Suggest the driver it
142 should choose lesser or equal rectangle (in size) than was
143 requested. Albeit the driver may choose a greater size, it
144 will only do so due to hardware limitations.</entry>
149 <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
150 <entry>(1 << 2)</entry>
151 <entry>The configuration must not be propagated to any
152 further processing steps. If this flag is not given, the
153 configuration is propagated inside the subdevice to all
154 further processing steps.</entry>