diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2012-09-07 14:26:29 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2012-09-10 10:15:21 -0700 |
commit | 61c0cc6af2c64d280bcfc1fcca3e3589172a5817 (patch) | |
tree | 13b9c3d7cf3f5ca9c4402e21529a5b0b3bf0b554 /services | |
parent | 4a02cc818607c0c145f91c3acb9181868a108f26 (diff) | |
download | frameworks_av-61c0cc6af2c64d280bcfc1fcca3e3589172a5817.zip frameworks_av-61c0cc6af2c64d280bcfc1fcca3e3589172a5817.tar.gz frameworks_av-61c0cc6af2c64d280bcfc1fcca3e3589172a5817.tar.bz2 |
Camera2: Use face priority scene mode when face detect is enabled.
Per API specs, enabled face detection implies that metering, etc is
done based on faces.
Bug: 6243944
Change-Id: Ie35162226d70cc0f437e92e37be138e71e45e738
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/camera2/Parameters.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/services/camera/libcameraservice/camera2/Parameters.cpp b/services/camera/libcameraservice/camera2/Parameters.cpp index 71aa39b..f490b2a 100644 --- a/services/camera/libcameraservice/camera2/Parameters.cpp +++ b/services/camera/libcameraservice/camera2/Parameters.cpp @@ -1360,17 +1360,23 @@ status_t Parameters::updateRequest(CameraMetadata *request) const { &antibandingMode, 1); if (res != OK) return res; - uint8_t reqControlMode = - (sceneMode == ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED) ? - ANDROID_CONTROL_AUTO : ANDROID_CONTROL_USE_SCENE_MODE; + // android.hardware.Camera requires that when face detect is enabled, the + // camera is in a face-priority mode. HAL2 splits this into separate parts + // (face detection statistics and face priority scene mode). Map from other + // to the other. + uint8_t reqControlMode = ANDROID_CONTROL_AUTO; + if (enableFaceDetect || sceneMode != ANDROID_CONTROL_SCENE_MODE_UNSUPPORTED) { + reqControlMode = ANDROID_CONTROL_USE_SCENE_MODE; + } res = request->update(ANDROID_CONTROL_MODE, &reqControlMode, 1); if (res != OK) return res; - if (reqControlMode == ANDROID_CONTROL_USE_SCENE_MODE) { - res = request->update(ANDROID_CONTROL_SCENE_MODE, - &sceneMode, 1); - if (res != OK) return res; - } + + uint8_t reqSceneMode = enableFaceDetect ? + (uint8_t)ANDROID_CONTROL_SCENE_MODE_FACE_PRIORITY : sceneMode; + res = request->update(ANDROID_CONTROL_SCENE_MODE, + &reqSceneMode, 1); + if (res != OK) return res; uint8_t reqFlashMode = ANDROID_FLASH_OFF; uint8_t reqAeMode; @@ -1515,8 +1521,6 @@ status_t Parameters::updateRequest(CameraMetadata *request) const { reqCropRegion, 3); if (res != OK) return res; - // TODO: Decide how to map recordingHint, or whether just to ignore it - uint8_t reqVstabMode = videoStabilization ? ANDROID_CONTROL_VIDEO_STABILIZATION_ON : ANDROID_CONTROL_VIDEO_STABILIZATION_OFF; |