summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-04-03 09:45:50 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2025-04-03 10:28:29 +0100
commit8a7980008933ca3c549f86c5105d9562273edc93 (patch)
tree7ef369d5dddf2b73a19b88ceb242533a2f4b6cfd /src
parent183bab1643466c5d62d2cb93feea286571c73fbb (diff)
pipeline: simple: Create DelayedControls instance once only
The DelayedControls instance for the camera sensor is created in SimplePipelineHandler::configure(). Constant deletion and reconstruction of a new object is unnecessary, as the control delays are an intrinsic property of the sensor and are known at initialization time. Move the DelayedControls creation to the SimpleCameraData class constructor. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> # v6 Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 4f6ae89c..c873407a 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -542,6 +542,13 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
if (!sensor_)
return;
+ const CameraSensorProperties::SensorDelays &delays = sensor_->sensorDelays();
+ std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {
+ { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },
+ { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },
+ };
+ delayedCtrls_ = std::make_unique<DelayedControls>(sensor_->device(), params);
+
LOG(SimplePipeline, Debug)
<< "Found pipeline: "
<< utils::join(entities_, " -> ",
@@ -1388,15 +1395,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
if (outputCfgs.empty())
return 0;
- const CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();
- std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {
- { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },
- { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },
- };
- data->delayedCtrls_ =
- std::make_unique<DelayedControls>(data->sensor_->device(),
- params);
-
StreamConfiguration inputCfg;
inputCfg.pixelFormat = pipeConfig->captureFormat;
inputCfg.size = pipeConfig->captureSize;