summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2014-08-21 19:23:51 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-21 19:23:51 +0000
commit0e522ed229053c7d0238425e407431fc08cd7c63 (patch)
tree010ed1c4aeadc11a90e4a271c11653aec7dd71ff /services
parent01047680ac57712303e259f485efd9cb97e9a99a (diff)
parent754fb0225369123ef6e369fd91c48071dcf6057c (diff)
downloadframeworks_av-0e522ed229053c7d0238425e407431fc08cd7c63.zip
frameworks_av-0e522ed229053c7d0238425e407431fc08cd7c63.tar.gz
frameworks_av-0e522ed229053c7d0238425e407431fc08cd7c63.tar.bz2
Merge "camera: zsl: remove AF check if no focser presents" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp39
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.h2
2 files changed, 26 insertions, 15 deletions
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
index 37de610..b388079 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
@@ -51,7 +51,8 @@ ZslProcessor3::ZslProcessor3(
mZslStreamId(NO_STREAM),
mFrameListHead(0),
mZslQueueHead(0),
- mZslQueueTail(0) {
+ mZslQueueTail(0),
+ mHasFocuser(false) {
// Initialize buffer queue and frame list based on pipeline max depth.
size_t pipelineMaxDepth = kDefaultMaxPipelineDepth;
if (client != 0) {
@@ -67,6 +68,11 @@ ZslProcessor3::ZslProcessor3(
" use default pipeline max depth %zu", __FUNCTION__,
kDefaultMaxPipelineDepth);
}
+
+ entry = device->info().find(ANDROID_LENS_INFO_MINIMUM_FOCUS_DISTANCE);
+ if (entry.count > 0 && entry.data.f[0] != 0.) {
+ mHasFocuser = true;
+ }
}
}
@@ -489,20 +495,23 @@ 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;
+ // Check AF state if device has focuser
+ if (mHasFocuser) {
+ // 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;
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.h b/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
index dfb1457..daa352b 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
@@ -121,6 +121,8 @@ class ZslProcessor3 :
CameraMetadata mLatestCapturedRequest;
+ bool mHasFocuser;
+
virtual bool threadLoop();
status_t clearZslQueueLocked();