[PATCH 08/15] V4L: Add camera exposure metering control
- Subject: [PATCH 08/15] V4L: Add camera exposure metering control
- From: Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>
- Date: Tue, 17 Apr 2012 12:09:49 +0200
- Cc: laurent.pinchart@xxxxxxxxxxxxxxxx, sakari.ailus@xxxxxx, g.liakhovetski@xxxxxx, hdegoede@xxxxxxxxxx, moinejf@xxxxxxx, m.szyprowski@xxxxxxxxxxx, riverful.kim@xxxxxxxxxxx, sw0312.kim@xxxxxxxxxxx, s.nawrocki@xxxxxxxxxxx, Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
- In-reply-to: <1334657396-5737-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@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
Documentation/DocBook/media/v4l/controls.xml | 29 ++++++++++++++++++++++++++
drivers/media/video/v4l2-ctrls.c | 14 +++++++++++++
include/linux/videodev2.h | 7 +++++++
3 files changed, 50 insertions(+)
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml
index c50941e..fc05f9d 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -2855,6 +2855,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> </entry>
+ <entry>enum 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> </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> </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> </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> </entry>
<entry>integer</entry>
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index aa3d111..e037601 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",
@@ -427,6 +433,12 @@ 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_AUTO_FOCUS_AREA:
+ return camera_auto_focus_area;
+ case V4L2_CID_AUTO_FOCUS_DISTANCE:
+ return camera_auto_focus_distance;
case V4L2_CID_COLORFX:
return colorfx;
case V4L2_CID_WHITE_BALANCE_PRESET:
@@ -622,6 +634,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! */
@@ -762,6 +775,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
case V4L2_CID_JPEG_CHROMA_SUBSAMPLING:
+ 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 1c6d342..37ecd6a 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1747,6 +1747,13 @@ enum v4l2_white_balance_preset {
#define V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
#define V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
+#define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
+enum v4l2_exposure_metering_mode {
+ 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
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Input]
[Video for Linux]
[Mplayer Users]
[Linux USB Devel]
[Linux Audio Users]
[Photos]
[Yosemite Photos]
[Linux Kernel]
[Linux SCSI]
[XFree86]
[Devices]
[Yosemite Backpacking]