summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-12-27 10:57:44 -0800
committerZhijun He <zhijunhe@google.com>2014-01-23 17:59:16 -0800
commit491e341211b4772c75f719158f6b397e1c40497d (patch)
treee37d5b8aef9e6d841cac0e696853be3923bc3f08 /services/camera/libcameraservice
parentc69b91ceae6255e41c5413796fb0ed4f7af45b15 (diff)
downloadframeworks_av-491e341211b4772c75f719158f6b397e1c40497d.zip
frameworks_av-491e341211b4772c75f719158f6b397e1c40497d.tar.gz
frameworks_av-491e341211b4772c75f719158f6b397e1c40497d.tar.bz2
Camera3: Flush device before ZSL reprocess
Call flush before sending ZSL reprocess request. This not only ensures no in-flight requests pending in the HAL before ZSL reprocess request, but also makes reprocess request to be processed by the HAL sooner. Bug: 12230973 Change-Id: I4c9e5a0fb75ccdc1e8861262c08d599d04170b7f
Diffstat (limited to 'services/camera/libcameraservice')
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp9
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp9
2 files changed, 17 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
index 776ebe2..e17d05d 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
@@ -273,6 +273,15 @@ status_t ZslProcessor3::pushToReprocess(int32_t requestId) {
return INVALID_OPERATION;
}
+ // Flush device to clear out all in-flight requests pending in HAL.
+ res = client->getCameraDevice()->flush();
+ if (res != OK) {
+ ALOGE("%s: Camera %d: Failed to flush device: "
+ "%s (%d)",
+ __FUNCTION__, client->getCameraId(), strerror(-res), res);
+ return res;
+ }
+
// Update JPEG settings
{
SharedParameters::Lock l(client->getParameters());
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index edb77aa..3c73e17 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -1124,7 +1124,14 @@ status_t Camera3Device::flush() {
Mutex::Autolock l(mLock);
mRequestThread->clear();
- return mHal3Device->ops->flush(mHal3Device);
+ status_t res;
+ if (mHal3Device->common.version >= CAMERA_DEVICE_API_VERSION_3_1) {
+ res = mHal3Device->ops->flush(mHal3Device);
+ } else {
+ res = waitUntilDrained();
+ }
+
+ return res;
}
/**