@@ -188,10 +188,7 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,
deviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;
deviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;
- LOG(IPARPI, Debug) << "Metadata updated - Exposure : "
- << deviceStatus.shutter_speed
- << " Gain : "
- << deviceStatus.analogue_gain;
+ LOG(IPARPI, Debug) << "Metadata updated - " << deviceStatus;
metadata.Set("device.status", deviceStatus);
}
@@ -6,6 +6,8 @@
*/
#pragma once
+#include <iostream>
+
#include <libcamera/base/utils.h>
/*
@@ -20,6 +22,19 @@ struct DeviceStatus {
{
}
+ friend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)
+ {
+ using namespace libcamera; /* for the Duration operator<< overload */
+
+ out << "Exposure: " << d.shutter_speed
+ << " Gain: " << d.analogue_gain
+ << " Aperture: " << d.aperture
+ << " Lens: " << d.lens_position
+ << " Flash: " << d.flash_intensity;
+
+ return out;
+ }
+
/* time shutter is open */
libcamera::utils::Duration shutter_speed;
double analogue_gain;
@@ -1019,10 +1019,7 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)
deviceStatus.shutter_speed = helper_->Exposure(exposureLines);
deviceStatus.analogue_gain = helper_->Gain(gainCode);
- LOG(IPARPI, Debug) << "Metadata - Exposure : "
- << deviceStatus.shutter_speed
- << " Gain : "
- << deviceStatus.analogue_gain;
+ LOG(IPARPI, Debug) << "Metadata - " << deviceStatus;
rpiMetadata_.Set("device.status", deviceStatus);
}