diff options
| author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2012-04-30 03:34:10 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 13:24:24 -0400 |
| commit | cf072139c7952e267a2eff334f224a62c949ee96 (patch) | |
| tree | 9e793840d43b70152f506a43fe7e06ee97e7f524 | |
| parent | 7f84ad8bdb63a8bfcbb83755e487e06be5db54cf (diff) | |
[media] V4L: Add camera exposure metering control
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>
| -rw-r--r-- | Documentation/DocBook/media/v4l/controls.xml | 29 | ||||
| -rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 10 | ||||
| -rw-r--r-- | include/linux/videodev2.h | 7 |
3 files changed, 46 insertions, 0 deletions
diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 8fccfe1b2058..e8c63e04741f 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> | |||
| 2864 | </row> | 2864 | </row> |
| 2865 | <row><entry></entry></row> | 2865 | <row><entry></entry></row> |
| 2866 | 2866 | ||
| 2867 | <row id="v4l2-exposure-metering"> | ||
| 2868 | <entry spanname="id"><constant>V4L2_CID_EXPOSURE_METERING</constant> </entry> | ||
| 2869 | <entry>enum v4l2_exposure_metering</entry> | ||
| 2870 | </row><row><entry spanname="descr">Determines how the camera measures | ||
| 2871 | the amount of light available for the frame exposure. Possible values are:</entry> | ||
| 2872 | </row> | ||
| 2873 | <row> | ||
| 2874 | <entrytbl spanname="descr" cols="2"> | ||
| 2875 | <tbody valign="top"> | ||
| 2876 | <row> | ||
| 2877 | <entry><constant>V4L2_EXPOSURE_METERING_AVERAGE</constant> </entry> | ||
| 2878 | <entry>Use the light information coming from the entire frame | ||
| 2879 | and average giving no weighting to any particular portion of the metered area. | ||
| 2880 | </entry> | ||
| 2881 | </row> | ||
| 2882 | <row> | ||
| 2883 | <entry><constant>V4L2_EXPOSURE_METERING_CENTER_WEIGHTED</constant> </entry> | ||
| 2884 | <entry>Average the light information coming from the entire frame | ||
| 2885 | giving priority to the center of the metered area.</entry> | ||
| 2886 | </row> | ||
| 2887 | <row> | ||
| 2888 | <entry><constant>V4L2_EXPOSURE_METERING_SPOT</constant> </entry> | ||
| 2889 | <entry>Measure only very small area at the center of the frame.</entry> | ||
| 2890 | </row> | ||
| 2891 | </tbody> | ||
| 2892 | </entrytbl> | ||
| 2893 | </row> | ||
| 2894 | <row><entry></entry></row> | ||
| 2895 | |||
| 2867 | <row> | 2896 | <row> |
| 2868 | <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant> </entry> | 2897 | <entry spanname="id"><constant>V4L2_CID_PAN_RELATIVE</constant> </entry> |
| 2869 | <entry>integer</entry> | 2898 | <entry>integer</entry> |
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index debaf9fb9004..55dd813b7341 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) | |||
| 230 | "Aperture Priority Mode", | 230 | "Aperture Priority Mode", |
| 231 | NULL | 231 | NULL |
| 232 | }; | 232 | }; |
| 233 | static const char * const camera_exposure_metering[] = { | ||
| 234 | "Average", | ||
| 235 | "Center Weighted", | ||
| 236 | "Spot", | ||
| 237 | NULL | ||
| 238 | }; | ||
| 233 | static const char * const colorfx[] = { | 239 | static const char * const colorfx[] = { |
| 234 | "None", | 240 | "None", |
| 235 | "Black & White", | 241 | "Black & White", |
| @@ -434,6 +440,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) | |||
| 434 | return camera_power_line_frequency; | 440 | return camera_power_line_frequency; |
| 435 | case V4L2_CID_EXPOSURE_AUTO: | 441 | case V4L2_CID_EXPOSURE_AUTO: |
| 436 | return camera_exposure_auto; | 442 | return camera_exposure_auto; |
| 443 | case V4L2_CID_EXPOSURE_METERING: | ||
| 444 | return camera_exposure_metering; | ||
| 437 | case V4L2_CID_COLORFX: | 445 | case V4L2_CID_COLORFX: |
| 438 | return colorfx; | 446 | return colorfx; |
| 439 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: | 447 | case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE: |
| @@ -632,6 +640,7 @@ const char *v4l2_ctrl_get_name(u32 id) | |||
| 632 | case V4L2_CID_IMAGE_STABILIZATION: return "Image Stabilization"; | 640 | case V4L2_CID_IMAGE_STABILIZATION: return "Image Stabilization"; |
| 633 | case V4L2_CID_ISO_SENSITIVITY: return "ISO Sensitivity"; | 641 | case V4L2_CID_ISO_SENSITIVITY: return "ISO Sensitivity"; |
| 634 | case V4L2_CID_ISO_SENSITIVITY_AUTO: return "ISO Sensitivity, Auto"; | 642 | case V4L2_CID_ISO_SENSITIVITY_AUTO: return "ISO Sensitivity, Auto"; |
| 643 | case V4L2_CID_EXPOSURE_METERING: return "Exposure, Metering Mode"; | ||
| 635 | 644 | ||
| 636 | /* FM Radio Modulator control */ | 645 | /* FM Radio Modulator control */ |
| 637 | /* Keep the order of the 'case's the same as in videodev2.h! */ | 646 | /* 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, | |||
| 783 | case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE: | 792 | case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE: |
| 784 | case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: | 793 | case V4L2_CID_JPEG_CHROMA_SUBSAMPLING: |
| 785 | case V4L2_CID_ISO_SENSITIVITY_AUTO: | 794 | case V4L2_CID_ISO_SENSITIVITY_AUTO: |
| 795 | case V4L2_CID_EXPOSURE_METERING: | ||
| 786 | *type = V4L2_CTRL_TYPE_MENU; | 796 | *type = V4L2_CTRL_TYPE_MENU; |
| 787 | break; | 797 | break; |
| 788 | case V4L2_CID_LINK_FREQ: | 798 | case V4L2_CID_LINK_FREQ: |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 593a1bd33111..a3e47ad60a6d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -1733,6 +1733,13 @@ enum v4l2_iso_sensitivity_auto_type { | |||
| 1733 | V4L2_ISO_SENSITIVITY_AUTO = 1, | 1733 | V4L2_ISO_SENSITIVITY_AUTO = 1, |
| 1734 | }; | 1734 | }; |
| 1735 | 1735 | ||
| 1736 | #define V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25) | ||
| 1737 | enum v4l2_exposure_metering { | ||
| 1738 | V4L2_EXPOSURE_METERING_AVERAGE = 0, | ||
| 1739 | V4L2_EXPOSURE_METERING_CENTER_WEIGHTED = 1, | ||
| 1740 | V4L2_EXPOSURE_METERING_SPOT = 2, | ||
| 1741 | }; | ||
| 1742 | |||
| 1736 | /* FM Modulator class control IDs */ | 1743 | /* FM Modulator class control IDs */ |
| 1737 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) | 1744 | #define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) |
| 1738 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) | 1745 | #define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) |
