diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-08-14 11:37:00 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-08-23 14:08:27 -0700 |
commit | abaa51d3ca31f0eda99e1d271e6dc64c877dbf58 (patch) | |
tree | 52f4cc1078708f7c0099fded06dcb01daf6ca6bb /services/camera/libcameraservice/api2 | |
parent | 62c1a46eec047eb5fbc4b90432ec1ce65b76fb75 (diff) | |
download | frameworks_av-abaa51d3ca31f0eda99e1d271e6dc64c877dbf58.zip frameworks_av-abaa51d3ca31f0eda99e1d271e6dc64c877dbf58.tar.gz frameworks_av-abaa51d3ca31f0eda99e1d271e6dc64c877dbf58.tar.bz2 |
Camera2: Add flush support
- On HAL2 devices, fall back to wait until idle
- On HAL3 devices, call HAL flush method
Bug: 9758581
Change-Id: Ie1c570a15f6590a1ee6c271e3b989c48079b468a
Diffstat (limited to 'services/camera/libcameraservice/api2')
-rw-r--r-- | services/camera/libcameraservice/api2/CameraDeviceClient.cpp | 14 | ||||
-rw-r--r-- | services/camera/libcameraservice/api2/CameraDeviceClient.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index 414316d..289ba06 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -436,6 +436,20 @@ status_t CameraDeviceClient::waitUntilIdle() return res; } +status_t CameraDeviceClient::flush() { + ATRACE_CALL(); + ALOGV("%s", __FUNCTION__); + + status_t res = OK; + if ( (res = checkPid(__FUNCTION__) ) != OK) return res; + + Mutex::Autolock icl(mBinderSerializationLock); + + if (!mDevice.get()) return DEAD_OBJECT; + + return mDevice->flush(); +} + status_t CameraDeviceClient::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("CameraDeviceClient[%d] (%p) PID: %d, dump:\n", diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.h b/services/camera/libcameraservice/api2/CameraDeviceClient.h index 21d633c..c6b6336 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.h +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.h @@ -89,6 +89,10 @@ public: // Wait until all the submitted requests have finished processing virtual status_t waitUntilIdle(); + + // Flush all active and pending requests as fast as possible + virtual status_t flush(); + /** * Interface used by CameraService */ |