From ce0b82326432e5694d8d7e5bf5f005aecf70b621 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sun, 8 Jul 2012 08:37:49 +0200 Subject: camera: add ISO support Change-Id: I0a6c8fa3c9546b8275ace7f9dc5509aa94f7956e --- BoardConfig.mk | 3 +++ camerawrapper/CameraWrapper.cpp | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/BoardConfig.mk b/BoardConfig.mk index 64f88ca..63d39b1 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -88,6 +88,9 @@ BOARD_USES_FIMGAPI := true #BOARD_HDMI_STD := STD_1080P #BOARD_HDMI_DDC_CH := DDC_CH_I2C_2 +# Camera +COMMON_GLOBAL_CFLAGS += -DSAMSUNG_CAMERA_HARDWARE + # OMX BOARD_HAVE_CODEC_SUPPORT := SAMSUNG_CODEC_SUPPORT COMMON_GLOBAL_CFLAGS += -DSAMSUNG_CODEC_SUPPORT diff --git a/camerawrapper/CameraWrapper.cpp b/camerawrapper/CameraWrapper.cpp index 759b265..d4661a0 100644 --- a/camerawrapper/CameraWrapper.cpp +++ b/camerawrapper/CameraWrapper.cpp @@ -91,10 +91,7 @@ static int check_vendor_module() return rv; } -const static char * video_preview_sizes[] = { - "1920x1080,1280x720,640x480", - "640x480,352x288,320x240,176x144" -}; +const static char * iso_values[] = {"auto,ISO100,ISO200,ISO400,ISO800","auto"}; static char * camera_fixup_getparams(int id, const char * settings) { @@ -102,6 +99,7 @@ static char * camera_fixup_getparams(int id, const char * settings) params.unflatten(android::String8(settings)); // fix params here + params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]); android::String8 strParams = params.flatten(); char *ret = strdup(strParams.string()); @@ -116,6 +114,17 @@ char * camera_fixup_setparams(int id, const char * settings) params.unflatten(android::String8(settings)); // fix params here + if(params.get("iso")) { + const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE); + if(strcmp(isoMode, "ISO100") == 0) + params.set(android::CameraParameters::KEY_ISO_MODE, "100"); + else if(strcmp(isoMode, "ISO200") == 0) + params.set(android::CameraParameters::KEY_ISO_MODE, "200"); + else if(strcmp(isoMode, "ISO400") == 0) + params.set(android::CameraParameters::KEY_ISO_MODE, "400"); + else if(strcmp(isoMode, "ISO800") == 0) + params.set(android::CameraParameters::KEY_ISO_MODE, "800"); + } android::String8 strParams = params.flatten(); char *ret = strdup(strParams.string()); -- cgit v1.1