summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-10-13 16:08:18 +0800
committerWu-cheng Li <wuchengli@google.com>2011-10-18 00:09:41 +0800
commitf7ae987b696b2d775bae81899fb7dcb3b6622176 (patch)
tree1a66f8a3023e61e7d36e916fa4c8b00da75d78fe /libcamera
parent32e19f3fd71505c1c48e4412131b912310998bae (diff)
downloaddevice_samsung_crespo-f7ae987b696b2d775bae81899fb7dcb3b6622176.zip
device_samsung_crespo-f7ae987b696b2d775bae81899fb7dcb3b6622176.tar.gz
device_samsung_crespo-f7ae987b696b2d775bae81899fb7dcb3b6622176.tar.bz2
Fix cancelAutoFocus failure if native window is not set.
cancelAutoFocus should be allowed after preview is started. But if the preview is deferred, cancelAutoFocus will fail. Ignore it if that is the case. bug:5397951 Change-Id: I59a73add90bd057d7f44d88518b74d932991f21a
Diffstat (limited to 'libcamera')
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp
index 875fbcd..6e9ff8b 100755
--- a/libcamera/SecCameraHWInterface.cpp
+++ b/libcamera/SecCameraHWInterface.cpp
@@ -908,6 +908,11 @@ status_t CameraHardwareSec::cancelAutoFocus()
{
LOGV("%s :", __func__);
+ // cancelAutoFocus should be allowed after preview is started. But if
+ // the preview is deferred, cancelAutoFocus will fail. Ignore it if that is
+ // the case.
+ if (mPreviewRunning && mPreviewStartDeferred) return NO_ERROR;
+
if (mSecCamera->cancelAutofocus() < 0) {
LOGE("ERR(%s):Fail on mSecCamera->cancelAutofocus()", __func__);
return UNKNOWN_ERROR;