From patchwork Fri Jun 7 11:25:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 18808 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Ukunw-0000bN-7t; Fri, 07 Jun 2013 13:26:00 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-5) with esmtp id 1Ukunt-0003vK-9T; Fri, 07 Jun 2013 13:26:00 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755412Ab3FGLZz (ORCPT + 1 other); Fri, 7 Jun 2013 07:25:55 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:62953 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755159Ab3FGLZz (ORCPT ); Fri, 7 Jun 2013 07:25:55 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MO000L8LT2XZ5A0@mailout1.w1.samsung.com> for linux-media@vger.kernel.org; Fri, 07 Jun 2013 12:25:53 +0100 (BST) X-AuditID: cbfec7f5-b7f376d000001ec6-65-51b1c341ca93 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 13.62.07878.143C1B15; Fri, 07 Jun 2013 12:25:53 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MO000CRNT2SW8B0@eusync3.samsung.com>; Fri, 07 Jun 2013 12:25:53 +0100 (BST) From: Andrzej Hajda To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Kyungmin Park , Seung-Woo Kim , Sakari Ailus , HyungJun Choi , Andrzej Hajda Subject: [PATCH 1/2] V4L: Add auto focus selection targets Date: Fri, 07 Jun 2013 13:25:21 +0200 Message-id: <1370604322-15476-2-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.8.1.2 In-reply-to: <1370604322-15476-1-git-send-email-a.hajda@samsung.com> References: <1370604322-15476-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t/xq7qOhzcGGlxawmZxa905VovHG68x W5xtesNu0bNhK6vF4TftrBZn9q9ks5gx+SWbA7vH4a8LWTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY82mpcwFnRYV0zsnMDcwTtXrYuTkkBAwkXjZsYkFwhaTuHBvPVsXIxeHkMBSRokZ c0+wQDh9TBJn5p5kBaliE9CU+Lv5JhuILSIgL/Gk9waYzSzwk1Hi0wtREFtYwEpiyaLDQHEO DhYBVYnpk0xAwrwCzhI9V6ezQSxTkPh5+QSYzSngInGq4SMziC0EVPNp7k3GCYy8CxgZVjGK ppYmFxQnpeca6RUn5haX5qXrJefnbmKEBNDXHYxLj1kdYhTgYFTi4V24YkOgEGtiWXFl7iFG CQ5mJRHexk0bA4V4UxIrq1KL8uOLSnNSiw8xMnFwSjUwitrnZ638xH5WhGfC7/Cf7B8V7n75 uMbLmPnhIXGet8Y8P/gFuS7r7V10xXcyb4vPJrdv6kbFf8/5K17qKXk832fankV8vgnzpnYW 2Nx5M1d4JeuebNtUCX7ZqozgXVuVprUIe1UzLz22Ojvf+5bB8XIOrRnF8h/n7b6y+KVrqtF0 Kc3arVvLlFiKMxINtZiLihMBBIsTWP4BAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.6.7.111821 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' From: Sylwester Nawrocki The camera automatic focus algorithms may require setting up a spot or rectangle coordinates. 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 Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park --- v2: - corrected description of the selection API, - selection changes are applied only by (re-)starting AF, - changed V4L2_SEL_TGT_AUTO_FOCUS* to 0x100* --- Documentation/DocBook/media/v4l/selection-api.xml | 31 +++++++++++++++++- .../DocBook/media/v4l/selections-common.xml | 37 ++++++++++++++++++++++ .../media/v4l/vidioc-subdev-g-selection.xml | 9 +++--- include/uapi/linux/v4l2-common.h | 5 +++ 4 files changed, 77 insertions(+), 5 deletions(-) diff --git a/Documentation/DocBook/media/v4l/selection-api.xml b/Documentation/DocBook/media/v4l/selection-api.xml index 4c238ce..9c19a03 100644 --- a/Documentation/DocBook/media/v4l/selection-api.xml +++ b/Documentation/DocBook/media/v4l/selection-api.xml @@ -1,6 +1,6 @@
- Experimental API for cropping, composing and scaling + Selection API Experimental @@ -9,6 +9,10 @@ interface and may change in the future. +
+ + Image cropping, composing and scaling +
Introduction @@ -321,5 +325,30 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT for other devices
+
+ +
+ Automatic focus regions of interest + +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 +V4L2_CID_AUTO_FOCUS_AREA +camera class control. The V4L2_SEL_TGT_AUTO_FOCUS +target is used for querying or setting actual spot or rectangle coordinates, +while V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS target determines +bounds for a single spot or rectangle. These selections are only effective when +the V4L2_CID_AUTO_FOCUS_AREA control is set to +V4L2_AUTO_FOCUS_AREA_RECTANGLE. The new coordinates shall +be applied to the hardware only by (re-)starting autofocus process +(V4L2_CID_AUTO_FOCUS_START) or starting continuous +autofocus (V4L2_CID_FOCUS_AUTO). + +When the width and +height of the selection rectangle are set to 0 the +selection determines spot coordinates, rather than a rectangle. + +
diff --git a/Documentation/DocBook/media/v4l/selections-common.xml b/Documentation/DocBook/media/v4l/selections-common.xml index 7502f78..9f0c477 100644 --- a/Documentation/DocBook/media/v4l/selections-common.xml +++ b/Documentation/DocBook/media/v4l/selections-common.xml @@ -93,6 +93,22 @@ Yes No + + V4L2_SEL_TGT_AUTO_FOCUS + 0x1001 + Actual automatic focus rectangle. + Yes + Yes + + + V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS + 0x1002 + Bounds of the automatic focus region of interest. All valid + automatic focus rectangles fit inside the automatic focus bounds + rectangle. + Yes + Yes + @@ -158,7 +174,28 @@ + + +
+ Automatic focus regions of interest + + The camera automatic focus algorithms may require configuration + of a region or multiple regions of interest in form of rectangle or spot + coordinates. + + A single rectangle of interest is represented in &v4l2-rect; + by the coordinates of the top left corner and the rectangle size. Both + the coordinates and sizes are expressed in pixels. When the + width and height fields of + &v4l2-rect; are set to 0 the selection determines spot coordinates, + rather than a rectangle. + Auto focus rectangles are reset to their default values when the + output image format is modified. Drivers should use the output image size + as the auto focus rectangle default value, but hardware requirements may + prevent this. + + The auto focus selections on input pads are not defined.
diff --git a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml index 1ba9e99..efbdb3f 100644 --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml +++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml @@ -55,10 +55,11 @@ interface and may change in the future. - The selections are used to configure various image - processing functionality performed by the subdevs which affect the - image size. This currently includes cropping, scaling and - composition. + The selections are used to configure various image processing + functionality performed by the subdevs which requires passing image + area coordinates between a driver and an application. + This currently includes cropping, scaling, composition + and automatic focus regions of interest. The selection API replaces the old subdev crop API. All diff --git a/include/uapi/linux/v4l2-common.h b/include/uapi/linux/v4l2-common.h index 4f0667e..6db81a2 100644 --- a/include/uapi/linux/v4l2-common.h +++ b/include/uapi/linux/v4l2-common.h @@ -50,6 +50,11 @@ /* 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 0x1001 +/* Auto focus region bounds */ +#define V4L2_SEL_TGT_AUTO_FOCUS_BOUNDS 0x1002 + /* Backward compatibility target definitions --- to be removed. */ #define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP #define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE