From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-media@vger.kernel.org, m.chehab@samsung.com,
laurent.pinchart@ideasonboard.com, t.stanislaws@samsung.com,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv2 PATCH 19/21] DocBook media: update VIDIOC_G/S/TRY_EXT_CTRLS.
Date: Thu, 23 Jan 2014 15:16:13 +0100 [thread overview]
Message-ID: <52E1242D.7040508@xs4all.nl> (raw)
In-Reply-To: <52E11D34.4050300@samsung.com>
On 01/23/2014 02:46 PM, Sylwester Nawrocki wrote:
> On 20/01/14 13:46, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> ---
>> .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 43 ++++++++++++++++++----
>> 1 file changed, 35 insertions(+), 8 deletions(-)
>>
>> diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
>> index b3bb957..bb383b9 100644
>> --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
>> +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml
>> @@ -72,23 +72,30 @@ initialize the <structfield>id</structfield>,
>> <structfield>size</structfield> and <structfield>reserved2</structfield> fields
>> of each &v4l2-ext-control; and call the
>> <constant>VIDIOC_G_EXT_CTRLS</constant> ioctl. String controls controls
>> -must also set the <structfield>string</structfield> field.</para>
>> +must also set the <structfield>string</structfield> field. Controls
>> +of complex types (<constant>V4L2_CTRL_FLAG_IS_PTR</constant> is set)
>> +must set the <structfield>p</structfield> field.</para>
>>
>> <para>If the <structfield>size</structfield> is too small to
>> receive the control result (only relevant for pointer-type controls
>> like strings), then the driver will set <structfield>size</structfield>
>> to a valid value and return an &ENOSPC;. You should re-allocate the
>> -string memory to this new size and try again. It is possible that the
>> -same issue occurs again if the string has grown in the meantime. It is
>> +memory to this new size and try again. For the string type it is possible that
>> +the same issue occurs again if the string has grown in the meantime. It is
>> recommended to call &VIDIOC-QUERYCTRL; first and use
>> <structfield>maximum</structfield>+1 as the new <structfield>size</structfield>
>> value. It is guaranteed that that is sufficient memory.
>> </para>
>>
>> + <para>For matrices it is possible to only get the first <constant>X</constant>
>> +elements by setting size to <constant>X * elem_size</constant>, where
>> +<structfield>elem_size</structfield> is obtained by calling &VIDIOC-QUERY-EXT-CTRL;.
>> +Matrix elements are returned row-by-row.</para>
>> +
>> <para>To change the value of a set of controls applications
>> initialize the <structfield>id</structfield>, <structfield>size</structfield>,
>> <structfield>reserved2</structfield> and
>> -<structfield>value/string</structfield> fields of each &v4l2-ext-control; and
>> +<structfield>value/value64/string/p</structfield> fields of each &v4l2-ext-control; and
>> call the <constant>VIDIOC_S_EXT_CTRLS</constant> ioctl. The controls
>> will only be set if <emphasis>all</emphasis> control values are
>> valid.</para>
>> @@ -96,11 +103,17 @@ valid.</para>
>> <para>To check if a set of controls have correct values applications
>> initialize the <structfield>id</structfield>, <structfield>size</structfield>,
>> <structfield>reserved2</structfield> and
>> -<structfield>value/string</structfield> fields of each &v4l2-ext-control; and
>> +<structfield>value/value64/string/p</structfield> fields of each &v4l2-ext-control; and
>> call the <constant>VIDIOC_TRY_EXT_CTRLS</constant> ioctl. It is up to
>> the driver whether wrong values are automatically adjusted to a valid
>> value or if an error is returned.</para>
>>
>> + <para>For matrices it is possible to only set or check only the first
>> +<constant>X</constant> elements by setting size to <constant>X * elem_size</constant>,
>> +where <structfield>elem_size</structfield> is obtained by calling &VIDIOC-QUERY-EXT-CTRL;.
>> +Matrix elements are set row-by-row. Matrix elements that are not explicitly
>> +set will be initialized to their default value.</para>
>
> Presumably this could be more problematic than leaving the remaining part
> of the matrix unchanged. I assume this paragraph is going to be removed ?
Yes, that's going away.
Regards,
Hans
>
>> <para>When the <structfield>id</structfield> or
>> <structfield>ctrl_class</structfield> is invalid drivers return an
>> &EINVAL;. When the value is out of bounds drivers can choose to take
>> @@ -158,19 +171,33 @@ applications must set the array to zero.</entry>
>> <entry></entry>
>> <entry>__s32</entry>
>> <entry><structfield>value</structfield></entry>
>> - <entry>New value or current value.</entry>
>> + <entry>New value or current value. Valid if this control is not of
>> +type <constant>V4L2_CTRL_TYPE_INTEGER64</constant> and
>> +<constant>V4L2_CTRL_FLAG_IS_PTR</constant> is not set.</entry>
>> </row>
>> <row>
>> <entry></entry>
>> <entry>__s64</entry>
>> <entry><structfield>value64</structfield></entry>
>> - <entry>New value or current value.</entry>
>> + <entry>New value or current value. Valid if this control is of
>> +type <constant>V4L2_CTRL_TYPE_INTEGER64</constant> and
>> +<constant>V4L2_CTRL_FLAG_IS_PTR</constant> is not set.</entry>
>> </row>
>> <row>
>> <entry></entry>
>> <entry>char *</entry>
>> <entry><structfield>string</structfield></entry>
>> - <entry>A pointer to a string.</entry>
>> + <entry>A pointer to a string. Valid if this control is of
>> +type <constant>V4L2_CTRL_TYPE_STRING</constant>.</entry>
>> + </row>
>> + <row>
>> + <entry></entry>
>> + <entry>void *</entry>
>> + <entry><structfield>p</structfield></entry>
>> + <entry>A pointer to a complex type which can be a matrix and/or a
>> +complex type (the control's type is >= <constant>V4L2_CTRL_COMPLEX_TYPES</constant>).
>> +Valid if <constant>V4L2_CTRL_FLAG_IS_PTR</constant> is set for this control.
>> +</entry>
>> </row>
>> </tbody>
>> </tgroup>
>
> --
> Regards,
> Sylwester
>
next prev parent reply other threads:[~2014-01-23 14:16 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-20 12:45 [RFCv2 PATCH 00/21] Add support for complex controls Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 01/21] v4l2-ctrls: increase internal min/max/step/def to 64 bit Hans Verkuil
2014-01-22 22:45 ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 02/21] v4l2-ctrls: add unit string Hans Verkuil
2014-01-22 22:47 ` Sylwester Nawrocki
2014-01-24 10:35 ` Sakari Ailus
2014-01-24 11:19 ` Hans Verkuil
2014-01-24 15:54 ` Sakari Ailus
2014-01-25 9:00 ` Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 03/21] v4l2-ctrls: use pr_info/cont instead of printk Hans Verkuil
2014-01-22 22:48 ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 04/21] videodev2.h: add initial support for complex controls Hans Verkuil
2014-01-22 22:55 ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 05/21] videodev2.h: add struct v4l2_query_ext_ctrl and VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-22 23:02 ` Sylwester Nawrocki
2014-01-23 14:23 ` Hans Verkuil
2014-01-23 15:05 ` Sylwester Nawrocki
2014-01-24 11:28 ` Sakari Ailus
2014-01-24 11:58 ` Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 06/21] v4l2-ctrls: add support for complex types Hans Verkuil
2014-01-23 11:44 ` Sylwester Nawrocki
2014-01-24 15:44 ` Sakari Ailus
2014-01-25 8:50 ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 07/21] v4l2: integrate support for VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-23 11:44 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 08/21] v4l2-ctrls: create type_ops Hans Verkuil
2014-01-23 14:23 ` Sylwester Nawrocki
2014-01-24 15:46 ` Sakari Ailus
2014-01-25 8:54 ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 09/21] v4l2-ctrls: rewrite copy routines to operate on union v4l2_ctrl_ptr Hans Verkuil
2014-01-24 12:31 ` Sakari Ailus
2014-01-24 12:44 ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 10/21] v4l2-ctrls: compare values only once Hans Verkuil
2014-01-23 14:30 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 11/21] v4l2-ctrls: prepare for matrix support: add cols & rows fields Hans Verkuil
2014-01-23 13:46 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 12/21] v4l2-ctrls: replace cur by a union v4l2_ctrl_ptr Hans Verkuil
2014-01-23 15:47 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 13/21] v4l2-ctrls: use 'new' to access pointer controls Hans Verkuil
2014-01-23 17:06 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 14/21] v4l2-ctrls: prepare for matrix support Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 15/21] v4l2-ctrls: type_ops can handle matrix elements Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 16/21] v4l2-ctrls: add matrix support Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 17/21] v4l2-ctrls.c: return elem_size instead of strlen Hans Verkuil
2014-01-23 13:46 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 18/21] DocBook media: document VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-23 17:24 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 19/21] DocBook media: update VIDIOC_G/S/TRY_EXT_CTRLS Hans Verkuil
2014-01-23 13:46 ` Sylwester Nawrocki
2014-01-23 14:16 ` Hans Verkuil [this message]
2014-01-20 12:46 ` [RFCv2 PATCH 20/21] DocBook media: update control section Hans Verkuil
2014-01-23 15:34 ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 21/21] v4l2-controls.txt: update to the new way of accessing controls Hans Verkuil
2014-01-23 15:50 ` Sylwester Nawrocki
2014-01-22 22:44 ` [RFCv2 PATCH 00/21] Add support for complex controls Sylwester Nawrocki
2014-01-23 11:49 ` Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52E1242D.7040508@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hans.verkuil@cisco.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=t.stanislaws@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.