All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-media@vger.kernel.org
Cc: m.szyprowski@samsung.com, riverful.kim@samsung.com,
	sw0312.kim@samsung.com, s.nawrocki@samsung.com,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH 07/23] V4L: Add camera exposure metering control
Date: Thu, 10 May 2012 12:30:42 +0200	[thread overview]
Message-ID: <1336645858-30366-8-git-send-email-s.nawrocki@samsung.com> (raw)
In-Reply-To: <1336645858-30366-1-git-send-email-s.nawrocki@samsung.com>

The V4L2_CID_EXPOSURE_METERING control allows to determine
a method used by the camera for measuring the amount of light
available for automatic exposure.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 Documentation/DocBook/media/v4l/controls.xml |   29 ++++++++++++++++++++++++++
 drivers/media/video/v4l2-ctrls.c             |   10 +++++++++
 include/linux/videodev2.h                    |    7 +++++++
 3 files changed, 46 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index b1646b9..9571c96 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -2864,6 +2864,35 @@ exposure time and/or aperture.</para></entry>
 	  </row>
 	  <row><entry></entry></row>
 
+	  <row id="v4l2-exposure-metering">
+	    <entry spanname="id"><constant>V4L2_CID_EXPOSURE_METERING</constant>&nbsp;</entry>
+	    <entry>enum&nbsp;v4l2_exposure_metering</entry>
+	  </row><row><entry spanname="descr">Determines how the camera measures
+the amount of light available for the frame exposure. Possible values are:</entry>
+	  </row>
+	  <row>
+	    <entrytbl spanname="descr" cols="2">
+	      <tbody valign="top">
+		<row>
+		  <entry><constant>V4L2_EXPOSURE_METERING_AVERAGE</constant>&nbsp;</entry>
+		  <entry>Use the light information coming from the entire frame
+and average giving no weighting to any particular portion of the metered area.
+		  </entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_EXPOSURE_METERING_CENTER_WEIGHTED</constant>&nbsp;</entry>
+		  <entry>Average the light information coming from the entire frame
+giving priority to the center of the metered area.</entry>
+		</row>
+		<row>
+		  <entry><constant>V4L2_EXPOSURE_METERING_SPOT</constant>&nbsp;</entry>
+		  <entry>Measure only very small area at the center of the frame.</entry>
+		</row>
+	      </tbody>
+	    </entrytbl>
+	  </row>
+	  <row><entry></entry></row>
+
 	  <row>
 	    <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant>&nbsp;</entry>
 	    <entry>integer</entry>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index f4c4072..33a4b8a 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -230,6 +230,12 @@ const char * const *v4l2_ctrl_get_menu(u32 id)
 		"Aperture Priority Mode",
 		NULL
 	};
+	static const char * const camera_exposure_metering[] = {
+		"Average",
+		"Center Weighted",
+		"Spot",
+		NULL
+	};
 	static const char * const colorfx[] = {
 		"None",
 		"Black & White",
@@ -434,6 +440,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_EXPOSURE_METERING:
+		return camera_exposure_metering;
 	case V4L2_CID_COLORFX:
 		return colorfx;
 	case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE:
@@ -632,6 +640,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_IMAGE_STABILIZATION:	return "Image Stabilization";
 	case V4L2_CID_ISO_SENSITIVITY:		return "ISO Sensitivity";
 	case V4L2_CID_ISO_SENSITIVITY_AUTO:	return "ISO Sensitivity, Auto";
+	case V4L2_CID_EXPOSURE_METERING:	return "Exposure, Metering Mode";
 
 	/* FM Radio Modulator control */
 	/* Keep the order of the 'case's the same as in videodev2.h! */
@@ -772,6 +781,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
 	case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
 	case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
 	case V4L2_CID_ISO_SENSITIVITY_AUTO:
+	case V4L2_CID_EXPOSURE_METERING:
 		*type = V4L2_CTRL_TYPE_MENU;
 		break;
 	case V4L2_CID_RDS_TX_PS_NAME:
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index fe5592e..215b7df 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1726,6 +1726,13 @@ enum v4l2_iso_sensitivity_auto_type {
 	V4L2_ISO_SENSITIVITY_AUTO		= 1,
 };
 
+#define V4L2_CID_EXPOSURE_METERING		(V4L2_CID_CAMERA_CLASS_BASE+25)
+enum v4l2_exposure_metering {
+	V4L2_EXPOSURE_METERING_AVERAGE		= 0,
+	V4L2_EXPOSURE_METERING_CENTER_WEIGHTED	= 1,
+	V4L2_EXPOSURE_METERING_SPOT		= 2,
+};
+
 /* 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.10


  parent reply	other threads:[~2012-05-10 10:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 10:30 [PATCH v5 00/23] V4L: camera control enhancements Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 01/23] V4L: Add helper function for standard integer menu controls Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 02/23] V4L: Add camera exposure bias control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 03/23] V4L: Add an extended camera white balance control Sylwester Nawrocki
2012-05-14  0:02   ` Sakari Ailus
2012-05-15 21:28     ` Sylwester Nawrocki
2012-05-16  6:57       ` Sakari Ailus
2012-05-16  9:34         ` Sylwester Nawrocki
2012-05-17 22:37           ` Sakari Ailus
2012-05-15 21:53     ` [PATCH] V4L: DocBook: Improve V4L2_AUTO_N_WHITE_BALANCE control description Sylwester Nawrocki
2012-05-19 20:27       ` [PATCH v3] V4L: DocBook: Improve V4L2_CID_AUTO_N_WHITE_BALANCE " Sylwester Nawrocki
2012-05-15 22:05     ` [PATCH v2] " Sylwester Nawrocki
2012-05-17 22:42       ` Sakari Ailus
2012-05-10 10:30 ` [PATCH 04/23] V4L: Add camera wide dynamic range control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 05/23] V4L: Add camera image stabilization control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 06/23] V4L: Add camera ISO sensitivity controls Sylwester Nawrocki
2012-05-10 10:30 ` Sylwester Nawrocki [this message]
2012-05-10 10:30 ` [PATCH 08/23] V4L: Add camera scene mode control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 09/23] V4L: Add camera 3A lock control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 10/23] V4L: Add auto focus targets to the selections API Sylwester Nawrocki
2012-10-29 20:00   ` Sakari Ailus
2012-10-29 22:43     ` Sylwester Nawrocki
2012-11-04 17:29       ` Sakari Ailus
2012-05-10 10:30 ` [PATCH 11/23] V4L: Add auto focus targets to the subdev " Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 12/23] V4L: Add camera auto focus controls Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 13/23] m5mols: Convert macros to inline functions Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 14/23] m5mols: Refactored controls handling Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 15/23] m5mols: Use proper sensor mode for the controls Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 16/23] m5mols: Add ISO sensitivity controls Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 17/23] m5mols: Add auto and preset white balance control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 18/23] m5mols: Add exposure bias control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 19/23] m5mols: Add wide dynamic range control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 20/23] m5mols: Add image stabilization control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 21/23] m5mols: Add exposure metering control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 22/23] m5mols: Add JPEG compression quality control Sylwester Nawrocki
2012-05-10 10:30 ` [PATCH 23/23] m5mols: Add 3A lock control 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=1336645858-30366-8-git-send-email-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=riverful.kim@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.