Linux-libre 3.16.85-gnu
[librecmc/linux-libre.git] / Documentation / DocBook / media / v4l / selections-common.xml
1 <section id="v4l2-selections-common">
2
3   <title>Common selection definitions</title>
4
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>
12
13   <para>This section defines the common definitions of the
14   selection interfaces on the two APIs.</para>
15
16   <section id="v4l2-selection-targets">
17
18     <title>Selection targets</title>
19
20     <para>The precise meaning of the selection targets may be
21     dependent on which of the two interfaces they are used.</para>
22
23     <table pgwide="1" frame="none" id="v4l2-selection-targets-table">
24     <title>Selection target definitions</title>
25       <tgroup cols="5">
26         <colspec colname="c1" />
27         <colspec colname="c2" />
28         <colspec colname="c3" />
29         <colspec colname="c4" />
30         <colspec colname="c5" />
31         &cs-def;
32         <thead>
33           <row rowsep="1">
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>
39           </row>
40         </thead>
41         <tbody valign="top">
42           <row>
43             <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
44             <entry>0x0000</entry>
45             <entry>Crop rectangle. Defines the cropped area.</entry>
46             <entry>Yes</entry>
47             <entry>Yes</entry>
48           </row>
49           <row>
50             <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
51             <entry>0x0001</entry>
52             <entry>Suggested cropping rectangle that covers the "whole picture".</entry>
53             <entry>Yes</entry>
54             <entry>No</entry>
55           </row>
56           <row>
57             <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
58             <entry>0x0002</entry>
59             <entry>Bounds of the crop rectangle. All valid crop
60             rectangles fit inside the crop bounds rectangle.
61             </entry>
62             <entry>Yes</entry>
63             <entry>Yes</entry>
64           </row>
65           <row>
66             <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
67             <entry>0x0100</entry>
68             <entry>Compose rectangle. Used to configure scaling
69             and composition.</entry>
70             <entry>Yes</entry>
71             <entry>Yes</entry>
72           </row>
73           <row>
74             <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
75             <entry>0x0101</entry>
76             <entry>Suggested composition rectangle that covers the "whole picture".</entry>
77             <entry>Yes</entry>
78             <entry>No</entry>
79           </row>
80           <row>
81             <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
82             <entry>0x0102</entry>
83             <entry>Bounds of the compose rectangle. All valid compose
84             rectangles fit inside the compose bounds rectangle.</entry>
85             <entry>Yes</entry>
86             <entry>Yes</entry>
87           </row>
88           <row>
89             <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
90             <entry>0x0103</entry>
91             <entry>The active area and all padding pixels that are inserted or
92             modified by hardware.</entry>
93             <entry>Yes</entry>
94             <entry>No</entry>
95           </row>
96         </tbody>
97       </tgroup>
98     </table>
99
100   </section>
101
102   <section id="v4l2-selection-flags">
103
104     <title>Selection flags</title>
105
106     <table pgwide="1" frame="none" id="v4l2-selection-flags-table">
107     <title>Selection flag definitions</title>
108       <tgroup cols="5">
109         <colspec colname="c1" />
110         <colspec colname="c2" />
111         <colspec colname="c3" />
112         <colspec colname="c4" />
113         <colspec colname="c5" />
114         &cs-def;
115         <thead>
116         <row rowsep="1">
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>
122         </row>
123         </thead>
124         <tbody valign="top">
125           <row>
126             <entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
127             <entry>(1 &lt;&lt; 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
134             rectangle.</entry>
135             <entry>Yes</entry>
136             <entry>Yes</entry>
137           </row>
138           <row>
139             <entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
140             <entry>(1 &lt;&lt; 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>
145             <entry>Yes</entry>
146             <entry>Yes</entry>
147           </row>
148           <row>
149             <entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
150             <entry>(1 &lt;&lt; 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>
155             <entry>No</entry>
156             <entry>Yes</entry>
157           </row>
158         </tbody>
159       </tgroup>
160     </table>
161
162   </section>
163
164 </section>