summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinclude/videodev2_samsung.h5
-rwxr-xr-xlibcamera/SecCamera.cpp35
-rw-r--r--[-rwxr-xr-x]libcamera/SecCamera.h7
3 files changed, 4 insertions, 43 deletions
diff --git a/include/videodev2_samsung.h b/include/videodev2_samsung.h
index 0d4dcc9..0a7d7c3 100755
--- a/include/videodev2_samsung.h
+++ b/include/videodev2_samsung.h
@@ -431,10 +431,7 @@ enum v4l2_caf_start_stop {
CAF_MAX,
};
-#define V4L2_CID_CAMERA_AUTO_FOCUS_RESULT_FIRST (V4L2_CID_PRIVATE_BASE + 103)
-#define V4L2_CID_CAMERA_AUTO_FOCUS_RESULT_SECOND (V4L2_CID_PRIVATE_BASE + 120)
-#define V4L2_CID_CAMERA_FINISH_AUTO_FOCUS (V4L2_CID_PRIVATE_BASE + 121)
-
+#define V4L2_CID_CAMERA_AUTO_FOCUS_RESULT (V4L2_CID_PRIVATE_BASE + 103)
#define V4L2_CID_CAMERA_FRAME_RATE (V4L2_CID_PRIVATE_BASE + 104)
enum v4l2_frame_rate {
FRAME_RATE_AUTO = 0,
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;
}
diff --git a/libcamera/SecCamera.h b/libcamera/SecCamera.h
index cc36a74..9c3bf2d 100755..100644
--- a/libcamera/SecCamera.h
+++ b/libcamera/SecCamera.h
@@ -147,13 +147,6 @@ namespace android {
#define BPP 2
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX_BUFFERS 9 // 11
-
-#define FIRST_AF_SEARCH_COUNT 80
-#define SECOND_AF_SEARCH_COUNT 80
-#define AF_PROGRESS 0x01
-#define AF_SUCCESS 0x02
-#define AF_DELAY 50000
-
/*
* V 4 L 2 F I M C E X T E N S I O N S
*