summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2014-08-06 21:41:20 -0700
committerZhijun He <zhijunhe@google.com>2014-08-06 21:41:20 -0700
commit7e4c0033c5d2f9d5f53f520a9b0a2fcb8023c810 (patch)
tree2902f58b28d88b6a393c8e6d3d22610eaa830f9f /services
parent29e09664c2c5b49d78f2666d38a812502a36e26b (diff)
downloadframeworks_av-7e4c0033c5d2f9d5f53f520a9b0a2fcb8023c810.zip
frameworks_av-7e4c0033c5d2f9d5f53f520a9b0a2fcb8023c810.tar.gz
frameworks_av-7e4c0033c5d2f9d5f53f520a9b0a2fcb8023c810.tar.bz2
Camera: Need consider AF state for ZSL buffer selection
Bug: 16569983 Change-Id: I65e604e382ac0b98777155ad480ec3f6071e1a76
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
index ab61c44..37de610 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
@@ -489,6 +489,22 @@ nsecs_t ZslProcessor3::getCandidateTimestampLocked(size_t* metadataIdx) const {
continue;
}
+ // Make sure the candidate frame has good focus.
+ entry = frame.find(ANDROID_CONTROL_AF_STATE);
+ if (entry.count == 0) {
+ ALOGW("%s: ZSL queue frame has no AF state field!",
+ __FUNCTION__);
+ continue;
+ }
+ uint8_t afState = entry.data.u8[0];
+ if (afState != ANDROID_CONTROL_AF_STATE_PASSIVE_FOCUSED &&
+ afState != ANDROID_CONTROL_AF_STATE_FOCUSED_LOCKED &&
+ afState != ANDROID_CONTROL_AF_STATE_NOT_FOCUSED_LOCKED) {
+ ALOGW("%s: ZSL queue frame AF state is %d is not good for capture, skip it",
+ __FUNCTION__, afState);
+ continue;
+ }
+
minTimestamp = frameTimestamp;
idx = j;
}