aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/media/v4l
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-06-13 03:47:37 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 15:26:55 -0400
commitd2dbd9d5bfb38c4bb4aeaf650ac7661e6cf9c105 (patch)
treec263942e3eb74ab2ea85c874b58f9ff547617faf /Documentation/DocBook/media/v4l
parent0db83cede26c5676303e8007f27a291b0277ba1b (diff)
[media] DocBook media: fix wrong spacing
There shouldn't be any spaces after <constant> or before </constant>. This leads to ugly results like: 'image size set by VIDIOC_S_FMT .' Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'Documentation/DocBook/media/v4l')
-rw-r--r--Documentation/DocBook/media/v4l/selection-api.xml95
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-g-selection.xml40
2 files changed, 66 insertions, 69 deletions
diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
index 4c238ce068b0..28cbded766c9 100644
--- a/Documentation/DocBook/media/v4l/selection-api.xml
+++ b/Documentation/DocBook/media/v4l/selection-api.xml
@@ -86,47 +86,47 @@ selection targets available for a video capture device. It is recommended to
86configure the cropping targets before to the composing targets.</para> 86configure the cropping targets before to the composing targets.</para>
87 87
88<para>The range of coordinates of the top left corner, width and height of 88<para>The range of coordinates of the top left corner, width and height of
89areas that can be sampled is given by the <constant> V4L2_SEL_TGT_CROP_BOUNDS 89areas that can be sampled is given by the <constant>V4L2_SEL_TGT_CROP_BOUNDS</constant>
90</constant> target. It is recommended for the driver developers to put the 90target. It is recommended for the driver developers to put the
91top/left corner at position <constant> (0,0) </constant>. The rectangle's 91top/left corner at position <constant>(0,0)</constant>. The rectangle's
92coordinates are expressed in pixels.</para> 92coordinates are expressed in pixels.</para>
93 93
94<para>The top left corner, width and height of the source rectangle, that is 94<para>The top left corner, width and height of the source rectangle, that is
95the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP 95the area actually sampled, is given by the <constant>V4L2_SEL_TGT_CROP</constant>
96</constant> target. It uses the same coordinate system as <constant> 96target. It uses the same coordinate system as <constant>V4L2_SEL_TGT_CROP_BOUNDS</constant>.
97V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie 97The active cropping area must lie completely inside the capture boundaries. The
98completely inside the capture boundaries. The driver may further adjust the 98driver may further adjust the requested size and/or position according to hardware
99requested size and/or position according to hardware limitations.</para> 99limitations.</para>
100 100
101<para>Each capture device has a default source rectangle, given by the 101<para>Each capture device has a default source rectangle, given by the
102<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant> target. This rectangle shall 102<constant>V4L2_SEL_TGT_CROP_DEFAULT</constant> target. This rectangle shall
103over what the driver writer considers the complete picture. Drivers shall set 103over what the driver writer considers the complete picture. Drivers shall set
104the active crop rectangle to the default when the driver is first loaded, but 104the active crop rectangle to the default when the driver is first loaded, but
105not later.</para> 105not later.</para>
106 106
107<para>The composing targets refer to a memory buffer. The limits of composing 107<para>The composing targets refer to a memory buffer. The limits of composing
108coordinates are obtained using <constant> V4L2_SEL_TGT_COMPOSE_BOUNDS 108coordinates are obtained using <constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant>.
109</constant>. All coordinates are expressed in pixels. The rectangle's top/left 109All coordinates are expressed in pixels. The rectangle's top/left
110corner must be located at position <constant> (0,0) </constant>. The width and 110corner must be located at position <constant>(0,0)</constant>. The width and
111height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>. 111height are equal to the image size set by <constant>VIDIOC_S_FMT</constant>.
112</para> 112</para>
113 113
114<para>The part of a buffer into which the image is inserted by the hardware is 114<para>The part of a buffer into which the image is inserted by the hardware is
115controlled by the <constant> V4L2_SEL_TGT_COMPOSE </constant> target. 115controlled by the <constant>V4L2_SEL_TGT_COMPOSE</constant> target.
116The rectangle's coordinates are also expressed in the same coordinate system as 116The rectangle's coordinates are also expressed in the same coordinate system as
117the bounds rectangle. The composing rectangle must lie completely inside bounds 117the bounds rectangle. The composing rectangle must lie completely inside bounds
118rectangle. The driver must adjust the composing rectangle to fit to the 118rectangle. The driver must adjust the composing rectangle to fit to the
119bounding limits. Moreover, the driver can perform other adjustments according 119bounding limits. Moreover, the driver can perform other adjustments according
120to hardware limitations. The application can control rounding behaviour using 120to hardware limitations. The application can control rounding behaviour using
121<link linkend="v4l2-selection-flags"> constraint flags </link>.</para> 121<link linkend="v4l2-selection-flags"> constraint flags</link>.</para>
122 122
123<para>For capture devices the default composing rectangle is queried using 123<para>For capture devices the default composing rectangle is queried using
124<constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the 124<constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant>. It is usually equal to the
125bounding rectangle.</para> 125bounding rectangle.</para>
126 126
127<para>The part of a buffer that is modified by the hardware is given by 127<para>The part of a buffer that is modified by the hardware is given by
128<constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels 128<constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant>. It contains all pixels
129defined using <constant> V4L2_SEL_TGT_COMPOSE </constant> plus all 129defined using <constant>V4L2_SEL_TGT_COMPOSE</constant> plus all
130padding data modified by hardware during insertion process. All pixels outside 130padding data modified by hardware during insertion process. All pixels outside
131this rectangle <emphasis>must not</emphasis> be changed by the hardware. The 131this rectangle <emphasis>must not</emphasis> be changed by the hardware. The
132content of pixels that lie inside the padded area but outside active area is 132content of pixels that lie inside the padded area but outside active area is
@@ -140,52 +140,51 @@ where the rubbish pixels are located and remove them if needed.</para>
140 <title>Configuration of video output</title> 140 <title>Configuration of video output</title>
141 141
142<para>For output devices targets and ioctls are used similarly to the video 142<para>For output devices targets and ioctls are used similarly to the video
143capture case. The <emphasis> composing </emphasis> rectangle refers to the 143capture case. The <emphasis>composing</emphasis> rectangle refers to the
144insertion of an image into a video signal. The cropping rectangles refer to a 144insertion of an image into a video signal. The cropping rectangles refer to a
145memory buffer. It is recommended to configure the composing targets before to 145memory buffer. It is recommended to configure the composing targets before to
146the cropping targets.</para> 146the cropping targets.</para>
147 147
148<para>The cropping targets refer to the memory buffer that contains an image to 148<para>The cropping targets refer to the memory buffer that contains an image to
149be inserted into a video signal or graphical screen. The limits of cropping 149be inserted into a video signal or graphical screen. The limits of cropping
150coordinates are obtained using <constant> V4L2_SEL_TGT_CROP_BOUNDS </constant>. 150coordinates are obtained using <constant>V4L2_SEL_TGT_CROP_BOUNDS</constant>.
151All coordinates are expressed in pixels. The top/left corner is always point 151All coordinates are expressed in pixels. The top/left corner is always point
152<constant> (0,0) </constant>. The width and height is equal to the image size 152<constant>(0,0)</constant>. The width and height is equal to the image size
153specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para> 153specified using <constant>VIDIOC_S_FMT</constant> ioctl.</para>
154 154
155<para>The top left corner, width and height of the source rectangle, that is 155<para>The top left corner, width and height of the source rectangle, that is
156the area from which image date are processed by the hardware, is given by the 156the area from which image date are processed by the hardware, is given by the
157<constant> V4L2_SEL_TGT_CROP </constant>. Its coordinates are expressed 157<constant>V4L2_SEL_TGT_CROP</constant>. Its coordinates are expressed
158in in the same coordinate system as the bounds rectangle. The active cropping 158in in the same coordinate system as the bounds rectangle. The active cropping
159area must lie completely inside the crop boundaries and the driver may further 159area must lie completely inside the crop boundaries and the driver may further
160adjust the requested size and/or position according to hardware 160adjust the requested size and/or position according to hardware
161limitations.</para> 161limitations.</para>
162 162
163<para>For output devices the default cropping rectangle is queried using 163<para>For output devices the default cropping rectangle is queried using
164<constant> V4L2_SEL_TGT_CROP_DEFAULT </constant>. It is usually equal to the 164<constant>V4L2_SEL_TGT_CROP_DEFAULT</constant>. It is usually equal to the
165bounding rectangle.</para> 165bounding rectangle.</para>
166 166
167<para>The part of a video signal or graphics display where the image is 167<para>The part of a video signal or graphics display where the image is
168inserted by the hardware is controlled by <constant> 168inserted by the hardware is controlled by <constant>V4L2_SEL_TGT_COMPOSE</constant>
169V4L2_SEL_TGT_COMPOSE </constant> target. The rectangle's coordinates 169target. The rectangle's coordinates are expressed in pixels. The composing
170are expressed in pixels. The composing rectangle must lie completely inside the 170rectangle must lie completely inside the bounds rectangle. The driver must
171bounds rectangle. The driver must adjust the area to fit to the bounding 171adjust the area to fit to the bounding limits. Moreover, the driver can
172limits. Moreover, the driver can perform other adjustments according to 172perform other adjustments according to hardware limitations.</para>
173hardware limitations. </para> 173
174 174<para>The device has a default composing rectangle, given by the
175<para>The device has a default composing rectangle, given by the <constant> 175<constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant> target. This rectangle shall cover what
176V4L2_SEL_TGT_COMPOSE_DEFAULT </constant> target. This rectangle shall cover what
177the driver writer considers the complete picture. It is recommended for the 176the driver writer considers the complete picture. It is recommended for the
178driver developers to put the top/left corner at position <constant> (0,0) 177driver developers to put the top/left corner at position <constant>(0,0)</constant>.
179</constant>. Drivers shall set the active composing rectangle to the default 178Drivers shall set the active composing rectangle to the default
180one when the driver is first loaded.</para> 179one when the driver is first loaded.</para>
181 180
182<para>The devices may introduce additional content to video signal other than 181<para>The devices may introduce additional content to video signal other than
183an image from memory buffers. It includes borders around an image. However, 182an image from memory buffers. It includes borders around an image. However,
184such a padded area is driver-dependent feature not covered by this document. 183such a padded area is driver-dependent feature not covered by this document.
185Driver developers are encouraged to keep padded rectangle equal to active one. 184Driver developers are encouraged to keep padded rectangle equal to active one.
186The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED 185The padded target is accessed by the <constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant>
187</constant> identifier. It must contain all pixels from the <constant> 186identifier. It must contain all pixels from the <constant>V4L2_SEL_TGT_COMPOSE</constant>
188V4L2_SEL_TGT_COMPOSE </constant> target.</para> 187target.</para>
189 188
190 </section> 189 </section>
191 190
@@ -194,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE </constant> target.</para>
194 <title>Scaling control</title> 193 <title>Scaling control</title>
195 194
196<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
197and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP 196and the height of rectangles obtained using <constant>V4L2_SEL_TGT_CROP</constant>
198</constant> and <constant> V4L2_SEL_TGT_COMPOSE </constant> targets. If 197and <constant>V4L2_SEL_TGT_COMPOSE</constant> targets. If
199these are not equal then the scaling is applied. The application can compute 198these are not equal then the scaling is applied. The application can compute
200the scaling ratios using these values.</para> 199the scaling ratios using these values.</para>
201 200
@@ -208,7 +207,7 @@ the scaling ratios using these values.</para>
208 <title>Comparison with old cropping API</title> 207 <title>Comparison with old cropping API</title>
209 208
210<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
211<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
212devices. Later the cropping API was adopted by video output drivers. The ioctls 211devices. Later the cropping API was adopted by video output drivers. The ioctls
213are used to select a part of the display were the video signal is inserted. It 212are used to select a part of the display were the video signal is inserted. It
214should be considered as an API abuse because the described operation is 213should be considered as an API abuse because the described operation is
@@ -220,7 +219,7 @@ part of an image by abusing V4L2 API. Cropping a smaller image from a larger
220one is achieved by setting the field 219one is achieved by setting the field
221&v4l2-pix-format;<structfield>::bytesperline</structfield>. Introducing an image offsets 220&v4l2-pix-format;<structfield>::bytesperline</structfield>. Introducing an image offsets
222could be done by modifying field &v4l2-buffer;<structfield>::m_userptr</structfield> 221could be done by modifying field &v4l2-buffer;<structfield>::m_userptr</structfield>
223before calling <constant> VIDIOC_QBUF </constant>. Those 222before calling <constant>VIDIOC_QBUF</constant>. Those
224operations should be avoided because they are not portable (endianness), and do 223operations should be avoided because they are not portable (endianness), and do
225not work for macroblock and Bayer formats and mmap buffers. The selection API 224not work for macroblock and Bayer formats and mmap buffers. The selection API
226deals with configuration of buffer cropping/composing in a clear, intuitive and 225deals with configuration of buffer cropping/composing in a clear, intuitive and
@@ -229,7 +228,7 @@ and constraints flags are introduced. Finally, &v4l2-crop; and &v4l2-cropcap;
229have no reserved fields. Therefore there is no way to extend their functionality. 228have no reserved fields. Therefore there is no way to extend their functionality.
230The new &v4l2-selection; provides a lot of place for future 229The new &v4l2-selection; provides a lot of place for future
231extensions. Driver developers are encouraged to implement only selection API. 230extensions. Driver developers are encouraged to implement only selection API.
232The former cropping API would be simulated using the new one. </para> 231The former cropping API would be simulated using the new one.</para>
233 232
234 </section> 233 </section>
235 234
@@ -238,9 +237,9 @@ The former cropping API would be simulated using the new one. </para>
238 <example> 237 <example>
239 <title>Resetting the cropping parameters</title> 238 <title>Resetting the cropping parameters</title>
240 239
241 <para>(A video capture device is assumed; change <constant> 240 <para>(A video capture device is assumed; change
242V4L2_BUF_TYPE_VIDEO_CAPTURE </constant> for other devices; change target to 241<constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant> for other devices; change target to
243<constant> V4L2_SEL_TGT_COMPOSE_* </constant> family to configure composing 242<constant>V4L2_SEL_TGT_COMPOSE_*</constant> family to configure composing
244area)</para> 243area)</para>
245 244
246 <programlisting> 245 <programlisting>
@@ -292,8 +291,8 @@ area)</para>
292 291
293 <example> 292 <example>
294 <title>Querying for scaling factors</title> 293 <title>Querying for scaling factors</title>
295 <para>A video output device is assumed; change <constant> 294 <para>A video output device is assumed; change
296V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para> 295<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> for other devices</para>
297 <programlisting> 296 <programlisting>
298 297
299 &v4l2-selection; compose = { 298 &v4l2-selection; compose = {
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
index b11ec75e21a1..9c04ac8661b1 100644
--- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
@@ -58,17 +58,16 @@
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 &v4l2-selection; 61<para>To query the cropping (composing) rectangle set &v4l2-selection;
62<structfield> type </structfield> field to the respective buffer type. 62<structfield> type </structfield> field to the respective buffer type.
63Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE 63Do not use multiplanar buffers. Use <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>
64</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE 64instead of <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>. Use
65</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of 65<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
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>V4L2_SEL_TGT_COMPOSE</constant>).
69V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref 69Please refer to table <xref linkend="v4l2-selections-common" /> or <xref linkend="selection-api" />
70linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional 70for additional targets. 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 71</structfield> fields of &v4l2-selection; are ignored and they must be filled
73with zeros. The driver fills the rest of the structure or 72with zeros. The driver fills the rest of the structure or
74returns &EINVAL; if incorrect buffer type or target was used. If cropping 73returns &EINVAL; if incorrect buffer type or target was used. If cropping
@@ -77,19 +76,18 @@ always equal to the bounds rectangle. Finally, the &v4l2-rect;
77<structfield>r</structfield> rectangle is filled with the current cropping 76<structfield>r</structfield> rectangle is filled with the current cropping
78(composing) coordinates. The coordinates are expressed in driver-dependent 77(composing) coordinates. The coordinates are expressed in driver-dependent
79units. The only exception are rectangles for images in raw formats, whose 78units. The only exception are rectangles for images in raw formats, whose
80coordinates are always expressed in pixels. </para> 79coordinates are always expressed in pixels.</para>
81 80
82<para> To change the cropping (composing) rectangle set the &v4l2-selection; 81<para>To change the cropping (composing) rectangle set the &v4l2-selection;
83<structfield>type</structfield> field to the respective buffer type. Do not 82<structfield>type</structfield> field to the respective buffer type. Do not
84use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE 83use multiplanar buffers. Use <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE</constant>
85</constant> instead of <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE 84instead of <constant>V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE</constant>. Use
86</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of 85<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT</constant> instead of
87<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is 86<constant>V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE</constant>. The next step is
88setting the value of &v4l2-selection; <structfield>target</structfield> to 87setting the value of &v4l2-selection; <structfield>target</structfield> to
89<constant>V4L2_SEL_TGT_CROP</constant> (<constant> 88<constant>V4L2_SEL_TGT_CROP</constant> (<constant>V4L2_SEL_TGT_COMPOSE</constant>).
90V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref 89Please refer to table <xref linkend="v4l2-selections-common" /> or <xref linkend="selection-api" />
91linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional 90for additional targets. 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 91set to the desired active area. Field &v4l2-selection; <structfield> reserved
94</structfield> is ignored and must be filled with zeros. The driver may adjust 92</structfield> is ignored and must be filled with zeros. The driver may adjust
95coordinates of the requested rectangle. An application may 93coordinates of the requested rectangle. An application may
@@ -149,8 +147,8 @@ On success the &v4l2-rect; <structfield>r</structfield> field contains
149the adjusted rectangle. When the parameters are unsuitable the application may 147the adjusted rectangle. When the parameters are unsuitable the application may
150modify the cropping (composing) or image parameters and repeat the cycle until 148modify the cropping (composing) or image parameters and repeat the cycle until
151satisfactory parameters have been negotiated. If constraints flags have to be 149satisfactory parameters have been negotiated. If constraints flags have to be
152violated at then ERANGE is returned. The error indicates that <emphasis> there 150violated at then ERANGE is returned. The error indicates that <emphasis>there
153exist no rectangle </emphasis> that satisfies the constraints.</para> 151exist no rectangle</emphasis> that satisfies the constraints.</para>
154 152
155 <para>Selection targets and flags are documented in <xref 153 <para>Selection targets and flags are documented in <xref
156 linkend="v4l2-selections-common"/>.</para> 154 linkend="v4l2-selections-common"/>.</para>