diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-03-09 04:46:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 14:33:24 -0400 |
commit | 9080d5d3fa9888facd6898c6705b1a6713882955 (patch) | |
tree | 8c22e1810cd899e57ac132b38a6b262537a96bbc /Documentation/DocBook/media | |
parent | 1d53160111d821d5d924e220f6b5b423f938d617 (diff) |
[media] V4L: Improve the selection API documentation
Make the VIDIOC_G/S_SELECTION ioctls documentation more consistent
with the rest of media Docbook, use capital letters where necessary
and correct few minor errors.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/DocBook/media')
-rw-r--r-- | Documentation/DocBook/media/v4l/selection-api.xml | 8 | ||||
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-g-selection.xml | 106 |
2 files changed, 61 insertions, 53 deletions
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml index 2f0bdb4d5551..b299e4779354 100644 --- a/Documentation/DocBook/media/v4l/selection-api.xml +++ b/Documentation/DocBook/media/v4l/selection-api.xml | |||
@@ -52,6 +52,10 @@ cropping and composing rectangles have the same size.</para> | |||
52 | </textobject> | 52 | </textobject> |
53 | </mediaobject> | 53 | </mediaobject> |
54 | </figure> | 54 | </figure> |
55 | |||
56 | For complete list of the available selection targets see table <xref | ||
57 | linkend="v4l2-sel-target"/> | ||
58 | |||
55 | </section> | 59 | </section> |
56 | 60 | ||
57 | <section> | 61 | <section> |
@@ -186,7 +190,7 @@ V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> | |||
186 | 190 | ||
187 | <section> | 191 | <section> |
188 | 192 | ||
189 | <title>Scaling control.</title> | 193 | <title>Scaling control</title> |
190 | 194 | ||
191 | <para>An application can detect if scaling is performed by comparing the width | 195 | <para>An application can detect if scaling is performed by comparing the width |
192 | and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE | 196 | and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE |
@@ -200,7 +204,7 @@ the scaling ratios using these values.</para> | |||
200 | 204 | ||
201 | <section> | 205 | <section> |
202 | 206 | ||
203 | <title>Comparison with old cropping API.</title> | 207 | <title>Comparison with old cropping API</title> |
204 | 208 | ||
205 | <para>The selection API was introduced to cope with deficiencies of previous | 209 | <para>The selection API was introduced to cope with deficiencies of previous |
206 | <link linkend="crop"> API </link>, that was designed to control simple capture | 210 | <link linkend="crop"> API </link>, that was designed to control simple capture |
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml index a9d36e0c090e..bb04eff75f45 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml | |||
@@ -58,43 +58,43 @@ | |||
58 | 58 | ||
59 | <para>The ioctls are used to query and configure selection rectangles.</para> | 59 | <para>The ioctls are used to query and configure selection rectangles.</para> |
60 | 60 | ||
61 | <para> To query the cropping (composing) rectangle set <structfield> | 61 | <para> To query the cropping (composing) rectangle set &v4l2-selection; |
62 | &v4l2-selection;::type </structfield> to the respective buffer type. Do not | 62 | <structfield> type </structfield> field to the respective buffer type. |
63 | use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | 63 | Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE |
64 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE | 64 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE |
65 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | 65 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of |
66 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | 66 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is |
67 | setting <structfield> &v4l2-selection;::target </structfield> to value | 67 | setting the value of &v4l2-selection; <structfield>target</structfield> field |
68 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> | 68 | to <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> |
69 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | 69 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref |
70 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | 70 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional |
71 | targets. Fields <structfield> &v4l2-selection;::flags </structfield> and | 71 | targets. The <structfield>flags</structfield> and <structfield>reserved |
72 | <structfield> &v4l2-selection;::reserved </structfield> are ignored and they | 72 | </structfield> fields of &v4l2-selection; are ignored and they must be filled |
73 | must be filled with zeros. The driver fills the rest of the structure or | 73 | with zeros. The driver fills the rest of the structure or |
74 | returns &EINVAL; if incorrect buffer type or target was used. If cropping | 74 | returns &EINVAL; if incorrect buffer type or target was used. If cropping |
75 | (composing) is not supported then the active rectangle is not mutable and it is | 75 | (composing) is not supported then the active rectangle is not mutable and it is |
76 | always equal to the bounds rectangle. Finally, structure <structfield> | 76 | always equal to the bounds rectangle. Finally, the &v4l2-rect; |
77 | &v4l2-selection;::r </structfield> is filled with the current cropping | 77 | <structfield>r</structfield> rectangle is filled with the current cropping |
78 | (composing) coordinates. The coordinates are expressed in driver-dependent | 78 | (composing) coordinates. The coordinates are expressed in driver-dependent |
79 | units. The only exception are rectangles for images in raw formats, whose | 79 | units. The only exception are rectangles for images in raw formats, whose |
80 | coordinates are always expressed in pixels. </para> | 80 | coordinates are always expressed in pixels. </para> |
81 | 81 | ||
82 | <para> To change the cropping (composing) rectangle set <structfield> | 82 | <para> To change the cropping (composing) rectangle set the &v4l2-selection; |
83 | &v4l2-selection;::type </structfield> to the respective buffer type. Do not | 83 | <structfield>type</structfield> field to the respective buffer type. Do not |
84 | use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE | 84 | use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE |
85 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE | 85 | </constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE |
86 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of | 86 | </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of |
87 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is | 87 | <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is |
88 | setting <structfield> &v4l2-selection;::target </structfield> to value | 88 | setting the value of &v4l2-selection; <structfield>target</structfield> to |
89 | <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> | 89 | <constant>V4L2_SEL_TGT_CROP_ACTIVE</constant> (<constant> |
90 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref | 90 | V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref |
91 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional | 91 | linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional |
92 | targets. Set desired active area into the field <structfield> | 92 | targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be |
93 | &v4l2-selection;::r </structfield>. Field <structfield> | 93 | set to the desired active area. Field &v4l2-selection; <structfield> reserved |
94 | &v4l2-selection;::reserved </structfield> is ignored and must be filled with | 94 | </structfield> is ignored and must be filled with zeros. The driver may adjust |
95 | zeros. The driver may adjust the rectangle coordinates. An application may | 95 | coordinates of the requested rectangle. An application may |
96 | introduce constraints to control rounding behaviour. Set the field | 96 | introduce constraints to control rounding behaviour. The &v4l2-selection; |
97 | <structfield> &v4l2-selection;::flags </structfield> to one of values: | 97 | <structfield>flags</structfield> field must be set to one of the following: |
98 | 98 | ||
99 | <itemizedlist> | 99 | <itemizedlist> |
100 | <listitem> | 100 | <listitem> |
@@ -129,7 +129,7 @@ and vertical offset and sizes are chosen according to following priority: | |||
129 | 129 | ||
130 | <orderedlist> | 130 | <orderedlist> |
131 | <listitem> | 131 | <listitem> |
132 | <para>Satisfy constraints from <structfield>&v4l2-selection;::flags</structfield>.</para> | 132 | <para>Satisfy constraints from &v4l2-selection; <structfield>flags</structfield>.</para> |
133 | </listitem> | 133 | </listitem> |
134 | <listitem> | 134 | <listitem> |
135 | <para>Adjust width, height, left, and top to hardware limits and alignments.</para> | 135 | <para>Adjust width, height, left, and top to hardware limits and alignments.</para> |
@@ -145,7 +145,7 @@ and vertical offset and sizes are chosen according to following priority: | |||
145 | </listitem> | 145 | </listitem> |
146 | </orderedlist> | 146 | </orderedlist> |
147 | 147 | ||
148 | On success the field <structfield> &v4l2-selection;::r </structfield> contains | 148 | On success the &v4l2-rect; <structfield>r</structfield> field contains |
149 | the adjusted rectangle. When the parameters are unsuitable the application may | 149 | the adjusted rectangle. When the parameters are unsuitable the application may |
150 | modify the cropping (composing) or image parameters and repeat the cycle until | 150 | modify the cropping (composing) or image parameters and repeat the cycle until |
151 | satisfactory parameters have been negotiated. If constraints flags have to be | 151 | satisfactory parameters have been negotiated. If constraints flags have to be |
@@ -162,38 +162,38 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
162 | <tbody valign="top"> | 162 | <tbody valign="top"> |
163 | <row> | 163 | <row> |
164 | <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry> | 164 | <entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry> |
165 | <entry>0</entry> | 165 | <entry>0x0000</entry> |
166 | <entry>area that is currently cropped by hardware</entry> | 166 | <entry>The area that is currently cropped by hardware.</entry> |
167 | </row> | 167 | </row> |
168 | <row> | 168 | <row> |
169 | <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry> | 169 | <entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry> |
170 | <entry>1</entry> | 170 | <entry>0x0001</entry> |
171 | <entry>suggested cropping rectangle that covers the "whole picture"</entry> | 171 | <entry>Suggested cropping rectangle that covers the "whole picture".</entry> |
172 | </row> | 172 | </row> |
173 | <row> | 173 | <row> |
174 | <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry> | 174 | <entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry> |
175 | <entry>2</entry> | 175 | <entry>0x0002</entry> |
176 | <entry>limits for the cropping rectangle</entry> | 176 | <entry>Limits for the cropping rectangle.</entry> |
177 | </row> | 177 | </row> |
178 | <row> | 178 | <row> |
179 | <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry> | 179 | <entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry> |
180 | <entry>256</entry> | 180 | <entry>0x0100</entry> |
181 | <entry>area to which data are composed by hardware</entry> | 181 | <entry>The area to which data is composed by hardware.</entry> |
182 | </row> | 182 | </row> |
183 | <row> | 183 | <row> |
184 | <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry> | 184 | <entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry> |
185 | <entry>257</entry> | 185 | <entry>0x0101</entry> |
186 | <entry>suggested composing rectangle that covers the "whole picture"</entry> | 186 | <entry>Suggested composing rectangle that covers the "whole picture".</entry> |
187 | </row> | 187 | </row> |
188 | <row> | 188 | <row> |
189 | <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry> | 189 | <entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry> |
190 | <entry>258</entry> | 190 | <entry>0x0102</entry> |
191 | <entry>limits for the composing rectangle</entry> | 191 | <entry>Limits for the composing rectangle.</entry> |
192 | </row> | 192 | </row> |
193 | <row> | 193 | <row> |
194 | <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry> | 194 | <entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry> |
195 | <entry>259</entry> | 195 | <entry>0x0103</entry> |
196 | <entry>the active area and all padding pixels that are inserted or modified by the hardware</entry> | 196 | <entry>The active area and all padding pixels that are inserted or modified by hardware.</entry> |
197 | </row> | 197 | </row> |
198 | </tbody> | 198 | </tbody> |
199 | </tgroup> | 199 | </tgroup> |
@@ -209,12 +209,14 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
209 | <row> | 209 | <row> |
210 | <entry><constant>V4L2_SEL_FLAG_GE</constant></entry> | 210 | <entry><constant>V4L2_SEL_FLAG_GE</constant></entry> |
211 | <entry>0x00000001</entry> | 211 | <entry>0x00000001</entry> |
212 | <entry>indicate that adjusted rectangle must contain a rectangle from <structfield>&v4l2-selection;::r</structfield></entry> | 212 | <entry>Indicates that the adjusted rectangle must contain the original |
213 | &v4l2-selection; <structfield>r</structfield> rectangle.</entry> | ||
213 | </row> | 214 | </row> |
214 | <row> | 215 | <row> |
215 | <entry><constant>V4L2_SEL_FLAG_LE</constant></entry> | 216 | <entry><constant>V4L2_SEL_FLAG_LE</constant></entry> |
216 | <entry>0x00000002</entry> | 217 | <entry>0x00000002</entry> |
217 | <entry>indicate that adjusted rectangle must be inside a rectangle from <structfield>&v4l2-selection;::r</structfield></entry> | 218 | <entry>Indicates that the adjusted rectangle must be inside the original |
219 | &v4l2-rect; <structfield>r</structfield> rectangle.</entry> | ||
218 | </row> | 220 | </row> |
219 | </tbody> | 221 | </tbody> |
220 | </tgroup> | 222 | </tgroup> |
@@ -245,27 +247,29 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
245 | <row> | 247 | <row> |
246 | <entry>__u32</entry> | 248 | <entry>__u32</entry> |
247 | <entry><structfield>type</structfield></entry> | 249 | <entry><structfield>type</structfield></entry> |
248 | <entry>Type of the buffer (from &v4l2-buf-type;)</entry> | 250 | <entry>Type of the buffer (from &v4l2-buf-type;).</entry> |
249 | </row> | 251 | </row> |
250 | <row> | 252 | <row> |
251 | <entry>__u32</entry> | 253 | <entry>__u32</entry> |
252 | <entry><structfield>target</structfield></entry> | 254 | <entry><structfield>target</structfield></entry> |
253 | <entry>used to select between <link linkend="v4l2-sel-target"> cropping and composing rectangles </link></entry> | 255 | <entry>Used to select between <link linkend="v4l2-sel-target"> cropping |
256 | and composing rectangles</link>.</entry> | ||
254 | </row> | 257 | </row> |
255 | <row> | 258 | <row> |
256 | <entry>__u32</entry> | 259 | <entry>__u32</entry> |
257 | <entry><structfield>flags</structfield></entry> | 260 | <entry><structfield>flags</structfield></entry> |
258 | <entry>control over coordinates adjustments, refer to <link linkend="v4l2-sel-flags">selection flags</link></entry> | 261 | <entry>Flags controlling the selection rectangle adjustments, refer to |
262 | <link linkend="v4l2-sel-flags">selection flags</link>.</entry> | ||
259 | </row> | 263 | </row> |
260 | <row> | 264 | <row> |
261 | <entry>&v4l2-rect;</entry> | 265 | <entry>&v4l2-rect;</entry> |
262 | <entry><structfield>r</structfield></entry> | 266 | <entry><structfield>r</structfield></entry> |
263 | <entry>selection rectangle</entry> | 267 | <entry>The selection rectangle.</entry> |
264 | </row> | 268 | </row> |
265 | <row> | 269 | <row> |
266 | <entry>__u32</entry> | 270 | <entry>__u32</entry> |
267 | <entry><structfield>reserved[9]</structfield></entry> | 271 | <entry><structfield>reserved[9]</structfield></entry> |
268 | <entry>Reserved fields for future use</entry> | 272 | <entry>Reserved fields for future use.</entry> |
269 | </row> | 273 | </row> |
270 | </tbody> | 274 | </tbody> |
271 | </tgroup> | 275 | </tgroup> |
@@ -278,24 +282,24 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> | |||
278 | <varlistentry> | 282 | <varlistentry> |
279 | <term><errorcode>EINVAL</errorcode></term> | 283 | <term><errorcode>EINVAL</errorcode></term> |
280 | <listitem> | 284 | <listitem> |
281 | <para>The buffer <structfield> &v4l2-selection;::type </structfield> | 285 | <para>Given buffer type <structfield>type</structfield> or |
282 | or <structfield> &v4l2-selection;::target </structfield> is not supported, or | 286 | the selection target <structfield>target</structfield> is not supported, |
283 | the <structfield> &v4l2-selection;::flags </structfield> are invalid.</para> | 287 | or the <structfield>flags</structfield> argument is not valid.</para> |
284 | </listitem> | 288 | </listitem> |
285 | </varlistentry> | 289 | </varlistentry> |
286 | <varlistentry> | 290 | <varlistentry> |
287 | <term><errorcode>ERANGE</errorcode></term> | 291 | <term><errorcode>ERANGE</errorcode></term> |
288 | <listitem> | 292 | <listitem> |
289 | <para>it is not possible to adjust a rectangle <structfield> | 293 | <para>It is not possible to adjust &v4l2-rect; <structfield> |
290 | &v4l2-selection;::r </structfield> that satisfies all contraints from | 294 | r</structfield> rectangle to satisfy all contraints given in the |
291 | <structfield> &v4l2-selection;::flags </structfield>.</para> | 295 | <structfield>flags</structfield> argument.</para> |
292 | </listitem> | 296 | </listitem> |
293 | </varlistentry> | 297 | </varlistentry> |
294 | <varlistentry> | 298 | <varlistentry> |
295 | <term><errorcode>EBUSY</errorcode></term> | 299 | <term><errorcode>EBUSY</errorcode></term> |
296 | <listitem> | 300 | <listitem> |
297 | <para>it is not possible to apply change of selection rectangle at the moment. | 301 | <para>It is not possible to apply change of the selection rectangle |
298 | Usually because streaming is in progress.</para> | 302 | at the moment. Usually because streaming is in progress.</para> |
299 | </listitem> | 303 | </listitem> |
300 | </varlistentry> | 304 | </varlistentry> |
301 | </variablelist> | 305 | </variablelist> |