summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorEspen Fjellvær Olsen <espen@mrfjo.org>2013-02-24 13:38:28 +0100
committerEspen Fjellvær Olsen <espen@mrfjo.org>2013-02-24 13:51:12 +0100
commitaa46ea0b54f153643a26f3e2ed60843d4a390e9e (patch)
treeaf59a723970052a7f621003c920108bbe0be09d4 /camera
parentc06391932856ff5cef12aa2d7083e0d34e7dac3d (diff)
downloaddevice_samsung_galaxys2-common-aa46ea0b54f153643a26f3e2ed60843d4a390e9e.zip
device_samsung_galaxys2-common-aa46ea0b54f153643a26f3e2ed60843d4a390e9e.tar.gz
device_samsung_galaxys2-common-aa46ea0b54f153643a26f3e2ed60843d4a390e9e.tar.bz2
Update focus behaviour to match Samsungs
Thanks to angelsl Change-Id: I9d2a12a818fce1ca88e635c03fb4fdeaab45bad4
Diffstat (limited to 'camera')
-rw-r--r--camera/exynos_camera.c26
-rw-r--r--camera/exynos_camera.h5
2 files changed, 13 insertions, 18 deletions
diff --git a/camera/exynos_camera.c b/camera/exynos_camera.c
index 2c8903c..9608214 100644
--- a/camera/exynos_camera.c
+++ b/camera/exynos_camera.c
@@ -1601,21 +1601,17 @@ void *exynos_camera_auto_focus_thread(void *data)
goto thread_exit;
}
- switch (auto_focus_status) {
- case M5MO_AF_STATUS_IN_PROGRESS:
- usleep(500);
- break;
- case M5MO_AF_STATUS_SUCCESS:
- case M5MO_AF_STATUS_1ST_SUCCESS:
- auto_focus_result = 1;
- pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
- goto thread_exit;
- case M5MO_AF_STATUS_FAIL:
- default:
- ALOGE("AF failed or unknown result flag: 0x%x", auto_focus_status);
- auto_focus_result = 0;
- pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
- goto thread_exit;
+ if (auto_focus_status & M5MO_AF_STATUS_IN_PROGRESS) { // Progress
+ usleep(10000); // Sleep 10 ms
+ } else if (auto_focus_status == M5MO_AF_STATUS_SUCCESS || auto_focus_status == M5MO_AF_STATUS_1ST_SUCCESS) { // Success
+ auto_focus_result = 1;
+ pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
+ goto thread_exit;
+ } else {
+ auto_focus_result = 0;
+ ALOGE("AF failed or unknown result flag: 0x%x", auto_focus_status);
+ pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
+ goto thread_exit;
}
pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
diff --git a/camera/exynos_camera.h b/camera/exynos_camera.h
index 6e1fee6..7ba0e48 100644
--- a/camera/exynos_camera.h
+++ b/camera/exynos_camera.h
@@ -48,10 +48,9 @@
enum m5mo_af_status {
M5MO_AF_STATUS_FAIL = 0,
+ M5MO_AF_STATUS_IN_PROGRESS,
M5MO_AF_STATUS_SUCCESS,
- M5MO_AF_STATUS_1ST_SUCCESS,
- M5MO_AF_STATUS_IN_PROGRESS = 5,
- M5MO_AF_STATUS_MAX,
+ M5MO_AF_STATUS_1ST_SUCCESS = 4,
};
struct list_head {