From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sylwester Nawrocki <snjw23@gmail.com>,
linux-media@vger.kernel.org, sakari.ailus@iki.fi,
hverkuil@xs4all.nl, riverful.kim@samsung.com,
Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [RFC/PATCH 2/5] uvc: Adapt the driver to new type of V4L2_CID_FOCUS_AUTO control
Date: Tue, 06 Dec 2011 18:10:24 +0100 [thread overview]
Message-ID: <4EDE4C80.8090106@samsung.com> (raw)
In-Reply-To: <201112061326.57238.laurent.pinchart@ideasonboard.com>
Hi Laurent,
On 12/06/2011 01:26 PM, Laurent Pinchart wrote:
> On Sunday 04 December 2011 16:16:13 Sylwester Nawrocki wrote:
>> From: Heungjun Kim <riverful.kim@samsung.com>
>>
>> The V4L2_CID_FOCUS_AUTO control has been converted from boolean type,
>> where control's value 0 and 1 were corresponding to manual and automatic
>> focus respectively, to menu type with following menu items:
>> 0 - V4L2_FOCUS_MANUAL,
>> 1 - V4L2_FOCUS_AUTO,
>> 2 - V4L2_FOCUS_AUTO_MACRO,
>> 3 - V4L2_FOCUS_AUTO_CONTINUOUS.
>>
>> According to this change the uvc control mappings are modified to retain
>> original sematics, where 0 corresponds to manual and 1 to auto focus.
>
> UVC auto-focus works in continuous mode, not single-shot mode. As the existing
Hmm, I suspected that.
> V4L2_CID_FOCUS_AUTO uses 0 to mean manual focus and 1 to mean continuous auto-
> focus, shouldn't this patch set define the following values instead ?
>
> 0 - V4L2_FOCUS_MANUAL
> 1 - V4L2_FOCUS_AUTO
> 2 - V4L2_FOCUS_AUTO_MACRO
> 3 - V4L2_FOCUS_AUTO_SINGLE_SHOT
It's not that bad, at least we would not have changed the existing ABI.
It depends how other focus modes are defined, e.g. V4L2_FOCUS_AUTO_MACRO.
There is also an auto focus driven by face detection module output.
The question would be whether we want to append _SINGLE_SHOT or _CONTINUOUS
to the names. And if most of the focus modes are single-shot we will
probably need a common "do auto-focus" control for them.
What do you think about such assignment:
0 - V4L2_FOCUS_MANUAL,
1 - V4L2_FOCUS_AUTO_CONTINUOUS,
2 - V4L2_FOCUS_AUTO,
3 - V4L2_FOCUS_AUTO_MACRO,
?
I'm not 100% sure right now, but the macro and "face detection"
are rather "single-shot". Single-shot focus might be more common. Perhaps
someone else can put more light on that :-)
Using a "single-shot notation" we might have something like:
0 - V4L2_FOCUS_MANUAL,
1 - V4L2_FOCUS_AUTO,
2 - V4L2_FOCUS_AUTO_SINGLE_SHOT,
3 - V4L2_FOCUS_AUTO_MACRO_SINGLE_SHOT,
3 - V4L2_FOCUS_AUTO_FACE_DETECTION_SINGLE_SHOT,
I'm not sure if this convention is the best one.
Alternatively we could define a "do-focus" control for each mode,
but then these controls have to be properly coordinated, for exclusive
operation.
>
> V4L2_FOCUS_AUTO_SINGLE_SHOT could also be named V4L2_FOCUS_SINGLE_SHOT.
>
>> Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>
>> ---
>> The V4L2_CID_FOCUS_AUTO control in V4L2_FOCUS_AUTO mode does only
>> a one-shot auto focus, when switched from V4L2_FOCUS_MANUAL.
>> It might be worth to implement also the V4L2_CID_DO_AUTO_FOCUS button
>> control in uvc, however I didn't take time yet to better understand
>> the driver and add this. I also don't have any uvc hardware to test
>> this patch so it's just compile tested.
>> ---
>> drivers/media/video/uvc/uvc_ctrl.c | 9 ++++++++-
>> 1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>> b/drivers/media/video/uvc/uvc_ctrl.c index 254d326..6860ca1 100644
>> --- a/drivers/media/video/uvc/uvc_ctrl.c
>> +++ b/drivers/media/video/uvc/uvc_ctrl.c
>> @@ -365,6 +365,11 @@ static struct uvc_menu_info exposure_auto_controls[] =
>> { { 8, "Aperture Priority Mode" },
>> };
>>
>> +static struct uvc_menu_info focus_auto_controls[] = {
>> + { 0, "Manual Mode" },
>> + { 1, "Auto Mode" },
Do you think it could be better to change this to:
+ { 0, "Manual Focus" },
+ { 1, "Continuous Auto Focus" },
?
--
Regards,
Sylwester
next prev parent reply other threads:[~2011-12-06 17:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-04 15:16 [RFC/PATCH 0/5] v4l: New camera controls Sylwester Nawrocki
2011-12-04 15:16 ` [RFC/PATCH 1/5] v4l: Convert V4L2_CID_FOCUS_AUTO control to a menu control Sylwester Nawrocki
2011-12-06 12:31 ` Laurent Pinchart
2011-12-06 17:25 ` Sylwester Nawrocki
2011-12-10 10:33 ` Sakari Ailus
2011-12-10 14:42 ` Sylwester Nawrocki
2011-12-31 12:00 ` Sakari Ailus
2012-01-01 16:49 ` Sylwester Nawrocki
2012-01-02 11:16 ` Laurent Pinchart
2012-01-02 20:55 ` Sylwester Nawrocki
2012-01-03 13:55 ` Laurent Pinchart
2012-01-04 22:04 ` Sylwester Nawrocki
2012-01-04 14:04 ` Sakari Ailus
2012-01-06 14:22 ` Sylwester Nawrocki
2012-01-04 13:22 ` Sakari Ailus
2012-01-06 13:56 ` Sylwester Nawrocki
2011-12-11 16:18 ` Sylwester Nawrocki
2011-12-04 15:16 ` [RFC/PATCH 2/5] uvc: Adapt the driver to new type of V4L2_CID_FOCUS_AUTO control Sylwester Nawrocki
2011-12-06 12:26 ` Laurent Pinchart
2011-12-06 17:10 ` Sylwester Nawrocki [this message]
2011-12-04 15:16 ` [RFC/PATCH 3/5] v4l: Add V4L2_CID_METERING_MODE camera control Sylwester Nawrocki
2011-12-06 12:32 ` Laurent Pinchart
2011-12-06 16:27 ` Sylwester Nawrocki
2011-12-07 11:09 ` Sylwester Nawrocki
2011-12-10 10:44 ` Sakari Ailus
2011-12-10 14:14 ` Sylwester Nawrocki
2011-12-04 15:16 ` [RFC/PATCH 4/5] v4l: Add V4L2_CID_EXPOSURE_BIAS " Sylwester Nawrocki
2011-12-04 15:16 ` [RFC/PATCH 5/5] v4l: Add V4L2_CID_ISO and V4L2_CID_ISO_AUTO controls Sylwester Nawrocki
2011-12-06 12:34 ` [RFC/PATCH 0/5] v4l: New camera controls Laurent Pinchart
2011-12-07 10:32 ` Sylwester Nawrocki
2011-12-10 10:20 ` Sakari Ailus
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=4EDE4C80.8090106@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=riverful.kim@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=snjw23@gmail.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.