diff options
author | Tyler Luu <tluu@ti.com> | 2011-11-17 07:48:03 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-11-17 07:48:03 -0800 |
commit | e49b758f8e7b209b9ddc4d00b28b96e125b02f15 (patch) | |
tree | d43d47ce08ba6e06ac93ea9a0ddbd782faa68784 /camera | |
parent | f1362dafe7efc1c44711e1e275d2faa11ad44c3f (diff) | |
parent | b5375cf2e7f917556b377be4ec0974f7c62dbe0d (diff) | |
download | hardware_ti_omap4xxx-e49b758f8e7b209b9ddc4d00b28b96e125b02f15.zip hardware_ti_omap4xxx-e49b758f8e7b209b9ddc4d00b28b96e125b02f15.tar.gz hardware_ti_omap4xxx-e49b758f8e7b209b9ddc4d00b28b96e125b02f15.tar.bz2 |
am b5375cf2: am 05ea07df: CameraHal: Use Different Timeout for Video Mode
* commit 'b5375cf2e7f917556b377be4ec0974f7c62dbe0d':
CameraHal: Use Different Timeout for Video Mode
Diffstat (limited to 'camera')
-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 |