diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-09-11 11:38:51 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-21 01:05:56 -0200 |
commit | 6756207a71a0f976ab027186d0966a2162aaf922 (patch) | |
tree | b86d48d98e27d25b313be6759aabde5c81a640c3 /Documentation/DocBook | |
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/DocBook')
-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 68c83449d7c9..2fae3e87ce73 100644 --- a/Documentation/DocBook/v4l/controls.xml +++ b/Documentation/DocBook/v4l/controls.xml @@ -364,9 +364,6 @@ enumerate_menu (void) querymenu.index++) { if (0 == ioctl (fd, &VIDIOC-QUERYMENU;, &querymenu)) { printf (" %s\n", querymenu.name); - } else { - perror ("VIDIOC_QUERYMENU"); - exit (EXIT_FAILURE); } } } diff --git a/Documentation/DocBook/v4l/vidioc-queryctrl.xml b/Documentation/DocBook/v4l/vidioc-queryctrl.xml index 8e0e055ac934..0d5e8283cf32 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 <structfield>index</structfield> is invalid. Menu items are enumerated by calling <constant>VIDIOC_QUERYMENU</constant> with successive <structfield>index</structfield> values from &v4l2-queryctrl; -<structfield>minimum</structfield> (0) to -<structfield>maximum</structfield>, inclusive.</para> +<structfield>minimum</structfield> to +<structfield>maximum</structfield>, inclusive. Note that it is possible +for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some +indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>. +In that case that particular menu item is not supported by this driver. Also note that +the <structfield>minimum</structfield> value is not necessarily 0.</para> <para>See also the examples in <xref linkend="control" />.</para> @@ -139,7 +143,7 @@ string. This information is intended for the user.</entry> <entry><structfield>minimum</structfield></entry> <entry>Minimum value, inclusive. This field gives a lower bound for <constant>V4L2_CTRL_TYPE_INTEGER</constant> controls and the -lowest valid index (always 0) for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. +lowest valid index for <constant>V4L2_CTRL_TYPE_MENU</constant> controls. For <constant>V4L2_CTRL_TYPE_STRING</constant> controls the minimum value gives the minimum length of the string. This length <emphasis>does not include the terminating 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> </row> <row> <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry> - <entry>0</entry> + <entry>≥ 0</entry> <entry>1</entry> <entry>N-1</entry> <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 <term><errorcode>EINVAL</errorcode></term> <listitem> <para>The &v4l2-queryctrl; <structfield>id</structfield> -is invalid. The &v4l2-querymenu; <structfield>id</structfield> or -<structfield>index</structfield> is invalid.</para> +is invalid. The &v4l2-querymenu; <structfield>id</structfield> is +invalid or <structfield>index</structfield> is out of range (less than +<structfield>minimum</structfield> or greater than <structfield>maximum</structfield>) +or this particular menu item is not supported by the driver.</para> </listitem> </varlistentry> <varlistentry> |