summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2020-07-21 10:23:06 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-08-27 10:49:09 +0100
commit1e8c91b65695449c5246d17ba7dc439c8058b781 (patch)
tree7392ee4a8e1a0fb6978dd901ee09f5f4c3297bff
parent3bce337fbe5caeab6064e1969fb2fd0c537d57db (diff)
pipeline: raspberrypi: Set sensor default orientation before configure()
The default sensor orientation must be set early on in match() to ensure generateConfiguration() and configure() return out the correct Bayer ordering to the application. This is particularly important for RAW capture streams. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 42c9caa0..c1451e71 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -960,6 +960,13 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
/* Initialize the camera properties. */
data->properties_ = data->sensor_->properties();
+ /* Configure the H/V flip controls based on the sensor rotation. */
+ ControlList ctrls(data->unicam_[Unicam::Image].dev()->controls());
+ int32_t rotation = data->properties_.get(properties::Rotation);
+ ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
+ ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
+ data->unicam_[Unicam::Image].dev()->setControls(&ctrls);
+
/*
* List the available output streams.
* Currently cannot do Unicam streams!
@@ -1164,13 +1171,6 @@ int RPiCameraData::configureIPA()
{ V4L2_CID_EXPOSURE, result.data[1] } });
sensorMetadata_ = result.data[2];
}
-
- /* Configure the H/V flip controls based on the sensor rotation. */
- ControlList ctrls(unicam_[Unicam::Image].dev()->controls());
- int32_t rotation = sensor_->properties().get(properties::Rotation);
- ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
- ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
- unicam_[Unicam::Image].dev()->setControls(&ctrls);
}
if (result.operation & RPI_IPA_CONFIG_SENSOR) {