From: Sakari Ailus <sakari.ailus@iki.fi>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com,
g.liakhovetski@gmx.de, hdegoede@redhat.com, moinejf@free.fr,
hverkuil@xs4all.nl, m.szyprowski@samsung.com,
riverful.kim@samsung.com, sw0312.kim@samsung.com,
Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH/RFC v4 10/12] V4L: Add auto focus targets to the selections API
Date: Sun, 06 May 2012 21:22:13 +0300 [thread overview]
Message-ID: <4FA6C155.6030100@iki.fi> (raw)
In-Reply-To: <1336156337-10935-11-git-send-email-s.nawrocki@samsung.com>
Hi Sylwester,
Thanks for the patch.
Sylwester Nawrocki wrote:
> The camera automatic focus algorithms may require setting up
> a spot or rectangle coordinates or multiple such parameters.
>
> The automatic focus selection targets are introduced in order
> to allow applications to query and set such coordinates. Those
> selections are intended to be used together with the automatic
> focus controls available in the camera control class.
Have you thought about multiple autofocus windows, and how could they be
implemented on top of this patch?
I'm not saying that we should implement them now, but at least we should
think how we _would_ implement them when needed. They aren't that exotic
functionality these days after all.
I'd guess this would involve an additional bitmask control and defining
a set of new targets. A comment in the source might help here ---
perhaps a good rule is to start new ranges at 0x1000 as you're doing
already.
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> Documentation/DocBook/media/v4l/selection-api.xml | 33 +++++++++++++++++++-
> .../DocBook/media/v4l/vidioc-g-selection.xml | 11 +++++++
> include/linux/videodev2.h | 5 +++
> 3 files changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml
> index b299e47..490d29a 100644
> --- a/Documentation/DocBook/media/v4l/selection-api.xml
> +++ b/Documentation/DocBook/media/v4l/selection-api.xml
> @@ -1,6 +1,6 @@
> <section id="selection-api">
>
> - <title>Experimental API for cropping, composing and scaling</title>
> + <title>Experimental selections API</title>
>
> <note>
> <title>Experimental</title>
> @@ -9,6 +9,10 @@
> interface and may change in the future.</para>
> </note>
>
> + <section>
> +
> + <title>Image cropping, composing and scaling</title>
> +
> <section>
> <title>Introduction</title>
>
> @@ -321,5 +325,32 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para>
> </example>
>
> </section>
> + </section>
> +
> + <section>
> + <title>Automatic focus regions of interest</title>
> +
> +<para> The camera automatic focus algorithms may require configuration of
> +regions of interest in form of rectangle or spot coordinates. The automatic
> +focus selection targets allow applications to query and set such coordinates.
> +Those selections are intended to be used together with the
> +<constant>V4L2_CID_AUTO_FOCUS_AREA</constant> <link linkend="camera-controls">
> +camera class</link> control. The <constant>V4L2_SEL_TGT_AUTO_FOCUS_ACTUAL
> +</constant> target is used for querying or setting actual spot or rectangle
> +coordinates, while <constant>V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS</constant> target
> +determines bounds for a single spot or rectangle.
> +These selections are only effective when the <constant>V4L2_CID_AUTO_FOCUS_AREA
> +</constant>control is set to <constant>V4L2_AUTO_FOCUS_AREA_SPOT</constant> or
> +<constant>V4L2_AUTO_FOCUS_AREA_RECTANGLE</constant>. The new coordinates shall
> +be accepted and applied to hardware when the focus area control value is
> +changed and also during a &VIDIOC-S-SELECTION; ioctl call, only when the focus
> +area control is already set to required value.</para>
> +
> +<para> For the <constant>V4L2_AUTO_FOCUS_AREA_SPOT</constant> case, the selection
> +rectangle <structfield> width</structfield> and <structfield>height</structfield>
> +are not used, i.e. shall be set to 0 by applications and ignored by drivers for
> +the &VIDIOC-S-SELECTION; ioctl and shall be ignored by applications for the
> +&VIDIOC-G-SELECTION; ioctl.</para>
> + </section>
>
> </section>
> diff --git a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
> index bb04eff..87df4da 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
> +++ b/Documentation/DocBook/media/v4l/vidioc-g-selection.xml
> @@ -195,6 +195,17 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
> <entry>0x0103</entry>
> <entry>The active area and all padding pixels that are inserted or modified by hardware.</entry>
> </row>
> + <row>
> + <entry><constant>V4L2_SEL_TGT_AUTO_FOCUS_ACTUAL</constant></entry>
> + <entry>0x1000</entry>
> + <entry>Actual automatic focus rectangle or spot coordinates.</entry>
> + </row>
> + <row>
> + <entry><constant>V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS</constant></entry>
> + <entry>0x1002</entry>
This should be 0x1001, I believe.
> + <entry>Bounds of the automatic focus region of interest.
> + </entry>
> + </row>
> </tbody>
> </tgroup>
> </table>
> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
> index c1fae94..6bfd6c5 100644
> --- a/include/linux/videodev2.h
> +++ b/include/linux/videodev2.h
> @@ -777,6 +777,11 @@ struct v4l2_crop {
> /* Current composing area plus all padding pixels */
> #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
>
> +/* Auto focus region of interest */
> +#define V4L2_SEL_TGT_AUTO_FOCUS_ACTUAL 0x1000
> +/* Auto focus region (spot coordinates) bounds */
> +#define V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS 0x1001
> +
> /**
> * struct v4l2_selection - selection info
> * @type: buffer type (do not use *_MPLANE types)
Cheers,
--
Sakari Ailus
sakari.ailus@iki.fi
next prev parent reply other threads:[~2012-05-07 4:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 18:32 [PATCH/RFC v4 00/13] V4L: camera control enhancements Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 01/12] V4L: Add helper function for standard integer menu controls Sylwester Nawrocki
2012-05-06 10:12 ` Sakari Ailus
2012-05-06 17:00 ` Sylwester Nawrocki
2012-05-06 18:51 ` [PATCH v5 " Sylwester Nawrocki
2012-05-07 15:05 ` Sakari Ailus
2012-05-04 18:32 ` [PATCH/RFC v4 02/12] V4L: Add camera exposure bias control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 03/12] V4L: Add an extended camera white balance control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 04/12] V4L: Add camera wide dynamic range control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 05/12] V4L: Add camera image stabilization control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 06/12] V4L: Add camera ISO sensitivity controls Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 07/12] V4L: Add camera exposure metering control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 08/12] V4L: Add camera scene mode control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 09/12] V4L: Add camera 3A lock control Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 10/12] V4L: Add auto focus targets to the selections API Sylwester Nawrocki
2012-05-06 18:22 ` Sakari Ailus [this message]
2012-05-08 10:46 ` Sylwester Nawrocki
2012-05-13 0:06 ` Sakari Ailus
2012-05-04 18:32 ` [PATCH/RFC v4 11/12] V4L: Add auto focus targets to the subdev " Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 12/12] V4L: Add camera auto focus controls Sylwester Nawrocki
2012-05-06 18:46 ` Sakari Ailus
2012-05-09 10:11 ` Sylwester Nawrocki
2012-05-09 17:39 ` Sylwester Nawrocki
2012-05-06 18:58 ` [PATCH v5 " Sylwester Nawrocki
2012-05-04 18:32 ` [PATCH/RFC v4 13/13] V4L: Add S5C73M3 sensor sub-device driver Sylwester Nawrocki
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=4FA6C155.6030100@iki.fi \
--to=sakari.ailus@iki.fi \
--cc=g.liakhovetski@gmx.de \
--cc=hdegoede@redhat.com \
--cc=hverkuil@xs4all.nl \
--cc=kyungmin.park@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=moinejf@free.fr \
--cc=riverful.kim@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=sw0312.kim@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.