public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls
@ 2011-03-22  8:34 Kim, HeungJun
  2011-03-22  8:38 ` [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus Kim, Heungjun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kim, HeungJun @ 2011-03-22  8:34 UTC (permalink / raw)
  To: linux-media@vger.kernel.org
  Cc: Hans Verkuil, Laurent Pinchart, Sylwester Nawrocki,
	kyungmin.park@samsung.com

Hello,

This is third version of RFC patch series about adding auto focus mode
and controls. The patch of the previous version bring about the issue
to be able to execute only once, not repeatedly. Because the each modes
are defined by menu type. To solve this, we add the new control of
choosing focus mode, and if doing repeatedly, it's alright that you
determine the focus mode and change the value of V4L2_CID_FOCUS_AUTO.

In the case of new added rectangle mode, these each controls belongs to
4 new controls, can make to point by the form of rectangle. These 4 new
each control values mean left x coordinate, top y coordinate,
width x length, height y length. It's similar to structure v4l2_rect.

You can find previous threads about this:
http://www.spinics.net/lists/linux-media/msg29446.html

Thanks and Regards,
Heungjun Kim

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus
  2011-03-22  8:34 [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
@ 2011-03-22  8:38 ` Kim, Heungjun
  2011-03-22  8:38 ` [RFC PATCH v3 2/2] v4l2-ctrls: update auto focus mode documentation Kim, Heungjun
  2011-03-22  8:48 ` [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
  2 siblings, 0 replies; 5+ messages in thread
From: Kim, Heungjun @ 2011-03-22  8:38 UTC (permalink / raw)
  To: linux-media
  Cc: hverkuil, laurent.pinchart, s.nawrocki, kyungmin.park,
	Kim, Heungjun

It supports various modes of auto focus. Each modes define as the enumerations
of menu type.

	V4L2_FOCUS_AUTO_NORMAL,
	V4L2_FOCUS_AUTO_MACRO,
	V4L2_FOCUS_AUTO_CONTINUOUS,
	V4L2_FOCUS_AUTO_FACE_DETECTION,
	V4L2_FOCUS_AUTO_RECTANGLE

In the cause of rectangle it needs the 4 kinds of coordinate control ID of
integer type for expression about focus-spot, and each control ID means
similar to the struct v4l2_rect.

	V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT
	V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP
	V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH
	V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT

Signed-off-by: Kim, Heungjun <riverful.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/video/v4l2-ctrls.c |   16 ++++++++++++++++
 include/linux/videodev2.h        |   13 +++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 2412f08..365540f 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -197,6 +197,14 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
 		"Aperture Priority Mode",
 		NULL
 	};
+	static const char * const camera_focus_auto_mode[] = {
+		"Normal Mode",
+		"Macro Mode",
+		"Continuous Mode",
+		"Face Detection Mode",
+		"Rectangle Mode",
+		NULL
+	};
 	static const char * const colorfx[] = {
 		"None",
 		"Black & White",
@@ -252,6 +260,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
 		return camera_power_line_frequency;
 	case V4L2_CID_EXPOSURE_AUTO:
 		return camera_exposure_auto;
+	case V4L2_CID_FOCUS_AUTO_MODE:
+		return camera_focus_auto_mode;
 	case V4L2_CID_COLORFX:
 		return colorfx;
 	case V4L2_CID_TUNE_PREEMPHASIS:
@@ -365,6 +375,11 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_PRIVACY:			return "Privacy";
 	case V4L2_CID_IRIS_ABSOLUTE:		return "Iris, Absolute";
 	case V4L2_CID_IRIS_RELATIVE:		return "Iris, Relative";
+	case V4L2_CID_FOCUS_AUTO_MODE:		return "Focus, Mode";
+	case V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT: return "Focus, Rectangle Left";
+	case V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP: return "Focus, Rectangle Top";
+	case V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH: return "Focus, Rectangle Width";
+	case V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT: return "Focus, Rectangle Height";
 
 	/* FM Radio Modulator control */
 	/* Keep the order of the 'case's the same as in videodev2.h! */
@@ -450,6 +465,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_MPEG_STREAM_TYPE:
 	case V4L2_CID_MPEG_STREAM_VBI_FMT:
 	case V4L2_CID_EXPOSURE_AUTO:
+	case V4L2_CID_FOCUS_AUTO_MODE:
 	case V4L2_CID_COLORFX:
 	case V4L2_CID_TUNE_PREEMPHASIS:
 		*type = V4L2_CTRL_TYPE_MENU;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index aa6c393..99cd1b7 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1389,6 +1389,19 @@ enum  v4l2_exposure_auto_type {
 #define V4L2_CID_IRIS_ABSOLUTE			(V4L2_CID_CAMERA_CLASS_BASE+17)
 #define V4L2_CID_IRIS_RELATIVE			(V4L2_CID_CAMERA_CLASS_BASE+18)
 
+#define V4L2_CID_FOCUS_AUTO_MODE		(V4L2_CID_CAMERA_CLASS_BASE+19)
+enum  v4l2_focus_mode_type {
+	V4L2_FOCUS_AUTO_NORMAL = 0,
+	V4L2_FOCUS_AUTO_MACRO = 1,
+	V4L2_FOCUS_AUTO_CONTINUOUS = 2,
+	V4L2_FOCUS_AUTO_FACE_DETECTION = 3,
+	V4L2_FOCUS_AUTO_RECTANGLE = 4
+};
+#define V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT	(V4L2_CID_CAMERA_CLASS_BASE+20)
+#define V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP	(V4L2_CID_CAMERA_CLASS_BASE+21)
+#define V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH	(V4L2_CID_CAMERA_CLASS_BASE+22)
+#define V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT	(V4L2_CID_CAMERA_CLASS_BASE+23)
+
 /* FM Modulator class control IDs */
 #define V4L2_CID_FM_TX_CLASS_BASE		(V4L2_CTRL_CLASS_FM_TX | 0x900)
 #define V4L2_CID_FM_TX_CLASS			(V4L2_CTRL_CLASS_FM_TX | 1)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC PATCH v3 2/2] v4l2-ctrls: update auto focus mode documentation
  2011-03-22  8:34 [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
  2011-03-22  8:38 ` [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus Kim, Heungjun
@ 2011-03-22  8:38 ` Kim, Heungjun
  2011-03-22  8:48 ` [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
  2 siblings, 0 replies; 5+ messages in thread
From: Kim, Heungjun @ 2011-03-22  8:38 UTC (permalink / raw)
  To: linux-media
  Cc: hverkuil, laurent.pinchart, s.nawrocki, kyungmin.park,
	Kim, Heungjun

As following to change the boolean type of V4L2_CID_FOCUS_AUTO to menu type,
this uvc is modified the usage of V4L2_CID_FOCUS_AUTO.

Signed-off-by: Heungjun Kim <riverful.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 Documentation/DocBook/v4l/controls.xml    |   67 +++++++++++++++++++++++++++++
 Documentation/DocBook/v4l/videodev2.h.xml |    8 +++
 2 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/Documentation/DocBook/v4l/controls.xml b/Documentation/DocBook/v4l/controls.xml
index 2fae3e8..b940e21 100644
--- a/Documentation/DocBook/v4l/controls.xml
+++ b/Documentation/DocBook/v4l/controls.xml
@@ -1860,6 +1860,73 @@ it one step further. This is a write-only control.</entry>
 	  </row>
 	  <row><entry></entry></row>
 
+	  <row id="v4l2-focus-auto-mode-type">
+	    <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO_MODE</constant>&nbsp;</entry>
+	    <entry>enum&nbsp;v4l2_focus_auto_mode_type</entry>
+	  </row><row><entry spanname="descr">Enables setting modes of
+auto focus. The focus has 5 kinds of mode, and each enumerations express
+current auto focus mode in which the camera is. In the case of
+V4L2_FOCUS_AUTO_RECTANGLE, this control id can be clustered with
+4 control id which means focusing spot expressed by 4 point of rectangle.
+	  </entry>
+	  </row>
+	  <row>
+	    <entrytbl spanname="descr" cols="2">
+	      <tbody valign="top">
+		<row>
+		  <entry><constant>V4L2_FOCUS_AUTO_NORMAL</constant>&nbsp;</entry>
+		  <entry>Normal mode Auto focus, single shot.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FOCUS_AUTO_MACRO</constant>&nbsp;</entry>
+		  <entry>Macro mode Auto focus, single shot.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FOCUS_AUTO_CONTINUOUS</constant>&nbsp;</entry>
+		  <entry>Continuous mode Auto focus, continuous shot.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FOCUS_AUTO_FACE_DETECTION</constant>&nbsp;</entry>
+		  <entry>Face detection mode Auto focus, single shot.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_FOCUS_AUTO_RECTANGLE</constant>&nbsp;</entry>
+		  <entry>Rectangle mode Auto focus, single shot.</entry>
+		</row>
+	      </tbody>
+	    </entrytbl>
+	  </row>
+	  <row><entry></entry></row>
+
+	  <row>
+	    <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO_RECTANGLE_LEFT</constant>&nbsp;</entry>
+	    <entry>integer</entry>
+	  </row><row><entry spanname="descr">This control means the left
+side's point of the rectangle expressing focusing spot.</entry>
+	  </row>
+	  <row><entry></entry></row>
+
+	    <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO_RECTANGLE_TOP</constant>&nbsp;</entry>
+	    <entry>integer</entry>
+	  </row><row><entry spanname="descr">This control means the top
+side's point of the rectangle expressing focusing spot.</entry>
+	  </row>
+	  <row><entry></entry></row>
+
+	    <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO_RECTANGLE_WIDTH</constant>&nbsp;</entry>
+	    <entry>integer</entry>
+	  </row><row><entry spanname="descr">This control means the width
+length of the rectangle expressing focusing spot.</entry>
+	  </row>
+	  <row><entry></entry></row>
+
+	    <entry spanname="id"><constant>V4L2_CID_FOCUS_AUTO_RECTANGLE_HEIGHT</constant>&nbsp;</entry>
+	    <entry>integer</entry>
+	  </row><row><entry spanname="descr">This control means the height
+length of the rectangle expressing focusing spot.</entry>
+	  </row>
+	  <row><entry></entry></row>
+
 	  <row>
 	    <entry spanname="id"><constant>V4L2_CID_PRIVACY</constant>&nbsp;</entry>
 	    <entry>boolean</entry>
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml
index 2b796a2..6bb67a6 100644
--- a/Documentation/DocBook/v4l/videodev2.h.xml
+++ b/Documentation/DocBook/v4l/videodev2.h.xml
@@ -1385,6 +1385,14 @@ enum  <link linkend="v4l2-exposure-auto-type">v4l2_exposure_auto_type</link> {
 #define V4L2_CID_IRIS_ABSOLUTE                  (V4L2_CID_CAMERA_CLASS_BASE+17)
 #define V4L2_CID_IRIS_RELATIVE                  (V4L2_CID_CAMERA_CLASS_BASE+18)
 
+enum  <link linkend="v4l2-focus-auto-mode-type">v4l2_focus_auto_mode_type</link> {
+	V4L2_FOCUS_AUTO_NORMAL = 0,
+	V4L2_FOCUS_AUTO_MACRO = 1,
+	V4L2_FOCUS_AUTO_CONTINUOUS = 2,
+	V4L2_FOCUS_AUTO_FACE_DETECTION = 3,
+	V4L2_FOCUS_AUTO_RECTANGLE = 4
+};
+
 /* FM Modulator class control IDs */
 #define V4L2_CID_FM_TX_CLASS_BASE               (V4L2_CTRL_CLASS_FM_TX | 0x900)
 #define V4L2_CID_FM_TX_CLASS                    (V4L2_CTRL_CLASS_FM_TX | 1)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls
  2011-03-22  8:34 [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
  2011-03-22  8:38 ` [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus Kim, Heungjun
  2011-03-22  8:38 ` [RFC PATCH v3 2/2] v4l2-ctrls: update auto focus mode documentation Kim, Heungjun
@ 2011-03-22  8:48 ` Kim, HeungJun
  2 siblings, 0 replies; 5+ messages in thread
From: Kim, HeungJun @ 2011-03-22  8:48 UTC (permalink / raw)
  To: riverful.kim
  Cc: linux-media@vger.kernel.org, Hans Verkuil, Laurent Pinchart,
	Sylwester Nawrocki, kyungmin.park@samsung.com

The comments of 2/2 patch are wrong. It's my fault.
Please ignore this. And I'll send again.
Sorry to confuse.

2011-03-22 오후 5:34, Kim, HeungJun 쓴 글:
> Hello,
> 
> This is third version of RFC patch series about adding auto focus mode
> and controls. The patch of the previous version bring about the issue
> to be able to execute only once, not repeatedly. Because the each modes
> are defined by menu type. To solve this, we add the new control of
> choosing focus mode, and if doing repeatedly, it's alright that you
> determine the focus mode and change the value of V4L2_CID_FOCUS_AUTO.
> 
> In the case of new added rectangle mode, these each controls belongs to
> 4 new controls, can make to point by the form of rectangle. These 4 new
> each control values mean left x coordinate, top y coordinate,
> width x length, height y length. It's similar to structure v4l2_rect.
> 
> You can find previous threads about this:
> http://www.spinics.net/lists/linux-media/msg29446.html
> 
> Thanks and Regards,
> Heungjun Kim
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls
@ 2011-03-22  8:49 Kim, HeungJun
  0 siblings, 0 replies; 5+ messages in thread
From: Kim, HeungJun @ 2011-03-22  8:49 UTC (permalink / raw)
  To: linux-media@vger.kernel.org
  Cc: Hans Verkuil, Laurent Pinchart, Sylwester Nawrocki,
	kyungmin.park@samsung.com

Hello,

This is third version of RFC patch series about adding auto focus mode
and controls. The patch of the previous version bring about the issue
to be able to execute only once, not repeatedly. Because the each modes
are defined by menu type. To solve this, we add the new control of
choosing focus mode, and if doing repeatedly, it's alright that you
determine the focus mode and change the value of V4L2_CID_FOCUS_AUTO.

In the case of new added rectangle mode, these each controls belongs to
4 new controls, can make to point by the form of rectangle. These 4 new
each control values mean left x coordinate, top y coordinate,
width x length, height y length. It's similar to structure v4l2_rect.

You can find previous threads about this:
http://www.spinics.net/lists/linux-media/msg29446.html

Thanks and Regards,
Heungjun Kim

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-22  8:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-22  8:34 [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
2011-03-22  8:38 ` [RFC PATCH v3 1/2] v4l2-ctrls: support various modes and 4 coordinates of rectangle auto focus Kim, Heungjun
2011-03-22  8:38 ` [RFC PATCH v3 2/2] v4l2-ctrls: update auto focus mode documentation Kim, Heungjun
2011-03-22  8:48 ` [RFC PATCH v3 0/2] v4l2-ctrls: add auto focus mode and controls Kim, HeungJun
  -- strict thread matches above, loose matches on Subject: below --
2011-03-22  8:49 Kim, HeungJun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox