summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/device3
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-10-03 23:05:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-03 23:05:42 +0000
commit19fffcbd89a51af797265af2e11c97be5820a07d (patch)
treec3a796d2b8aad1ea24158d22053a2524634de8f1 /services/camera/libcameraservice/device3
parent8097068de97c0cdab8150931f290edbd5b3721e5 (diff)
parent1d1f846c0dbaa36d0944e7b1e54cc07863e00a92 (diff)
downloadframeworks_av-19fffcbd89a51af797265af2e11c97be5820a07d.zip
frameworks_av-19fffcbd89a51af797265af2e11c97be5820a07d.tar.gz
frameworks_av-19fffcbd89a51af797265af2e11c97be5820a07d.tar.bz2
Merge "Camera3: track request status in inflight queue" into klp-dev
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp17
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.h2
2 files changed, 18 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index ed6458c..1f853ab 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -1417,7 +1417,12 @@ void Camera3Device::processCaptureResult(const camera3_capture_result *result) {
}
InFlightRequest &request = mInFlightMap.editValueAt(idx);
timestamp = request.captureTimestamp;
- if (timestamp == 0) {
+ /**
+ * One of the following must happen before it's legal to call process_capture_result:
+ * - CAMERA3_MSG_SHUTTER (expected during normal operation)
+ * - CAMERA3_MSG_ERROR (expected during flush)
+ */
+ if (request.requestStatus == OK && timestamp == 0) {
SET_ERR("Called before shutter notify for frame %d",
frameNumber);
return;
@@ -1541,6 +1546,16 @@ void Camera3Device::notify(const camera3_notify_msg *msg) {
ALOGV("Camera %d: %s: HAL error, frame %d, stream %d: %d",
mId, __FUNCTION__, msg->message.error.frame_number,
streamId, msg->message.error.error_code);
+
+ // Set request error status for the request in the in-flight tracking
+ {
+ Mutex::Autolock l(mInFlightLock);
+ ssize_t idx = mInFlightMap.indexOfKey(msg->message.error.frame_number);
+ if (idx >= 0) {
+ mInFlightMap.editValueAt(idx).requestStatus = msg->message.error.error_code;
+ }
+ }
+
if (listener != NULL) {
listener->notifyError(msg->message.error.error_code,
msg->message.error.frame_number, streamId);
diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index 6295c80..c2b0867 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -438,6 +438,7 @@ class Camera3Device :
int requestId;
// Set by notify() SHUTTER call.
nsecs_t captureTimestamp;
+ int requestStatus;
// Set by process_capture_result call with valid metadata
bool haveResultMetadata;
// Decremented by calls to process_capture_result with valid output
@@ -448,6 +449,7 @@ class Camera3Device :
InFlightRequest() :
requestId(0),
captureTimestamp(0),
+ requestStatus(OK),
haveResultMetadata(false),
numBuffersLeft(0) {
}