@@ -118,6 +118,7 @@ interface IPARPiEventInterface {
statsMetadataComplete(uint32 bufferId, libcamera.ControlList controls);
runIsp(uint32 bufferId);
embeddedComplete(uint32 bufferId);
+ setSensorControls(libcamera.ControlList controls);
setIspControls(libcamera.ControlList controls);
setDelayedControls(libcamera.ControlList controls);
};
@@ -1036,6 +1036,19 @@ void IPARPi::processStats(unsigned int bufferId)
setDelayedControls.emit(ctrls);
}
+
+ struct AwbStatus awbStatus;
+ if (rpiMetadata_.Get("awb.status", awbStatus) == 0 &&
+ sensorCtrls_.find(V4L2_CID_NOTIFY_GAIN_RED) != sensorCtrls_.end() &&
+ sensorCtrls_.find(V4L2_CID_NOTIFY_GAIN_BLUE) != sensorCtrls_.end()) {
+ ControlList ctrls(sensorCtrls_);
+ ctrls.set(V4L2_CID_NOTIFY_GAIN_RED,
+ static_cast<int32_t>(helper_->ColourGainCode(awbStatus.gain_r)));
+ ctrls.set(V4L2_CID_NOTIFY_GAIN_BLUE,
+ static_cast<int32_t>(helper_->ColourGainCode(awbStatus.gain_b)));
+
+ setSensorControls.emit(ctrls);
+ }
}
void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)
@@ -152,6 +152,7 @@ public:
void statsMetadataComplete(uint32_t bufferId, const ControlList &controls);
void runIsp(uint32_t bufferId);
void embeddedComplete(uint32_t bufferId);
+ void setSensorControls(const ControlList &controls);
void setIspControls(const ControlList &controls);
void setDelayedControls(const ControlList &controls);
@@ -1219,6 +1220,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)
ipa_->statsMetadataComplete.connect(this, &RPiCameraData::statsMetadataComplete);
ipa_->runIsp.connect(this, &RPiCameraData::runIsp);
ipa_->embeddedComplete.connect(this, &RPiCameraData::embeddedComplete);
+ ipa_->setSensorControls.connect(this, &RPiCameraData::setSensorControls);
ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);
ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);
@@ -1361,6 +1363,14 @@ void RPiCameraData::embeddedComplete(uint32_t bufferId)
handleState();
}
+void RPiCameraData::setSensorControls(const ControlList &controls)
+{
+ ControlList ctrls = controls;
+
+ unicam_[Unicam::Image].dev()->setControls(&ctrls);
+ handleState();
+}
+
void RPiCameraData::setIspControls(const ControlList &controls)
{
ControlList ctrls = controls;