@@ -45,7 +45,8 @@ static const ControlInfoMap Controls({
{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
{ &controls::FrameDurationLimits, ControlInfo(INT64_C(1000), INT64_C(1000000000)) },
- { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }
+ { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
+ { &controls::AfState, ControlInfo(controls::AfStateValues) }
}, controls::controls);
} /* namespace RPi */
@@ -547,6 +547,11 @@ void IPARPi::reportMetadata()
m[i] = ccmStatus->matrix[i];
libcameraMetadata_.set(controls::ColourCorrectionMatrix, m);
}
+
+ AfStatus *afStatus = rpiMetadata_.GetLocked<AfStatus>("af.status");
+ if (afStatus) {
+ libcameraMetadata_.set(controls::AfState, afStatus->state);
+ }
}
bool IPARPi::validateSensorControls()
@@ -1101,6 +1106,14 @@ void IPARPi::processStats(unsigned int bufferId)
setDelayedControls.emit(ctrls);
}
+
+ struct AfStatus afStatus;
+ if (rpiMetadata_.Get("af.status", afStatus) == 0) {
+ ControlList lensCtrls(lensCtrls_);
+ lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE,
+ static_cast<int32_t>(afStatus.lensPosition));
+ setLensControls.emit(lensCtrls);
+ }
}
void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)
The user can read the status for each frame with the AfState control value. Populate the AF status into the metadata when it is available. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- include/libcamera/ipa/raspberrypi.h | 3 ++- src/ipa/raspberrypi/raspberrypi.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-)