aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-06-10 06:21:04 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-17 10:57:21 -0400
commit715bfb3e1f0ca0f6c6bd7805d90f31325fb61b72 (patch)
tree6f0d688ba23592e71a90cf4a8e189a9a0252938a /Documentation/DocBook
parent40265bbe42933920684136ff759e6340eaf72774 (diff)
[media] DocBook media: document VIDIOC_QUERY_EXT_CTRL
Document the new VIDIOC_QUERY_EXT_CTRL ioctl. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-queryctrl.xml211
1 files changed, 175 insertions, 36 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
index e6645b996558..04589e53f38b 100644
--- a/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-queryctrl.xml
@@ -1,11 +1,12 @@
1<refentry id="vidioc-queryctrl"> 1<refentry id="vidioc-queryctrl">
2 <refmeta> 2 <refmeta>
3 <refentrytitle>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</refentrytitle> 3 <refentrytitle>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL, VIDIOC_QUERYMENU</refentrytitle>
4 &manvol; 4 &manvol;
5 </refmeta> 5 </refmeta>
6 6
7 <refnamediv> 7 <refnamediv>
8 <refname>VIDIOC_QUERYCTRL</refname> 8 <refname>VIDIOC_QUERYCTRL</refname>
9 <refname>VIDIOC_QUERY_EXT_CTRL</refname>
9 <refname>VIDIOC_QUERYMENU</refname> 10 <refname>VIDIOC_QUERYMENU</refname>
10 <refpurpose>Enumerate controls and menu control items</refpurpose> 11 <refpurpose>Enumerate controls and menu control items</refpurpose>
11 </refnamediv> 12 </refnamediv>
@@ -24,6 +25,14 @@
24 <funcdef>int <function>ioctl</function></funcdef> 25 <funcdef>int <function>ioctl</function></funcdef>
25 <paramdef>int <parameter>fd</parameter></paramdef> 26 <paramdef>int <parameter>fd</parameter></paramdef>
26 <paramdef>int <parameter>request</parameter></paramdef> 27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>struct v4l2_query_ext_ctrl *<parameter>argp</parameter></paramdef>
29 </funcprototype>
30 </funcsynopsis>
31 <funcsynopsis>
32 <funcprototype>
33 <funcdef>int <function>ioctl</function></funcdef>
34 <paramdef>int <parameter>fd</parameter></paramdef>
35 <paramdef>int <parameter>request</parameter></paramdef>
27 <paramdef>struct v4l2_querymenu *<parameter>argp</parameter></paramdef> 36 <paramdef>struct v4l2_querymenu *<parameter>argp</parameter></paramdef>
28 </funcprototype> 37 </funcprototype>
29 </funcsynopsis> 38 </funcsynopsis>
@@ -42,7 +51,7 @@
42 <varlistentry> 51 <varlistentry>
43 <term><parameter>request</parameter></term> 52 <term><parameter>request</parameter></term>
44 <listitem> 53 <listitem>
45 <para>VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU</para> 54 <para>VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL, VIDIOC_QUERYMENU</para>
46 </listitem> 55 </listitem>
47 </varlistentry> 56 </varlistentry>
48 <varlistentry> 57 <varlistentry>
@@ -89,9 +98,23 @@ prematurely end the enumeration).</para></footnote></para>
89 98
90 <para>When the application ORs <structfield>id</structfield> with 99 <para>When the application ORs <structfield>id</structfield> with
91<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver returns the 100<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver returns the
92next supported control, or <errorcode>EINVAL</errorcode> if there is 101next supported non-compound control, or <errorcode>EINVAL</errorcode>
93none. Drivers which do not support this flag yet always return 102if there is none. In addition, the <constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant>
94<errorcode>EINVAL</errorcode>.</para> 103flag can be specified to enumerate all compound controls (i.e. controls
104with type &ge; <constant>V4L2_CTRL_COMPOUND_TYPES</constant>). Specify both
105<constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> and
106<constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant> in order to enumerate
107all controls, compound or not. Drivers which do not support these flags yet
108always return <errorcode>EINVAL</errorcode>.</para>
109
110 <para>The <constant>VIDIOC_QUERY_EXT_CTRL</constant> ioctl was
111introduced in order to better support controls that can use compound
112types, and to expose additional control information that cannot be
113returned in &v4l2-queryctrl; since that structure is full.</para>
114
115 <para><constant>VIDIOC_QUERY_EXT_CTRL</constant> is used in the
116same way as <constant>VIDIOC_QUERYCTRL</constant>, except that the
117<structfield>reserved</structfield> array must be zeroed as well.</para>
95 118
96 <para>Additional information is required for menu controls: the 119 <para>Additional information is required for menu controls: the
97names of the menu items. To query them applications set the 120names of the menu items. To query them applications set the
@@ -142,38 +165,23 @@ string. This information is intended for the user.</entry>
142 <entry>__s32</entry> 165 <entry>__s32</entry>
143 <entry><structfield>minimum</structfield></entry> 166 <entry><structfield>minimum</structfield></entry>
144 <entry>Minimum value, inclusive. This field gives a lower 167 <entry>Minimum value, inclusive. This field gives a lower
145bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the 168bound for the control. See &v4l2-ctrl-type; how the minimum value is to
146lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. 169be used for each possible control type. Note that this a signed 32-bit value.</entry>
147For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value
148gives the minimum length of the string. This length <emphasis>does not include the terminating
149zero</emphasis>. It may not be valid for any other type of control, including
150<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
151signed value.</entry>
152 </row> 170 </row>
153 <row> 171 <row>
154 <entry>__s32</entry> 172 <entry>__s32</entry>
155 <entry><structfield>maximum</structfield></entry> 173 <entry><structfield>maximum</structfield></entry>
156 <entry>Maximum value, inclusive. This field gives an upper 174 <entry>Maximum value, inclusive. This field gives an upper
157bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the 175bound for the control. See &v4l2-ctrl-type; how the maximum value is to
158highest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> 176be used for each possible control type. Note that this a signed 32-bit value.</entry>
159controls. For <constant>V4L2_CTRL_TYPE_BITMASK</constant> controls it is the
160set of usable bits.
161For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the maximum value
162gives the maximum length of the string. This length <emphasis>does not include the terminating
163zero</emphasis>. It may not be valid for any other type of control, including
164<constant>V4L2_CTRL_TYPE_INTEGER64</constant> controls. Note that this is a
165signed value.</entry>
166 </row> 177 </row>
167 <row> 178 <row>
168 <entry>__s32</entry> 179 <entry>__s32</entry>
169 <entry><structfield>step</structfield></entry> 180 <entry><structfield>step</structfield></entry>
170 <entry><para>This field gives a step size for 181 <entry><para>This field gives a step size for the control.
171<constant>V4L2_CTRL_TYPE_INTEGER</constant> controls. For 182See &v4l2-ctrl-type; how the step value is to be used for each possible
172<constant>V4L2_CTRL_TYPE_STRING</constant> controls this field refers to 183control type. Note that this an unsigned 32-bit value.
173the string length that has to be a multiple of this step size. 184</para><para>Generally drivers should not scale hardware
174It may not be valid for any other type of control, including
175<constant>V4L2_CTRL_TYPE_INTEGER64</constant>
176controls.</para><para>Generally drivers should not scale hardware
177control values. It may be necessary for example when the 185control values. It may be necessary for example when the
178<structfield>name</structfield> or <structfield>id</structfield> imply 186<structfield>name</structfield> or <structfield>id</structfield> imply
179a particular unit and the hardware actually accepts only multiples of 187a particular unit and the hardware actually accepts only multiples of
@@ -192,10 +200,11 @@ be always positive.</para></entry>
192 <entry><structfield>default_value</structfield></entry> 200 <entry><structfield>default_value</structfield></entry>
193 <entry>The default value of a 201 <entry>The default value of a
194<constant>V4L2_CTRL_TYPE_INTEGER</constant>, 202<constant>V4L2_CTRL_TYPE_INTEGER</constant>,
195<constant>_BOOLEAN</constant> or <constant>_MENU</constant> control. 203<constant>_BOOLEAN</constant>, <constant>_BITMASK</constant>,
196Not valid for other types of controls. Drivers reset controls only 204<constant>_MENU</constant> or <constant>_INTEGER_MENU</constant> control.
197when the driver is loaded, not later, in particular not when the 205Not valid for other types of controls.
198func-open; is called.</entry> 206Note that drivers reset controls to their default value only when the
207driver is first loaded, never afterwards.</entry>
199 </row> 208 </row>
200 <row> 209 <row>
201 <entry>__u32</entry> 210 <entry>__u32</entry>
@@ -213,6 +222,125 @@ the array to zero.</entry>
213 </tgroup> 222 </tgroup>
214 </table> 223 </table>
215 224
225 <table pgwide="1" frame="none" id="v4l2-query-ext-ctrl">
226 <title>struct <structname>v4l2_query_ext_ctrl</structname></title>
227 <tgroup cols="3">
228 &cs-str;
229 <tbody valign="top">
230 <row>
231 <entry>__u32</entry>
232 <entry><structfield>id</structfield></entry>
233 <entry>Identifies the control, set by the application. See
234<xref linkend="control-id" /> for predefined IDs. When the ID is ORed
235with <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver clears the
236flag and returns the first non-compound control with a higher ID. When the
237ID is ORed with <constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant> the driver
238clears the flag and returns the first compound control with a higher ID.
239Set both to get the first control (compound or not) with a higher ID.</entry>
240 </row>
241 <row>
242 <entry>__u32</entry>
243 <entry><structfield>type</structfield></entry>
244 <entry>Type of control, see <xref
245 linkend="v4l2-ctrl-type" />.</entry>
246 </row>
247 <row>
248 <entry>char</entry>
249 <entry><structfield>name</structfield>[32]</entry>
250 <entry>Name of the control, a NUL-terminated ASCII
251string. This information is intended for the user.</entry>
252 </row>
253 <row>
254 <entry>__s64</entry>
255 <entry><structfield>minimum</structfield></entry>
256 <entry>Minimum value, inclusive. This field gives a lower
257bound for the control. See &v4l2-ctrl-type; how the minimum value is to
258be used for each possible control type. Note that this a signed 64-bit value.</entry>
259 </row>
260 <row>
261 <entry>__s64</entry>
262 <entry><structfield>maximum</structfield></entry>
263 <entry>Maximum value, inclusive. This field gives an upper
264bound for the control. See &v4l2-ctrl-type; how the maximum value is to
265be used for each possible control type. Note that this a signed 64-bit value.</entry>
266 </row>
267 <row>
268 <entry>__u64</entry>
269 <entry><structfield>step</structfield></entry>
270 <entry><para>This field gives a step size for the control.
271See &v4l2-ctrl-type; how the step value is to be used for each possible
272control type. Note that this an unsigned 64-bit value.
273</para><para>Generally drivers should not scale hardware
274control values. It may be necessary for example when the
275<structfield>name</structfield> or <structfield>id</structfield> imply
276a particular unit and the hardware actually accepts only multiples of
277said unit. If so, drivers must take care values are properly rounded
278when scaling, such that errors will not accumulate on repeated
279read-write cycles.</para><para>This field gives the smallest change of
280an integer control actually affecting hardware. Often the information
281is needed when the user can change controls by keyboard or GUI
282buttons, rather than a slider. When for example a hardware register
283accepts values 0-511 and the driver reports 0-65535, step should be
284128.</para></entry>
285 </row>
286 <row>
287 <entry>__s64</entry>
288 <entry><structfield>default_value</structfield></entry>
289 <entry>The default value of a
290<constant>V4L2_CTRL_TYPE_INTEGER</constant>, <constant>_INTEGER64</constant>,
291<constant>_BOOLEAN</constant>, <constant>_BITMASK</constant>,
292<constant>_MENU</constant> or <constant>_INTEGER_MENU</constant> control.
293Not valid for other types of controls.
294Note that drivers reset controls to their default value only when the
295driver is first loaded, never afterwards.
296</entry>
297 </row>
298 <row>
299 <entry>__u32</entry>
300 <entry><structfield>flags</structfield></entry>
301 <entry>Control flags, see <xref
302 linkend="control-flags" />.</entry>
303 </row>
304 <row>
305 <entry>__u32</entry>
306 <entry><structfield>elem_size</structfield></entry>
307 <entry>The size in bytes of a single element of the array.
308Given a char pointer <constant>p</constant> to a 3-dimensional array you can find the
309position of cell <constant>(z, y, x)</constant> as follows:
310<constant>p + ((z * dims[1] + y) * dims[0] + x) * elem_size</constant>. <structfield>elem_size</structfield>
311is always valid, also when the control isn't an array. For string controls
312<structfield>elem_size</structfield> is equal to <structfield>maximum + 1</structfield>.
313</entry>
314 </row>
315 <row>
316 <entry>__u32</entry>
317 <entry><structfield>elems</structfield></entry>
318 <entry>The number of elements in the N-dimensional array. If this control
319is not an array, then <structfield>elems</structfield> is 1. The <structfield>elems</structfield>
320field can never be 0.</entry>
321 </row>
322 <row>
323 <entry>__u32</entry>
324 <entry><structfield>nr_of_dims</structfield></entry>
325 <entry>The number of dimension in the N-dimensional array. If this control
326is not an array, then this field is 0.</entry>
327 </row>
328 <row>
329 <entry>__u32</entry>
330 <entry><structfield>dims[V4L2_CTRL_MAX_DIMS]</structfield></entry>
331 <entry>The size of each dimension. The first <structfield>nr_of_dims</structfield>
332elements of this array must be non-zero, all remaining elements must be zero.</entry>
333 </row>
334 <row>
335 <entry>__u32</entry>
336 <entry><structfield>reserved</structfield>[32]</entry>
337 <entry>Reserved for future extensions. Applications and drivers
338must set the array to zero.</entry>
339 </row>
340 </tbody>
341 </tgroup>
342 </table>
343
216 <table pgwide="1" frame="none" id="v4l2-querymenu"> 344 <table pgwide="1" frame="none" id="v4l2-querymenu">
217 <title>struct <structname>v4l2_querymenu</structname></title> 345 <title>struct <structname>v4l2_querymenu</structname></title>
218 <tgroup cols="4"> 346 <tgroup cols="4">
@@ -347,11 +475,14 @@ Drivers must ignore the value passed with
347 </row> 475 </row>
348 <row> 476 <row>
349 <entry><constant>V4L2_CTRL_TYPE_INTEGER64</constant></entry> 477 <entry><constant>V4L2_CTRL_TYPE_INTEGER64</constant></entry>
350 <entry>n/a</entry> 478 <entry>any</entry>
351 <entry>n/a</entry> 479 <entry>any</entry>
352 <entry>n/a</entry> 480 <entry>any</entry>
353 <entry>A 64-bit integer valued control. Minimum, maximum 481 <entry>A 64-bit integer valued control. Minimum, maximum
354and step size cannot be queried.</entry> 482and step size cannot be queried using <constant>VIDIOC_QUERYCTRL</constant>.
483Only <constant>VIDIOC_QUERY_EXT_CTRL</constant> can retrieve the 64-bit
484min/max/step values, they should be interpreted as n/a when using
485<constant>VIDIOC_QUERYCTRL</constant>.</entry>
355 </row> 486 </row>
356 <row> 487 <row>
357 <entry><constant>V4L2_CTRL_TYPE_STRING</constant></entry> 488 <entry><constant>V4L2_CTRL_TYPE_STRING</constant></entry>
@@ -450,6 +581,14 @@ is in auto-gain mode. In such a case the hardware calculates the gain value base
450the lighting conditions which can change over time. Note that setting a new value for 581the lighting conditions which can change over time. Note that setting a new value for
451a volatile control will have no effect. The new value will just be ignored.</entry> 582a volatile control will have no effect. The new value will just be ignored.</entry>
452 </row> 583 </row>
584 <row>
585 <entry><constant>V4L2_CTRL_FLAG_HAS_PAYLOAD</constant></entry>
586 <entry>0x0100</entry>
587 <entry>This control has a pointer type, so its value has to be accessed
588using one of the pointer fields of &v4l2-ext-control;. This flag is set for controls
589that are an array, string, or have a compound type. In all cases you have to set a
590pointer to memory containing the payload of the control.</entry>
591 </row>
453 </tbody> 592 </tbody>
454 </tgroup> 593 </tgroup>
455 </table> 594 </table>