diff options
author | Zhijun He <zhijunhe@google.com> | 2015-05-04 16:34:37 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2015-05-05 08:50:28 -0700 |
commit | 9c5af614aac9d9ffeee9124ce10f0f4bc025398d (patch) | |
tree | 54545beb7f18c90248d355e287fba3a69e1726f0 | |
parent | c8a70d340f0ce610dfb8bd44d833708269484e99 (diff) | |
download | frameworks_av-9c5af614aac9d9ffeee9124ce10f0f4bc025398d.zip frameworks_av-9c5af614aac9d9ffeee9124ce10f0f4bc025398d.tar.gz frameworks_av-9c5af614aac9d9ffeee9124ce10f0f4bc025398d.tar.bz2 |
CameraService: update android.control.availableModes
Only advertise CONTROL_MODE_OFF when manual 3A controls are supported.
Also fixed some bug regarding static metadata update.
Bug: 20734940
Change-Id: I5061f3c49ec20dc8cf5d849771c000fb82543e8f
-rw-r--r-- | services/camera/libcameraservice/common/CameraModule.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp index ac4d9a6..064ff71 100644 --- a/services/camera/libcameraservice/common/CameraModule.cpp +++ b/services/camera/libcameraservice/common/CameraModule.cpp @@ -36,12 +36,47 @@ void CameraModule::deriveCameraCharacteristicsKeys( chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/1); data = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE; chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/1); - controlModes.push(ANDROID_CONTROL_MODE_OFF); controlModes.push(ANDROID_CONTROL_MODE_AUTO); camera_metadata_entry entry = chars.find(ANDROID_CONTROL_AVAILABLE_SCENE_MODES); if (entry.count > 1 || entry.data.u8[0] != ANDROID_CONTROL_SCENE_MODE_DISABLED) { controlModes.push(ANDROID_CONTROL_MODE_USE_SCENE_MODE); } + + // Only advertise CONTROL_OFF mode if 3A manual controls are supported. + bool isManualAeSupported = false; + bool isManualAfSupported = false; + bool isManualAwbSupported = false; + entry = chars.find(ANDROID_CONTROL_AE_AVAILABLE_MODES); + if (entry.count > 0) { + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == ANDROID_CONTROL_AE_MODE_OFF) { + isManualAeSupported = true; + break; + } + } + } + entry = chars.find(ANDROID_CONTROL_AF_AVAILABLE_MODES); + if (entry.count > 0) { + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == ANDROID_CONTROL_AF_MODE_OFF) { + isManualAfSupported = true; + break; + } + } + } + entry = chars.find(ANDROID_CONTROL_AWB_AVAILABLE_MODES); + if (entry.count > 0) { + for (size_t i = 0; i < entry.count; i++) { + if (entry.data.u8[i] == ANDROID_CONTROL_AWB_MODE_OFF) { + isManualAwbSupported = true; + break; + } + } + } + if (isManualAeSupported && isManualAfSupported && isManualAwbSupported) { + controlModes.push(ANDROID_CONTROL_MODE_OFF); + } + chars.update(ANDROID_CONTROL_AVAILABLE_MODES, controlModes); } return; @@ -86,7 +121,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { if (ret != 0) { return ret; } - int deviceVersion = cameraInfo.device_version; + int deviceVersion = rawInfo.device_version; if (deviceVersion < CAMERA_DEVICE_API_VERSION_2_0) { // static_camera_characteristics is invalid *info = rawInfo; |