@@ -91,7 +91,8 @@ static const ControlInfoMap::Map ipaControls{
{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },
{ &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) },
{ &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) },
- { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }
+ { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
+ { &controls::AfState, ControlInfo(controls::AfStateValues) },
};
LOG_DEFINE_CATEGORY(IPARPI)
@@ -611,6 +612,10 @@ 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()
@@ -1170,6 +1175,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)