diff options
author | Zhijun He <zhijunhe@google.com> | 2014-03-25 01:08:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-03-25 01:08:25 +0000 |
commit | d6d1883f607d40be5d9a87909ae563cf94256c24 (patch) | |
tree | db522970675c8149535f004910e73bb161871f4e /services/camera/libcameraservice/device3 | |
parent | 32ce52b01dab863f2b4749e1c69f619cf820486f (diff) | |
parent | 69a374897392c8bd70f441b7284f6f578c651ec9 (diff) | |
download | frameworks_av-d6d1883f607d40be5d9a87909ae563cf94256c24.zip frameworks_av-d6d1883f607d40be5d9a87909ae563cf94256c24.tar.gz frameworks_av-d6d1883f607d40be5d9a87909ae563cf94256c24.tar.bz2 |
Merge "Camera3: Fix flush call deadlock"
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.cpp | 6 | ||||
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3Device.h | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index cc192c8..51dcb89 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -999,6 +999,10 @@ status_t Camera3Device::waitUntilDrained() { Mutex::Autolock il(mInterfaceLock); Mutex::Autolock l(mLock); + return waitUntilDrainedLocked(); +} + +status_t Camera3Device::waitUntilDrainedLocked() { switch (mStatus) { case STATUS_UNINITIALIZED: case STATUS_UNCONFIGURED: @@ -1209,7 +1213,7 @@ status_t Camera3Device::flush() { if (mHal3Device->common.version >= CAMERA_DEVICE_API_VERSION_3_1) { res = mHal3Device->ops->flush(mHal3Device); } else { - res = waitUntilDrained(); + res = waitUntilDrainedLocked(); } return res; diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h index 44c6260..7ea8bcf 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.h +++ b/services/camera/libcameraservice/device3/Camera3Device.h @@ -246,6 +246,13 @@ class Camera3Device : status_t waitUntilStateThenRelock(bool active, nsecs_t timeout); /** + * Implementation of waitUntilDrained. On success, will transition to IDLE state. + * + * Need to be called with mLock and mInterfaceLock held. + */ + status_t waitUntilDrainedLocked(); + + /** * Do common work for setting up a streaming or single capture request. * On success, will transition to ACTIVE if in IDLE. */ |