diff options
author | Tyler Luu <tluu@ti.com> | 2011-11-16 16:05:22 -0600 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-11-16 14:34:20 -0800 |
commit | 2ede94fc726e7dcd3d0ca4936efa3386d403f99c (patch) | |
tree | 64804af2272a2be09f5eacad6c77ddfa2b20baae | |
parent | 539c11b66bd98f9f0b199361db1e022a9417584c (diff) | |
download | hardware_ti_omap4-2ede94fc726e7dcd3d0ca4936efa3386d403f99c.zip hardware_ti_omap4-2ede94fc726e7dcd3d0ca4936efa3386d403f99c.tar.gz hardware_ti_omap4-2ede94fc726e7dcd3d0ca4936efa3386d403f99c.tar.bz2 |
CameraHal: Use Different Timeout for Video Mode
Select AF timeout based on whether or not we are in
video mode.
b/5492725
Change-Id: I2fa722e6a3a7c149488ddb29ce44262914d19e38
Signed-off-by: Tyler Luu <tluu@ti.com>
-rw-r--r-- | camera/OMXCameraAdapter/OMXFocus.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/camera/OMXCameraAdapter/OMXFocus.cpp b/camera/OMXCameraAdapter/OMXFocus.cpp index ce569ec..30ce3c1 100644 --- a/camera/OMXCameraAdapter/OMXFocus.cpp +++ b/camera/OMXCameraAdapter/OMXFocus.cpp @@ -31,7 +31,8 @@ #include "ErrorUtils.h" #define TOUCH_FOCUS_RANGE 0xFF -#define AF_CALLBACK_TIMEOUT 5000000 //5 seconds timeout +#define AF_IMAGE_CALLBACK_TIMEOUT 5000000 //5 seconds timeout +#define AF_VIDEO_CALLBACK_TIMEOUT 2800000 //2.8 seconds timeout namespace android { @@ -83,6 +84,7 @@ status_t OMXCameraAdapter::doAutoFocus() OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE focusControl; OMX_PARAM_FOCUSSTATUSTYPE focusStatus; OMX_CONFIG_BOOLEANTYPE bOMX; + int timeout = 0; LOG_FUNCTION_NAME; @@ -182,7 +184,10 @@ status_t OMXCameraAdapter::doAutoFocus() CAMHAL_LOGDA("Autofocus started successfully"); } - if(mDoAFSem.WaitTimeout(AF_CALLBACK_TIMEOUT) != NO_ERROR) { + // configure focus timeout based on capture mode + timeout = (mCapMode == VIDEO_MODE) ? AF_VIDEO_CALLBACK_TIMEOUT : AF_IMAGE_CALLBACK_TIMEOUT; + + if(mDoAFSem.WaitTimeout(timeout) != NO_ERROR) { //If somethiing bad happened while we wait if (mComponentState == OMX_StateInvalid) { CAMHAL_LOGEA("Invalid State after Auto Focus Exitting!!!"); @@ -196,7 +201,6 @@ status_t OMXCameraAdapter::doAutoFocus() NULL ); returnFocusStatus(true); } else { - ret = returnFocusStatus(false); } } else { // Focus mode in continuous |