summaryrefslogtreecommitdiffstats
path: root/libcamera/SecCamera.cpp
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2011-12-18 10:40:47 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2011-12-18 10:40:47 +0700
commitfca72a33c2578915a5ccb3957e918a398d9b0cbf (patch)
tree79d964702fb54d2b73324bb70b27cc6dc986de70 /libcamera/SecCamera.cpp
parent299715ec9ea61e01cec10fb965b4e25b5e7571dc (diff)
downloaddevice_samsung_aries-common-fca72a33c2578915a5ccb3957e918a398d9b0cbf.zip
device_samsung_aries-common-fca72a33c2578915a5ccb3957e918a398d9b0cbf.tar.gz
device_samsung_aries-common-fca72a33c2578915a5ccb3957e918a398d9b0cbf.tar.bz2
Revert "Camera: move AF polling code from driver into HAL"
This reverts commit 3b869ce2ba1cc91c0acdcc8355a8499fc443e8a3.
Diffstat (limited to 'libcamera/SecCamera.cpp')
-rwxr-xr-xlibcamera/SecCamera.cpp35
1 files changed, 3 insertions, 32 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp
index cfa0075..b064227 100755
--- a/libcamera/SecCamera.cpp
+++ b/libcamera/SecCamera.cpp
@@ -1649,41 +1649,12 @@ int SecCamera::setAutofocus(void)
int SecCamera::getAutoFocusResult(void)
{
- int af_result, count, ret;
+ int af_result;
- for (count = 0; count < FIRST_AF_SEARCH_COUNT; count++) {
- ret = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_CAMERA_AUTO_FOCUS_RESULT_FIRST);
- if (ret != AF_PROGRESS)
- break;
- usleep(AF_DELAY);
- }
- if ((count >= FIRST_AF_SEARCH_COUNT) || (ret != AF_SUCCESS)) {
- LOGV("%s : 1st AF timed out, failed, or was canceled", __func__);
- af_result = 0;
- goto finish_auto_focus;
- }
+ af_result = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_CAMERA_AUTO_FOCUS_RESULT);
- for (count = 0; count < SECOND_AF_SEARCH_COUNT; count++) {
- ret = fimc_v4l2_g_ctrl(m_cam_fd, V4L2_CID_CAMERA_AUTO_FOCUS_RESULT_SECOND);
- /* low byte is garbage. done when high byte is 0x0 */
- if (!(ret & 0xff00))
- break;
- usleep(AF_DELAY);
- }
- if (count >= SECOND_AF_SEARCH_COUNT) {
- LOGV("%s : 2nd AF timed out, failed, or was canceled", __func__);
- af_result = 0;
- goto finish_auto_focus;
- }
-
- af_result = 1;
- LOGV("%s : AF was successful, returning %d", __func__, af_result);
+ LOGV("%s : returning %d", __func__, af_result);
-finish_auto_focus:
- if (fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_FINISH_AUTO_FOCUS, 0) < 0) {
- LOGE("ERR(%s):Fail on V4L2_CID_CAMERA_SET_PRE_FLASH", __func__);
- return -1;
- }
return af_result;
}