diff options
Diffstat (limited to 'services/camera/libcameraservice/api1/client2/FrameProcessor.cpp')
-rw-r--r-- | services/camera/libcameraservice/api1/client2/FrameProcessor.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp index 69bea24..3de5d90 100644 --- a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp +++ b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp @@ -78,7 +78,7 @@ bool FrameProcessor::processSingleFrame(CaptureResult &frame, } if (mSynthesize3ANotify) { - process3aState(frame.mMetadata, client); + process3aState(frame, client); } return FrameProcessorBase::processSingleFrame(frame, device); @@ -212,14 +212,15 @@ status_t FrameProcessor::processFaceDetect(const CameraMetadata &frame, return OK; } -status_t FrameProcessor::process3aState(const CameraMetadata &frame, +status_t FrameProcessor::process3aState(const CaptureResult &frame, const sp<Camera2Client> &client) { ATRACE_CALL(); + const CameraMetadata &metadata = frame.mMetadata; camera_metadata_ro_entry_t entry; int cameraId = client->getCameraId(); - entry = frame.find(ANDROID_REQUEST_FRAME_COUNT); + entry = metadata.find(ANDROID_REQUEST_FRAME_COUNT); int32_t frameNumber = entry.data.i32[0]; // Don't send 3A notifications for the same frame number twice @@ -238,26 +239,31 @@ status_t FrameProcessor::process3aState(const CameraMetadata &frame, // TODO: Also use AE mode, AE trigger ID - gotAllStates &= get3aResult<uint8_t>(frame, ANDROID_CONTROL_AF_MODE, + gotAllStates &= get3aResult<uint8_t>(metadata, ANDROID_CONTROL_AF_MODE, &new3aState.afMode, frameNumber, cameraId); - gotAllStates &= get3aResult<uint8_t>(frame, ANDROID_CONTROL_AWB_MODE, + gotAllStates &= get3aResult<uint8_t>(metadata, ANDROID_CONTROL_AWB_MODE, &new3aState.awbMode, frameNumber, cameraId); - gotAllStates &= get3aResult<uint8_t>(frame, ANDROID_CONTROL_AE_STATE, + gotAllStates &= get3aResult<uint8_t>(metadata, ANDROID_CONTROL_AE_STATE, &new3aState.aeState, frameNumber, cameraId); - gotAllStates &= get3aResult<uint8_t>(frame, ANDROID_CONTROL_AF_STATE, + gotAllStates &= get3aResult<uint8_t>(metadata, ANDROID_CONTROL_AF_STATE, &new3aState.afState, frameNumber, cameraId); - gotAllStates &= get3aResult<uint8_t>(frame, ANDROID_CONTROL_AWB_STATE, + gotAllStates &= get3aResult<uint8_t>(metadata, ANDROID_CONTROL_AWB_STATE, &new3aState.awbState, frameNumber, cameraId); - gotAllStates &= get3aResult<int32_t>(frame, ANDROID_CONTROL_AF_TRIGGER_ID, - &new3aState.afTriggerId, frameNumber, cameraId); + if (client->getCameraDeviceVersion() >= CAMERA_DEVICE_API_VERSION_3_2) { + new3aState.afTriggerId = frame.mResultExtras.afTriggerId; + new3aState.aeTriggerId = frame.mResultExtras.precaptureTriggerId; + } else { + gotAllStates &= get3aResult<int32_t>(metadata, ANDROID_CONTROL_AF_TRIGGER_ID, + &new3aState.afTriggerId, frameNumber, cameraId); - gotAllStates &= get3aResult<int32_t>(frame, ANDROID_CONTROL_AE_PRECAPTURE_ID, - &new3aState.aeTriggerId, frameNumber, cameraId); + gotAllStates &= get3aResult<int32_t>(metadata, ANDROID_CONTROL_AE_PRECAPTURE_ID, + &new3aState.aeTriggerId, frameNumber, cameraId); + } if (!gotAllStates) return BAD_VALUE; |