summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-10-16 16:57:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-16 16:57:06 -0700
commitecfbc952d51c71832f739b7483dcc8cb5fe68038 (patch)
tree4cd14445abff9f7ffd411a01364f14ac3bbb7878 /services
parentbbe11e46faf8f9e3296431993c36d3efc61337b5 (diff)
parentac0cd56627b121081308213d5a327cfbae410f4d (diff)
downloadframeworks_av-ecfbc952d51c71832f739b7483dcc8cb5fe68038.zip
frameworks_av-ecfbc952d51c71832f739b7483dcc8cb5fe68038.tar.gz
frameworks_av-ecfbc952d51c71832f739b7483dcc8cb5fe68038.tar.bz2
Merge "Camera2: Improve quirks focusing behavior." into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp8
-rw-r--r--services/camera/libcameraservice/camera2/Parameters.h3
2 files changed, 9 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index c5ea3ed..98332f9 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -1007,7 +1007,8 @@ status_t Camera2Client::autoFocus() {
*/
if (l.mParameters.quirks.triggerAfWithAuto &&
l.mParameters.sceneMode != ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED &&
- l.mParameters.focusMode != Parameters::FOCUS_MODE_AUTO) {
+ l.mParameters.focusMode != Parameters::FOCUS_MODE_AUTO &&
+ !l.mParameters.focusingAreas[0].isEmpty()) {
ALOGV("%s: Quirk: Switching from focusMode %d to AUTO",
__FUNCTION__, l.mParameters.focusMode);
l.mParameters.shadowFocusMode = l.mParameters.focusMode;
@@ -1038,13 +1039,16 @@ status_t Camera2Client::cancelAutoFocus() {
triggerId = ++l.mParameters.afTriggerCounter;
// When using triggerAfWithAuto quirk, may need to reset focus mode to
- // the real state at this point.
+ // the real state at this point. No need to cancel explicitly if
+ // changing the AF mode.
if (l.mParameters.shadowFocusMode != Parameters::FOCUS_MODE_INVALID) {
ALOGV("%s: Quirk: Restoring focus mode to %d", __FUNCTION__,
l.mParameters.shadowFocusMode);
l.mParameters.focusMode = l.mParameters.shadowFocusMode;
l.mParameters.shadowFocusMode = Parameters::FOCUS_MODE_INVALID;
updateRequests(l.mParameters);
+
+ return OK;
}
}
syncWithDevice();
diff --git a/services/camera/libcameraservice/camera2/Parameters.h b/services/camera/libcameraservice/camera2/Parameters.h
index 8a8645e..54b1e8c 100644
--- a/services/camera/libcameraservice/camera2/Parameters.h
+++ b/services/camera/libcameraservice/camera2/Parameters.h
@@ -100,6 +100,9 @@ struct Parameters {
Area(int left, int top, int right, int bottom, int weight):
left(left), top(top), right(right), bottom(bottom),
weight(weight) {}
+ bool isEmpty() const {
+ return (left == 0) && (top == 0) && (right == 0) && (bottom == 0);
+ }
};
Vector<Area> focusingAreas;