diff options
author | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 14:51:56 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2009-09-15 18:29:03 +0800 |
commit | 00900eb35473530a5fc77f7bd3ac306b6dcf19cb (patch) | |
tree | 50ef4d7f5da62be60d0748dba6ed6713c61d6443 /libs | |
parent | f5733b2938151fda955f01d9dc3ad15f7292604d (diff) | |
download | frameworks_native-00900eb35473530a5fc77f7bd3ac306b6dcf19cb.zip frameworks_native-00900eb35473530a5fc77f7bd3ac306b6dcf19cb.tar.gz frameworks_native-00900eb35473530a5fc77f7bd3ac306b6dcf19cb.tar.bz2 |
Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ui/Camera.cpp | 8 | ||||
-rw-r--r-- | libs/ui/ICamera.cpp | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/libs/ui/Camera.cpp b/libs/ui/Camera.cpp index 12a7725..0c6d340 100644 --- a/libs/ui/Camera.cpp +++ b/libs/ui/Camera.cpp @@ -242,6 +242,14 @@ status_t Camera::autoFocus() return c->autoFocus(); } +status_t Camera::cancelAutoFocus() +{ + LOGV("cancelAutoFocus"); + sp <ICamera> c = mCamera; + if (c == 0) return NO_INIT; + return c->cancelAutoFocus(); +} + // take a picture status_t Camera::takePicture() { diff --git a/libs/ui/ICamera.cpp b/libs/ui/ICamera.cpp index 805c2ca..fd7e084 100644 --- a/libs/ui/ICamera.cpp +++ b/libs/ui/ICamera.cpp @@ -32,6 +32,7 @@ enum { START_PREVIEW, STOP_PREVIEW, AUTO_FOCUS, + CANCEL_AUTO_FOCUS, TAKE_PICTURE, SET_PARAMETERS, GET_PARAMETERS, @@ -162,6 +163,17 @@ public: return ret; } + // cancel focus + status_t cancelAutoFocus() + { + LOGV("cancelAutoFocus"); + Parcel data, reply; + data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); + remote()->transact(CANCEL_AUTO_FOCUS, data, &reply); + status_t ret = reply.readInt32(); + return ret; + } + // take a picture - returns an IMemory (ref-counted mmap) status_t takePicture() { @@ -294,6 +306,12 @@ status_t BnCamera::onTransact( reply->writeInt32(autoFocus()); return NO_ERROR; } break; + case CANCEL_AUTO_FOCUS: { + LOGV("CANCEL_AUTO_FOCUS"); + CHECK_INTERFACE(ICamera, data, reply); + reply->writeInt32(cancelAutoFocus()); + return NO_ERROR; + } break; case TAKE_PICTURE: { LOGV("TAKE_PICTURE"); CHECK_INTERFACE(ICamera, data, reply); |