[media] V4L: Add camera exposure metering control
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 30 Apr 2012 07:34:10 +0000 (04:34 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 14 May 2012 17:24:24 +0000 (14:24 -0300)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Documentation/DocBook/media/v4l/controls.xml
drivers/media/video/v4l2-ctrls.c
include/linux/videodev2.h

index 8fccfe1b20582a4130926a15f9248ccb10fe1e84..e8c63e04741f3968fe02601bca363ae2211f5852 100644 (file)
@@ -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>
index debaf9fb90047b5d892cb1ea9c754515093b34ad..55dd813b734102a6cad6164fbcfd32dc09bdb421 100644 (file)
@@ -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! */
@@ -783,6 +792,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_LINK_FREQ:
index 593a1bd33111b3ff1dd2257248fb54d81d09fd61..a3e47ad60a6d2b040382b6044d08d3eaaeb577b1 100644 (file)
@@ -1733,6 +1733,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)