diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2014-09-14 22:01:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-14 22:01:52 +0000 |
commit | 83a23e1e1e45d9e2f5497e214796250f74aad1d4 (patch) | |
tree | c0f781b2ac3fa832896f1e4f553e74063f593b14 /services | |
parent | a1530f1b16f093a91edbbbaf7dac9f9809867817 (diff) | |
parent | 176e4c253a63d581af6b21f3182d71b3026ef516 (diff) | |
download | frameworks_av-83a23e1e1e45d9e2f5497e214796250f74aad1d4.zip frameworks_av-83a23e1e1e45d9e2f5497e214796250f74aad1d4.tar.gz frameworks_av-83a23e1e1e45d9e2f5497e214796250f74aad1d4.tar.bz2 |
Merge "Camera1: Validate scene mode override AF mode" into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/Parameters.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.cpp b/services/camera/libcameraservice/api1/client2/Parameters.cpp index ed9137f..aa9d746 100644 --- a/services/camera/libcameraservice/api1/client2/Parameters.cpp +++ b/services/camera/libcameraservice/api1/client2/Parameters.cpp @@ -983,6 +983,13 @@ status_t Parameters::buildFastInfo() { bool fixedLens = minFocusDistance.count == 0 || minFocusDistance.data.f[0] == 0; + camera_metadata_ro_entry_t focusDistanceCalibration = + staticInfo(ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION, 0, 0, + false); + bool canFocusInfinity = (focusDistanceCalibration.count && + focusDistanceCalibration.data.u8[0] != + ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED); + camera_metadata_ro_entry_t availableFocalLengths = staticInfo(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS); if (!availableFocalLengths.count) return NO_INIT; @@ -1033,6 +1040,13 @@ status_t Parameters::buildFastInfo() { sceneModeOverrides.data.u8[i * kModesPerSceneMode + 2]; switch(afMode) { case ANDROID_CONTROL_AF_MODE_OFF: + if (!fixedLens && !canFocusInfinity) { + ALOGE("%s: Camera %d: Scene mode override lists asks for" + " fixed focus on a device with focuser but not" + " calibrated for infinity focus", __FUNCTION__, + cameraId); + return NO_INIT; + } modes.focusMode = fixedLens ? FOCUS_MODE_FIXED : FOCUS_MODE_INFINITY; break; |