summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDheeraj CVR <cvr.dheeraj@gmail.com>2013-07-18 15:38:39 -0700
committerDheeraj CVR <cvr.dheeraj@gmail.com>2013-07-18 16:41:49 -0700
commitba84fbfa8d88dd3f8c716aa5b0f4d47663f64796 (patch)
treeb305eb0628d9773a6a063037f07fbcadf7cdf7cb
parent44169ee78b775da1a93d2ae416a7cd0fc60eb6ee (diff)
downloaddevice_samsung_smdk4412-common-ba84fbfa8d88dd3f8c716aa5b0f4d47663f64796.zip
device_samsung_smdk4412-common-ba84fbfa8d88dd3f8c716aa5b0f4d47663f64796.tar.gz
device_samsung_smdk4412-common-ba84fbfa8d88dd3f8c716aa5b0f4d47663f64796.tar.bz2
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
-rw-r--r--camerawrapper/CameraWrapper.cpp24
-rw-r--r--overlay/packages/apps/Camera/res/values/config.xml6
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 @@
<!-- Samsung Camera Settings -->
<bool name="hasSamsungCamSettings">true</bool>
<!-- Use ZSL mode -->
- <bool name="enableZSL">false</bool>
- <!-- The camera HAL does its own preview state management during snaps -->
- <bool name="previewStopsDuringSnapshot">true</bool>
+ <bool name="enableZSL">true</bool>
+ <!-- Magic for enabling ZSL on Samsung cameras -->
+ <bool name="sendMagicSamsungZSLCommand">true</bool>
<!-- The camera removes the focus modes by default when touch-to-focus
exists. Use this option to change that behavior -->
<bool name="wantsFocusModes">true</bool>