summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi/raspberrypi.cpp')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 8c881303..b5322483 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -364,7 +364,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
* error means the platform can never run. Let's just print a warning
* and continue regardless; the rotation is effectively set to zero.
*/
- int32_t rotation = data_->sensor_->properties().get(properties::Rotation);
+ int32_t rotation = data_->sensor_->properties().get(properties::Rotation).value_or(0);
bool success;
Transform rotationTransform = transformFromRotation(rotation, &success);
if (!success)
@@ -1718,7 +1718,8 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &
* V4L2_CID_NOTIFY_GAINS control (which means notifyGainsUnity_ is set).
*/
if (notifyGainsUnity_ && controls.contains(libcamera::controls::ColourGains)) {
- libcamera::Span<const float> colourGains = controls.get(libcamera::controls::ColourGains);
+ libcamera::Span<const float> colourGains =
+ *controls.get(libcamera::controls::ColourGains);
/* The control wants linear gains in the order B, Gb, Gr, R. */
ControlList ctrls(sensor_->controls());
std::array<int32_t, 4> gains{
@@ -2053,7 +2054,7 @@ Rectangle RPiCameraData::scaleIspCrop(const Rectangle &ispCrop) const
void RPiCameraData::applyScalerCrop(const ControlList &controls)
{
if (controls.contains(controls::ScalerCrop)) {
- Rectangle nativeCrop = controls.get<Rectangle>(controls::ScalerCrop);
+ Rectangle nativeCrop = *controls.get<Rectangle>(controls::ScalerCrop);
if (!nativeCrop.width || !nativeCrop.height)
nativeCrop = { 0, 0, 1, 1 };
@@ -2091,7 +2092,7 @@ void RPiCameraData::fillRequestMetadata(const ControlList &bufferControls,
Request *request)
{
request->metadata().set(controls::SensorTimestamp,
- bufferControls.get(controls::SensorTimestamp));
+ bufferControls.get(controls::SensorTimestamp).value_or(0));
request->metadata().set(controls::ScalerCrop, scalerCrop_);
}