All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi,
	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,
	s.nawrocki@samsung.com, Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH/RFC v3 10/14] V4L: Add auto focus targets to the selections API
Date: Fri, 27 Apr 2012 16:23:27 +0200	[thread overview]
Message-ID: <1335536611-4298-11-git-send-email-s.nawrocki@samsung.com> (raw)
In-Reply-To: <1335536611-4298-1-git-send-email-s.nawrocki@samsung.com>

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.

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>
+            <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 7c30d54..29b84ae 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)
-- 
1.7.10


  parent reply	other threads:[~2012-04-27 14:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 14:23 [PATCH/RFC v3 00/14] V4L camera control enhancements Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 01/14] V4L: Add helper function for standard integer menu controls Sylwester Nawrocki
2012-04-30 15:20   ` Hans Verkuil
2012-04-30 15:37     ` Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 02/14] V4L: Add camera exposure bias control Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 03/14] V4L: Add an extended camera white balance control Sylwester Nawrocki
2012-04-27 14:30   ` Hans de Goede
2012-04-27 14:23 ` [PATCH/RFC v3 04/14] V4L: Add camera wide dynamic range control Sylwester Nawrocki
2012-04-30 15:50   ` Hans Verkuil
2012-04-30 15:54     ` Hans Verkuil
2012-05-01 17:33       ` Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 05/14] V4L: Add camera image stabilization control Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 06/14] V4L: Add camera ISO sensitivity controls Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 07/14] V4L: Add camera exposure metering control Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 08/14] V4L: Add camera scene mode control Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 09/14] V4L: Add camera 3A lock control Sylwester Nawrocki
2012-04-30 15:59   ` Hans Verkuil
2012-05-01 17:38     ` Sylwester Nawrocki
2012-04-27 14:23 ` Sylwester Nawrocki [this message]
2012-04-27 14:23 ` [PATCH/RFC v3 11/14] V4L: Add auto focus targets to the subdev selections API Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 12/14] V4L: Add camera auto focus controls Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 13/14] V4L: Add S5C73M3 sensor sub-device driver Sylwester Nawrocki
2012-04-27 14:23 ` [PATCH/RFC v3 14/14] vivi: Add controls Sylwester Nawrocki
2012-04-30 16:09   ` Hans Verkuil
2012-05-01 17:40     ` Sylwester Nawrocki
2012-05-01 17:48       ` Hans Verkuil
2012-05-01 18:27         ` Sylwester Nawrocki
2012-05-01 19:02           ` Hans Verkuil
2012-04-30 15:10 ` [PATCH/RFC v3 00/14] V4L camera control enhancements Sylwester Nawrocki
2012-04-30 16:11 ` Hans Verkuil
2012-05-01 17:58   ` 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=1335536611-4298-11-git-send-email-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --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=sakari.ailus@iki.fi \
    --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.