diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-09-11 10:38:51 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:05:56 -0400 |
commit | 6756207a71a0f976ab027186d0966a2162aaf922 (patch) | |
tree | b86d48d98e27d25b313be6759aabde5c81a640c3 /Documentation | |
parent | 0827d0664dfa046dc9359c1a45f613d916431ed7 (diff) |
V4L/DVB: V4L Doc: correct the documentation for VIDIOC_QUERYMENU
The VIDIOC_QUERYMENU documentation was not correct. EINVAL can be returned
if the driver does not support some of the menu items. I.e. in a list of
MPEG bitrates a driver generally supports only a subset of these.
This behavior has been in place for years, but was never properly documented.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/v4l/controls.xml | 3 | ||||
-rw-r--r-- | Documentation/DocBook/v4l/vidioc-queryctrl.xml | 18 |
2 files changed, 12 insertions, 9 deletions
diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml index 68c83449d7c..2fae3e87ce7 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml | |||
@@ -364,9 +364,6 @@ enumerate_menu (void) | |||
364 | querymenu.index++) { | 364 | querymenu.index++) { |
365 | if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &querymenu)) { | 365 | if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &querymenu)) { |
366 | printf (" %s\n", querymenu.name); | 366 | printf (" %s\n", querymenu.name); |
367 | } else { | ||
368 | perror ("VIDIOC_QUERYMENU"); | ||
369 | exit (EXIT_FAILURE); | ||
370 | } | 367 | } |
371 | } | 368 | } |
372 | } | 369 | } |
diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml index 8e0e055ac93..0d5e8283cf3 100644 --- a/Documentation/DocBook/v4l/vidioc-queryctrl.xml +++ b/Documentation/DocBook/v4l/vidioc-queryctrl.xml | |||
@@ -103,8 +103,12 @@ structure. The driver fills the rest of the structure or returns an | |||
103 | <structfield>index</structfield> is invalid. Menu items are enumerated | 103 | <structfield>index</structfield> is invalid. Menu items are enumerated |
104 | by calling <constant>VIDIOC_QUERYMENU</constant> with successive | 104 | by calling <constant>VIDIOC_QUERYMENU</constant> with successive |
105 | <structfield>index</structfield> values from &v4l2-queryctrl; | 105 | <structfield>index</structfield> values from &v4l2-queryctrl; |
106 | <structfield>minimum</structfield> (0) to | 106 | <structfield>minimum</structfield> to |
107 | <structfield>maximum</structfield>, inclusive.</para> | 107 | <structfield>maximum</structfield>, inclusive. Note that it is possible |
108 | for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some | ||
109 | indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>. | ||
110 | In that case that particular menu item is not supported by this driver. Also note that | ||
111 | the <structfield>minimum</structfield> value is not necessarily 0.</para> | ||
108 | 112 | ||
109 | <para>See also the examples in <xref linkend="control" />.</para> | 113 | <para>See also the examples in <xref linkend="control" />.</para> |
110 | 114 | ||
@@ -139,7 +143,7 @@ string. This information is intended for the user.</entry> | |||
139 | <entry><structfield>minimum</structfield></entry> | 143 | <entry><structfield>minimum</structfield></entry> |
140 | <entry>Minimum value, inclusive. This field gives a lower | 144 | <entry>Minimum value, inclusive. This field gives a lower |
141 | bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the | 145 | bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the |
142 | lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. | 146 | lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. |
143 | For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value | 147 | For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value |
144 | gives the minimum length of the string. This length <emphasis>does not include the terminating | 148 | gives the minimum length of the string. This length <emphasis>does not include the terminating |
145 | zero</emphasis>. It may not be valid for any other type of control, including | 149 | zero</emphasis>. It may not be valid for any other type of control, including |
@@ -279,7 +283,7 @@ values which are actually different on the hardware.</entry> | |||
279 | </row> | 283 | </row> |
280 | <row> | 284 | <row> |
281 | <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> | 285 | <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> |
282 | <entry>0</entry> | 286 | <entry>≥ 0</entry> |
283 | <entry>1</entry> | 287 | <entry>1</entry> |
284 | <entry>N-1</entry> | 288 | <entry>N-1</entry> |
285 | <entry>The control has a menu of N choices. The names of | 289 | <entry>The control has a menu of N choices. The names of |
@@ -405,8 +409,10 @@ writing a value will cause the device to carry out a given action | |||
405 | <term><errorcode>EINVAL</errorcode></term> | 409 | <term><errorcode>EINVAL</errorcode></term> |
406 | <listitem> | 410 | <listitem> |
407 | <para>The &v4l2-queryctrl; <structfield>id</structfield> | 411 | <para>The &v4l2-queryctrl; <structfield>id</structfield> |
408 | is invalid. The &v4l2-querymenu; <structfield>id</structfield> or | 412 | is invalid. The &v4l2-querymenu; <structfield>id</structfield> is |
409 | <structfield>index</structfield> is invalid.</para> | 413 | invalid or <structfield>index</structfield> is out of range (less than |
414 | <structfield>minimum</structfield> or greater than <structfield>maximum</structfield>) | ||
415 | or this particular menu item is not supported by the driver.</para> | ||
410 | </listitem> | 416 | </listitem> |
411 | </varlistentry> | 417 | </varlistentry> |
412 | <varlistentry> | 418 | <varlistentry> |