Re: [PATCH RFC 1/2] V4L: Add auto focus selection targets

2012-12-11 Thread Sakari Ailus
Hi Andrzej,

Many thanks for the patch!

On Mon, Dec 10, 2012 at 02:43:38PM +0100, Andrzej Hajda wrote:
> 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 
> ---
>  Documentation/DocBook/media/v4l/selection-api.xml  |   32 -
>  .../DocBook/media/v4l/selections-common.xml|   37 
> 
>  .../media/v4l/vidioc-subdev-g-selection.xml|4 +--
>  include/uapi/linux/v4l2-common.h   |5 +++
>  4 files changed, 75 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/DocBook/media/v4l/selection-api.xml 
> b/Documentation/DocBook/media/v4l/selection-api.xml
> index 4c238ce..8caf67b 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
> +  Experimental selections API

Hmm. I wonder if it'd be enough to call this just "Selection API". There's a
note just below telling it's experimental.

>
>   Experimental
> @@ -9,6 +9,10 @@
>  interface and may change in the future.
>
>  
> + 
> +
> + Image cropping, composing and scaling
> +
>
>  Introduction
>  
> @@ -321,5 +325,31 @@ 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  linkend="camera-controls">
> +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 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.
> +
> +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..95e759f 100644
> --- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-se

Re: [PATCH RFC 1/2] V4L: Add auto focus selection targets

2012-12-12 Thread Andrzej Hajda

Hi Sakari,

Thank You for the review.


On 11.12.2012 22:04, Sakari Ailus wrote:

Hi Andrzej,

Many thanks for the patch!

On Mon, Dec 10, 2012 at 02:43:38PM +0100, Andrzej Hajda wrote:

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 
---
  Documentation/DocBook/media/v4l/selection-api.xml  |   32 -
  .../DocBook/media/v4l/selections-common.xml|   37 
  .../media/v4l/vidioc-subdev-g-selection.xml|4 +--
  include/uapi/linux/v4l2-common.h   |5 +++
  4 files changed, 75 insertions(+), 3 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/selection-api.xml 
b/Documentation/DocBook/media/v4l/selection-api.xml
index 4c238ce..8caf67b 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

+  Experimental selections API

Hmm. I wonder if it'd be enough to call this just "Selection API". There's a
note just below telling it's experimental.



Experimental
@@ -9,6 +9,10 @@
  interface and may change in the future.

  
+ 

+
+ Image cropping, composing and scaling
+

  Introduction
  
@@ -321,5 +325,31 @@ 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 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.
+
+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..95e759f 100644
--- a/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-subdev-g-selection.xml
@@ -57,8 +57,8 @@
  
  The selections are used to configure various image


Re: [PATCH RFC 1/2] V4L: Add auto focus selection targets

2012-12-16 Thread Sakari Ailus
Hi Andzej,

On Wed, Dec 12, 2012 at 02:59:32PM +0100, Andrzej Hajda wrote:
> On 11.12.2012 22:04, Sakari Ailus wrote:
> >Hi Andrzej,
> >
> >Many thanks for the patch!
> >
> >On Mon, Dec 10, 2012 at 02:43:38PM +0100, Andrzej Hajda wrote:
> >>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 
> >>---
> >>  Documentation/DocBook/media/v4l/selection-api.xml  |   32 
> >> -
> >>  .../DocBook/media/v4l/selections-common.xml|   37 
> >> 
> >>  .../media/v4l/vidioc-subdev-g-selection.xml|4 +--
> >>  include/uapi/linux/v4l2-common.h   |5 +++
> >>  4 files changed, 75 insertions(+), 3 deletions(-)
> >>
> >>diff --git a/Documentation/DocBook/media/v4l/selection-api.xml 
> >>b/Documentation/DocBook/media/v4l/selection-api.xml
> >>index 4c238ce..8caf67b 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
> >>+  Experimental selections API
> >Hmm. I wonder if it'd be enough to call this just "Selection API". There's a
> >note just below telling it's experimental.
> >
> >>
> >>Experimental
> >>@@ -9,6 +9,10 @@
> >>  interface and may change in the future.
> >>
> >>+ 
> >>+
> >>+ Image cropping, composing and scaling
> >>+
> >>
> >>  Introduction
> >>@@ -321,5 +325,31 @@ 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  >>linkend="camera-controls">
> >>+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 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.
> >>+
> >>+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 v