3
0

Merge pull request #1 from athurh/jellybean

camera: Fix ISO speed values
This commit is contained in:
Daniel Hillenbrand 2012-08-02 11:50:43 -07:00
commit 4502a83dd1

View File

@ -91,7 +91,7 @@ static int check_vendor_module()
return rv; return rv;
} }
const static char * iso_values[] = {"auto,ISO100,ISO200,ISO400,ISO800","auto"}; const static char * iso_values[] = {"auto,ISO50,ISO100,ISO200,ISO400,ISO800","auto"};
static char * camera_fixup_getparams(int id, const char * settings) static char * camera_fixup_getparams(int id, const char * settings)
{ {
@ -99,8 +99,8 @@ static char * camera_fixup_getparams(int id, const char * settings)
params.unflatten(android::String8(settings)); params.unflatten(android::String8(settings));
// fix params here // fix params here
#warning "Reimplement KEY_SUPPORTED_ISO_MODES"
// params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]); params.set("iso-values", iso_values[id]);
android::String8 strParams = params.flatten(); android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string()); char *ret = strdup(strParams.string());
@ -114,20 +114,22 @@ char * camera_fixup_setparams(int id, const char * settings)
android::CameraParameters params; android::CameraParameters params;
params.unflatten(android::String8(settings)); params.unflatten(android::String8(settings));
/*
// fix params here // fix params here
if(params.get("iso")) {
const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE); const char* isoMode = params.get("iso");
if(strcmp(isoMode, "ISO100") == 0) if(isoMode) {
params.set(android::CameraParameters::KEY_ISO_MODE, "100"); if(!strcmp(isoMode, "ISO50"))
else if(strcmp(isoMode, "ISO200") == 0) params.set("iso", "50");
params.set(android::CameraParameters::KEY_ISO_MODE, "200"); else if(!strcmp(isoMode, "ISO100"))
else if(strcmp(isoMode, "ISO400") == 0) params.set("iso", "100");
params.set(android::CameraParameters::KEY_ISO_MODE, "400"); else if(!strcmp(isoMode, "ISO200"))
else if(strcmp(isoMode, "ISO800") == 0) params.set("iso", "200");
params.set(android::CameraParameters::KEY_ISO_MODE, "800"); else if(!strcmp(isoMode, "ISO400"))
params.set("iso", "400");
else if(!strcmp(isoMode, "ISO800"))
params.set("iso", "800");
} }
*/
android::String8 strParams = params.flatten(); android::String8 strParams = params.flatten();
char *ret = strdup(strParams.string()); char *ret = strdup(strParams.string());
@ -144,7 +146,7 @@ int camera_set_preview_window(struct camera_device * device,
{ {
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor)); ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
if(!device) if(!device || !window)
return -EINVAL; return -EINVAL;
return VENDOR_CALL(device, set_preview_window, window); return VENDOR_CALL(device, set_preview_window, window);