3
0
Fork 0

Update focus behaviour to match Samsungs

Thanks to angelsl

Change-Id: I9d2a12a818fce1ca88e635c03fb4fdeaab45bad4
This commit is contained in:
Espen Fjellvær Olsen 2013-02-24 13:38:28 +01:00
parent c063919328
commit aa46ea0b54
2 changed files with 13 additions and 18 deletions

View File

@ -1601,21 +1601,17 @@ void *exynos_camera_auto_focus_thread(void *data)
goto thread_exit; goto thread_exit;
} }
switch (auto_focus_status) { if (auto_focus_status & M5MO_AF_STATUS_IN_PROGRESS) { // Progress
case M5MO_AF_STATUS_IN_PROGRESS: usleep(10000); // Sleep 10 ms
usleep(500); } else if (auto_focus_status == M5MO_AF_STATUS_SUCCESS || auto_focus_status == M5MO_AF_STATUS_1ST_SUCCESS) { // Success
break; auto_focus_result = 1;
case M5MO_AF_STATUS_SUCCESS: pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
case M5MO_AF_STATUS_1ST_SUCCESS: goto thread_exit;
auto_focus_result = 1; } else {
pthread_mutex_unlock(&exynos_camera->auto_focus_mutex); auto_focus_result = 0;
goto thread_exit; ALOGE("AF failed or unknown result flag: 0x%x", auto_focus_status);
case M5MO_AF_STATUS_FAIL: pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);
default: goto thread_exit;
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;
} }
pthread_mutex_unlock(&exynos_camera->auto_focus_mutex); pthread_mutex_unlock(&exynos_camera->auto_focus_mutex);

View File

@ -48,10 +48,9 @@
enum m5mo_af_status { enum m5mo_af_status {
M5MO_AF_STATUS_FAIL = 0, M5MO_AF_STATUS_FAIL = 0,
M5MO_AF_STATUS_IN_PROGRESS,
M5MO_AF_STATUS_SUCCESS, M5MO_AF_STATUS_SUCCESS,
M5MO_AF_STATUS_1ST_SUCCESS, M5MO_AF_STATUS_1ST_SUCCESS = 4,
M5MO_AF_STATUS_IN_PROGRESS = 5,
M5MO_AF_STATUS_MAX,
}; };
struct list_head { struct list_head {