All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Cc: linux-media@vger.kernel.org, m.chehab@samsung.com,
	laurent.pinchart@ideasonboard.com, t.stanislaws@samsung.com
Subject: Re: [RFCv2 PATCH 00/21] Add support for complex controls
Date: Thu, 23 Jan 2014 12:49:42 +0100	[thread overview]
Message-ID: <52E101D6.4010109@xs4all.nl> (raw)
In-Reply-To: <52E049DA.7010603@gmail.com>

On 01/22/14 23:44, Sylwester Nawrocki wrote:
> Hello Hans,
> 
> On 01/20/2014 01:45 PM, Hans Verkuil wrote:
>> This patch series adds support for complex controls (aka 'Properties') to
>> the control framework. It is the first part of a larger patch series that
>> adds support for configuration stores, motion detection matrix controls and
>> support for 'Multiple Selections'.
>>
>> This patch series is based on this RFC:
>>
>> http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/71822
>>
>> A more complete patch series (including configuration store support and the
>> motion detection work) can be found here:
>>
>> http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/propapi-doc
>>
>> This patch series is a revision of this series:
>>
>> http://www.spinics.net/lists/linux-media/msg71281.html
>>
>> Changes since RFCv1 are:
>>
>> - dropped configuration store support for now (there is no driver at the moment
>>    that needs it).
>> - dropped the term 'property', instead call it a 'control with a complex type'
>>    or 'complex control' for short.
>> - added DocBook documentation.
>>
>> The API changes required to support complex controls are minimal:
>>
>> - A new V4L2_CTRL_FLAG_HIDDEN has been added: any control with this flag (and
>>    complex controls will always have this flag) will never be shown by control
>>    panel GUIs. The only way to discover them is to pass the new _FLAG_NEXT_HIDDEN
>>    flag to QUERYCTRL.
> 
> I had issues with using _HIDDEN for this at first but after thinking a bit more
> it seems sensible.
> 
>> - A new VIDIOC_QUERY_EXT_CTRL ioctl has been added: needed to get the number of elements
>>    stored in the control (rows by columns) and the size in byte of each element.
>>    As a bonus feature a unit string has also been added as this has been requested
>>    in the past. In addition min/max/step/def values are now 64-bit.
>>
>> - A new 'p' field is added to struct v4l2_ext_control to set/get complex values.
>>
>> - A helper flag V4L2_CTRL_FLAG_IS_PTR has been added to tell apps whether the
>>    'value' or 'value64' fields of the v4l2_ext_control struct can be used (bit
>>    is cleared) or if the 'p' pointer can be used (bit it set).
>>
>> There is one open item: if a complex control is a matrix, then it is possible
>> to set only the first N elements of that matrix (starting at the first row).
>> Currently the API will initialize the remaining elements to their default
>> value. The idea was that if you have an array of, say, selection
>> rectangles, then if you just set the first one the others will be automatically
>> zeroed (i.e. set to unused). Without that you would be forced to set the whole
>> array unless you are certain that they are already zeroed.
>>
>> It also has the advantage that when you set a control you know that all elements
>> are set, even if you don't specify them all.
>>
>> Should I support the ability to set only the first N elements of a matrix at all?
>>
>> I see three options:
>>
>> 1) allow getting/setting only the first N elements and (when setting) initialize
>>     the remaining elements to their default value.
>> 2) allow getting/setting only the first N elements and leave the remaining
>>     elements to their old value.
>> 3) always set the full matrix.
>>
>> I am actually leaning towards 3 as that is the only unambiguous option. If there
>> is a good use case in the future support for 1 or 2 can always be added later.
> 
> My feeling is that setting/getting only part of the matrix might be a useful
> feature. Weren't you using struct v4l2_rect to select part of the matrix ?

Yes, in an earlier version of this project. However, it became too complex.
It suffered from the same problem as with initializing the first N elements,
but in addition it made the API and internal implementation overly complex.

The reality is that the only use-case where this would be useful is for large
matrices where you often need to update a sub-rectangle.

I do have large matrices (motion detection regions and thresholds), but you
typically set those up only once and you rarely change those on-the-fly.

> Anyway, if there is no real need for {s,g}etting only part of the matrix yet
> and adding it later won't be troublesome it seems reasonable to just start
> with 3) for now.

Yeah, the more I think about it, the more I believe that that's the best
approach.

Regards,

	Hans

      reply	other threads:[~2014-01-23 11:52 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
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 [this message]

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=52E101D6.4010109@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=sylvester.nawrocki@gmail.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.