summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/cam_helper.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2022-06-29 09:57:20 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-06-29 12:12:07 +0100
commit2a321be376dbc3c534d3634fdcaf141aff79cd48 (patch)
tree00f388e73ef9909300fd1248620744f70f9ab2c9 /src/ipa/raspberrypi/cam_helper.cpp
parent71fb6549183d1bd91289eb1e40fcbf69c74ce91d (diff)
ipa: raspberrypi: Add sensor temperature to DeviceStatus
Add an optional sensor_temperature field to the DeviceStatus structure. If a temperature measurement is available for a frame, the value is returned out through the SensorTemperature control in the Request metadata. Additionally, provide the sensor temperature value from the std::ostream &operator<< overload. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/cam_helper.cpp')
-rw-r--r--src/ipa/raspberrypi/cam_helper.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp
index 74179399..3f81d418 100644
--- a/src/ipa/raspberrypi/cam_helper.cpp
+++ b/src/ipa/raspberrypi/cam_helper.cpp
@@ -185,9 +185,9 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,
metadata.Merge(parsedMetadata);
/*
- * Overwrite the exposure/gain values in the existing DeviceStatus with
- * values from the parsed embedded buffer. Fetch it first in case any
- * other fields were set meaningfully.
+ * Overwrite the exposure/gain, frame length and sensor temperature values
+ * in the existing DeviceStatus with values from the parsed embedded buffer.
+ * Fetch it first in case any other fields were set meaningfully.
*/
DeviceStatus deviceStatus, parsedDeviceStatus;
if (metadata.Get("device.status", deviceStatus) ||
@@ -199,6 +199,8 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,
deviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;
deviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;
deviceStatus.frame_length = parsedDeviceStatus.frame_length;
+ if (parsedDeviceStatus.sensor_temperature)
+ deviceStatus.sensor_temperature = parsedDeviceStatus.sensor_temperature;
LOG(IPARPI, Debug) << "Metadata updated - " << deviceStatus;