From ba84fbfa8d88dd3f8c716aa5b0f4d47663f64796 Mon Sep 17 00:00:00 2001 From: Dheeraj CVR Date: Thu, 18 Jul 2013 15:38:39 -0700 Subject: smdk4412-common: camera: fixes for camerawrapper 1. Enable ZSL Mode on both the cameras. Use Samsung Magic Command. 2. Remove workarounds that were meant for smdk4120. These are no longer required on smdk4412. Fixes ZSL and Face Detection. 3. Force release the camera when the preview is stopped to prevent issues with camera freezes that would require device reboots. 4. Disable Verbose logging to prevent spam during recording. Change-Id: If50e6ec55a28653c8f81896e1b542e2e8cf75b07 --- camerawrapper/CameraWrapper.cpp | 24 +++++++--------------- overlay/packages/apps/Camera/res/values/config.xml | 6 +++--- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/camerawrapper/CameraWrapper.cpp b/camerawrapper/CameraWrapper.cpp index 6a86290..29f848e 100644 --- a/camerawrapper/CameraWrapper.cpp +++ b/camerawrapper/CameraWrapper.cpp @@ -22,7 +22,7 @@ */ -#define LOG_NDEBUG 0 +#define LOG_NDEBUG 1 //#define LOG_PARAMETERS #define LOG_TAG "CameraWrapper" @@ -223,6 +223,9 @@ void camera_stop_preview(struct camera_device * device) if(!device) return; + // Workaround for camera freezes + VENDOR_CALL(device, send_command, 7, 0, 0); + VENDOR_CALL(device, stop_preview); } @@ -314,11 +317,7 @@ int camera_cancel_auto_focus(struct camera_device * device) if(!device) return -EINVAL; - // Samsung camera HAL restarts focus (CAF_RESTART) when we cancel auto focus. - // Cancel auto focus is called just before pic is taken in autofocus mode, thus - // the HAL crashes. - return 0; - //return VENDOR_CALL(device, cancel_auto_focus); + return VENDOR_CALL(device, cancel_auto_focus); } int camera_take_picture(struct camera_device * device) @@ -329,13 +328,7 @@ int camera_take_picture(struct camera_device * device) if(!device) return -EINVAL; - // We safely avoid returning the exact result of VENDOR_CALL here. If ZSL - // really bumps fast, take_picture will be called while a picture is already being - // taken, leading to "picture already running" error, crashing Gallery app. Afaik, - // there is no issue doing 0 (error appears in logcat anyway if needed). - VENDOR_CALL(device, take_picture); - - return 0; + return VENDOR_CALL(device, take_picture); } int camera_cancel_picture(struct camera_device * device) @@ -411,10 +404,7 @@ int camera_send_command(struct camera_device * device, if(!device) return -EINVAL; - /* send_command causes the camera hal do to unexpected things like lockups. - * don't pass any command to the vendor hal to prevent this */ - return 0; - //return VENDOR_CALL(device, send_command, cmd, arg1, arg2); + return VENDOR_CALL(device, send_command, cmd, arg1, arg2); } void camera_release(struct camera_device * device) diff --git a/overlay/packages/apps/Camera/res/values/config.xml b/overlay/packages/apps/Camera/res/values/config.xml index b9ec76b..9eb7a07 100644 --- a/overlay/packages/apps/Camera/res/values/config.xml +++ b/overlay/packages/apps/Camera/res/values/config.xml @@ -27,9 +27,9 @@ true - false - - true + true + + true true -- cgit v1.1