summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-11-25 22:41:14 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-25 22:41:15 +0000
commit512dd849d0ef9e9988fedfbaf951b4b82523957c (patch)
tree00235660c86a2494c245b51084ea13cbc51e11d0
parentb2cf160fef5071183d52ad85b49892e23b790e8a (diff)
parent31867b30d3144decd42de0214d8b71c45a2c8cc1 (diff)
downloadframeworks_av-512dd849d0ef9e9988fedfbaf951b4b82523957c.zip
frameworks_av-512dd849d0ef9e9988fedfbaf951b4b82523957c.tar.gz
frameworks_av-512dd849d0ef9e9988fedfbaf951b4b82523957c.tar.bz2
Merge "camera: fix frame deletion logic in mInFlightMap" into lmp-mr1-dev
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 6a7f9e7..5281ea6 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -2028,8 +2028,12 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) {
// Check if everything has arrived for this result (buffers and metadata), remove it from
// InFlightMap if both arrived or HAL reports error for this request (i.e. during flush).
- if ((request.requestStatus != OK) ||
- (request.haveResultMetadata && request.numBuffersLeft == 0)) {
+ // For per-frame error notifications, camera3.h requirements state that all the
+ // buffer handles for a failed frame capture must be returned via process_capture_result()
+ // call(s). Hence, Camera3Device needs to ensure that the frame entry is not deleted from
+ // mInFlightMap until all buffers for that frame have been returned by HAL.
+ if ((request.numBuffersLeft == 0) &&
+ ((request.requestStatus != OK) || (request.haveResultMetadata))) {
ATRACE_ASYNC_END("frame capture", frameNumber);
mInFlightMap.removeItemsAt(idx, 1);
}