aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2012-06-01 12:56:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 19:17:00 -0400
commit64b9ce83a446277d3ffdb5e25e9aeb66442da2a9 (patch)
tree58c4215f4982f9a697b89555eb38158cb51f3ecb /Documentation/DocBook/media
parent5689b28890f4a7c4e12290dbf2c29a9d23047335 (diff)
[media] v4l: Common documentation for selection targets
Both V4L2 and V4L2 subdev interface have very similar selection APIs with differences foremost related to in-memory and media bus formats. However, the selection targets are the same for both. Most targets are and in the future will likely continue to be more the same than with any differences. Thus it makes sense to unify the documentation of the targets. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook/media')
-rw-r--r--Documentation/DocBook/media/v4l/compat.xml9
-rw-r--r--Documentation/DocBook/media/v4l/dev-subdev.xml12
-rw-r--r--Documentation/DocBook/media/v4l/selection-api.xml6
-rw-r--r--Documentation/DocBook/media/v4l/selections-common.xml92
-rw-r--r--Documentation/DocBook/media/v4l/v4l2.xml5
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-selection.xml54
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml34
7 files changed, 119 insertions, 93 deletions
diff --git a/Documentation/DocBook/media/v4l/compat.xml b/Documentation/DocBook/media/v4l/compat.xml
index a8b374930405..97b895151bb0 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2377,10 +2377,11 @@ that used it. It was originally scheduled for removal in 2.6.35.
2377 <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para> 2377 <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
2378 </listitem> 2378 </listitem>
2379 <listitem> 2379 <listitem>
2380 <para>Add selection API for extended control over cropping and 2380 <para>Add selection API for extended control over cropping
2381composing. Does not affect the compatibility of current drivers and 2381 and composing. Does not affect the compatibility of current
2382applications. See <link linkend="selection-api"> selection API </link> for 2382 drivers and applications. See <link
2383details.</para> 2383 linkend="selection-api"> selection API </link> for
2384 details.</para>
2384 </listitem> 2385 </listitem>
2385 </orderedlist> 2386 </orderedlist>
2386 </section> 2387 </section>
diff --git a/Documentation/DocBook/media/v4l/dev-subdev.xml b/Documentation/DocBook/media/v4l/dev-subdev.xml
index e88d5ea8f826..afeb196adce5 100644
--- a/Documentation/DocBook/media/v4l/dev-subdev.xml
+++ b/Documentation/DocBook/media/v4l/dev-subdev.xml
@@ -276,7 +276,7 @@
276 </para> 276 </para>
277 </section> 277 </section>
278 278
279 <section> 279 <section id="v4l2-subdev-selections">
280 <title>Selections: cropping, scaling and composition</title> 280 <title>Selections: cropping, scaling and composition</title>
281 281
282 <para>Many sub-devices support cropping frames on their input or output 282 <para>Many sub-devices support cropping frames on their input or output
@@ -289,9 +289,9 @@
289 &v4l2-rect; by the coordinates of the top left corner and the rectangle 289 &v4l2-rect; by the coordinates of the top left corner and the rectangle
290 size. Both the coordinates and sizes are expressed in pixels.</para> 290 size. Both the coordinates and sizes are expressed in pixels.</para>
291 291
292 <para>As for pad formats, drivers store try and active rectangles for 292 <para>As for pad formats, drivers store try and active
293 the selection targets <xref 293 rectangles for the selection targets <xref
294 linkend="v4l2-subdev-selection-targets" />.</para> 294 linkend="v4l2-selections-common" />.</para>
295 295
296 <para>On sink pads, cropping is applied relative to the 296 <para>On sink pads, cropping is applied relative to the
297 current pad format. The pad format represents the image size as 297 current pad format. The pad format represents the image size as
@@ -308,7 +308,7 @@
308 <para>Scaling support is optional. When supported by a subdev, 308 <para>Scaling support is optional. When supported by a subdev,
309 the crop rectangle on the subdev's sink pad is scaled to the 309 the crop rectangle on the subdev's sink pad is scaled to the
310 size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL 310 size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL
311 using <constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant> 311 using <constant>V4L2_SEL_TGT_COMPOSE</constant>
312 selection target on the same pad. If the subdev supports scaling 312 selection target on the same pad. If the subdev supports scaling
313 but not composing, the top and left values are not used and must 313 but not composing, the top and left values are not used and must
314 always be set to zero.</para> 314 always be set to zero.</para>
@@ -362,7 +362,7 @@
362 performed by the user: the changes made will be propagated to 362 performed by the user: the changes made will be propagated to
363 any subsequent stages. If this behaviour is not desired, the 363 any subsequent stages. If this behaviour is not desired, the
364 user must set 364 user must set
365 <constant>V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG</constant> flag. This 365 <constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant> flag. This
366 flag causes no propagation of the changes are allowed in any 366 flag causes no propagation of the changes are allowed in any
367 circumstances. This may also cause the accessed rectangle to be 367 circumstances. This may also cause the accessed rectangle to be
368 adjusted by the driver, depending on the properties of the 368 adjusted by the driver, depending on the properties of the
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
index ac013e50e0bd..24dec10259d2 100644
--- a/Documentation/DocBook/media/v4l/selection-api.xml
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -53,11 +53,11 @@ cropping and composing rectangles have the same size.</para>
53 </mediaobject> 53 </mediaobject>
54 </figure> 54 </figure>
55 55
56For complete list of the available selection targets see table <xref
57linkend="v4l2-sel-target"/>
58
59 </section> 56 </section>
60 57
58 See <xref linkend="v4l2-selection-targets-table" /> for more
59 information.
60
61 <section> 61 <section>
62 62
63 <title>Configuration</title> 63 <title>Configuration</title>
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml
new file mode 100644
index 000000000000..6728688d28df
--- /dev/null
+++ b/Documentation/DocBook/media/v4l/selections-common.xml
@@ -0,0 +1,92 @@
1<section id="v4l2-selections-common">
2
3 <title>Selection targets</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>The precise meaning of the selection targets may thus be
14 affected on which of the two interfaces they are used.</para>
15
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_COMPOSE</constant></entry>
60 <entry>0x0100</entry>
61 <entry>Compose rectangle. Used to configure scaling
62 and composition.</entry>
63 <entry>Yes</entry>
64 <entry>Yes</entry>
65 </row>
66 <row>
67 <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
68 <entry>0x0101</entry>
69 <entry>Suggested composition rectangle that covers the "whole picture".</entry>
70 <entry>Yes</entry>
71 <entry>No</entry>
72 </row>
73 <row>
74 <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
75 <entry>0x0102</entry>
76 <entry>Bounds of the compose rectangle. All valid compose
77 rectangles fit inside the compose bounds rectangle.</entry>
78 <entry>Yes</entry>
79 <entry>Yes</entry>
80 </row>
81 <row>
82 <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
83 <entry>0x0103</entry>
84 <entry>The active area and all padding pixels that are inserted or
85 modified by hardware.</entry>
86 <entry>Yes</entry>
87 <entry>No</entry>
88 </row>
89 </tbody>
90 </tgroup>
91 </table>
92</section>
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml b/Documentation/DocBook/media/v4l/v4l2.xml
index 008c2d73a484..36bafc48e03b 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -589,6 +589,11 @@ and discussions on the V4L mailing list.</revremark>
589 &sub-write; 589 &sub-write;
590 </appendix> 590 </appendix>
591 591
592 <appendix>
593 <title>Common definitions for V4L2 and V4L2 subdev interfaces</title>
594 &sub-selections-common;
595 </appendix>
596
592 <appendix id="videodev"> 597 <appendix id="videodev">
593 <title>Video For Linux Two Header File</title> 598 <title>Video For Linux Two Header File</title>
594 &sub-videodev2-h; 599 &sub-videodev2-h;
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
index 6376e57ff576..c6f83257ecee 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
@@ -67,7 +67,7 @@ Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
67setting the value of &v4l2-selection; <structfield>target</structfield> field 67setting the value of &v4l2-selection; <structfield>target</structfield> field
68to <constant> V4L2_SEL_TGT_CROP </constant> (<constant> 68to <constant> V4L2_SEL_TGT_CROP </constant> (<constant>
69V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref 69V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
70linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional 70linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
71targets. The <structfield>flags</structfield> and <structfield>reserved 71targets. The <structfield>flags</structfield> and <structfield>reserved
72</structfield> fields of &v4l2-selection; are ignored and they must be filled 72</structfield> fields of &v4l2-selection; are ignored and they must be filled
73with zeros. The driver fills the rest of the structure or 73with zeros. The driver fills the rest of the structure or
@@ -88,7 +88,7 @@ use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
88setting the value of &v4l2-selection; <structfield>target</structfield> to 88setting the value of &v4l2-selection; <structfield>target</structfield> to
89<constant>V4L2_SEL_TGT_CROP</constant> (<constant> 89<constant>V4L2_SEL_TGT_CROP</constant> (<constant>
90V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref 90V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
91linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional 91linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
92targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be 92targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be
93set to the desired active area. Field &v4l2-selection; <structfield> reserved 93set to the desired active area. Field &v4l2-selection; <structfield> reserved
94</structfield> is ignored and must be filled with zeros. The driver may adjust 94</structfield> is ignored and must be filled with zeros. The driver may adjust
@@ -154,52 +154,8 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
154 154
155 </refsect1> 155 </refsect1>
156 156
157 <refsect1> 157 <para>Selection targets are documented in <xref
158 <table frame="none" pgwide="1" id="v4l2-sel-target"> 158 linkend="v4l2-selections-common"/>.</para>
159 <title>Selection targets.</title>
160 <tgroup cols="3">
161 &cs-def;
162 <tbody valign="top">
163 <row>
164 <entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
165 <entry>0x0000</entry>
166 <entry>The area that is currently cropped by hardware.</entry>
167 </row>
168 <row>
169 <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
170 <entry>0x0001</entry>
171 <entry>Suggested cropping rectangle that covers the "whole picture".</entry>
172 </row>
173 <row>
174 <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
175 <entry>0x0002</entry>
176 <entry>Limits for the cropping rectangle.</entry>
177 </row>
178 <row>
179 <entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
180 <entry>0x0100</entry>
181 <entry>The area to which data is composed by hardware.</entry>
182 </row>
183 <row>
184 <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
185 <entry>0x0101</entry>
186 <entry>Suggested composing rectangle that covers the "whole picture".</entry>
187 </row>
188 <row>
189 <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
190 <entry>0x0102</entry>
191 <entry>Limits for the composing rectangle.</entry>
192 </row>
193 <row>
194 <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
195 <entry>0x0103</entry>
196 <entry>The active area and all padding pixels that are inserted or
197 modified by hardware.</entry>
198 </row>
199 </tbody>
200 </tgroup>
201 </table>
202 </refsect1>
203 159
204 <refsect1> 160 <refsect1>
205 <table frame="none" pgwide="1" id="v4l2-sel-flags"> 161 <table frame="none" pgwide="1" id="v4l2-sel-flags">
@@ -253,7 +209,7 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
253 <row> 209 <row>
254 <entry>__u32</entry> 210 <entry>__u32</entry>
255 <entry><structfield>target</structfield></entry> 211 <entry><structfield>target</structfield></entry>
256 <entry>Used to select between <link linkend="v4l2-sel-target"> cropping 212 <entry>Used to select between <link linkend="v4l2-selections-common"> cropping
257 and composing rectangles</link>.</entry> 213 and composing rectangles</link>.</entry>
258 </row> 214 </row>
259 <row> 215 <row>
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
index 4c44808ab25c..ace147806e48 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -87,36 +87,8 @@
87 <constant>EINVAL</constant>.</para> 87 <constant>EINVAL</constant>.</para>
88 </section> 88 </section>
89 89
90 <table pgwide="1" frame="none" id="v4l2-subdev-selection-targets"> 90 <para>Selection targets are documented in <xref
91 <title>V4L2 subdev selection targets</title> 91 linkend="v4l2-selections-common"/>.</para>
92 <tgroup cols="3">
93 &cs-def;
94 <tbody valign="top">
95 <row>
96 <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP</constant></entry>
97 <entry>0x0000</entry>
98 <entry>Actual crop. Defines the cropping
99 performed by the processing step.</entry>
100 </row>
101 <row>
102 <entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS</constant></entry>
103 <entry>0x0002</entry>
104 <entry>Bounds of the crop rectangle.</entry>
105 </row>
106 <row>
107 <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE</constant></entry>
108 <entry>0x0100</entry>
109 <entry>Actual compose rectangle. Used to configure scaling
110 on sink pads and composition on source pads.</entry>
111 </row>
112 <row>
113 <entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
114 <entry>0x0102</entry>
115 <entry>Bounds of the compose rectangle.</entry>
116 </row>
117 </tbody>
118 </tgroup>
119 </table>
120 92
121 <table pgwide="1" frame="none" id="v4l2-subdev-selection-flags"> 93 <table pgwide="1" frame="none" id="v4l2-subdev-selection-flags">
122 <title>V4L2 subdev selection flags</title> 94 <title>V4L2 subdev selection flags</title>
@@ -173,7 +145,7 @@
173 <entry>__u32</entry> 145 <entry>__u32</entry>
174 <entry><structfield>target</structfield></entry> 146 <entry><structfield>target</structfield></entry>
175 <entry>Target selection rectangle. See 147 <entry>Target selection rectangle. See
176 <xref linkend="v4l2-subdev-selection-targets">.</xref>.</entry> 148 <xref linkend="v4l2-selections-common" />.</entry>
177 </row> 149 </row>
178 <row> 150 <row>
179 <entry>__u32</entry> 151 <entry>__u32</entry>