Message ID | 20250403074551.263496-5-stanislaw.gruszka@linux.intel.com |
---|---|
State | Accepted |
Commit | 8a7980008933ca3c549f86c5105d9562273edc93 |
Headers | show |
Series |
|
Related | show |
Quoting Stanislaw Gruszka (2025-04-03 08:45:50) > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > 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> I'll test this series on the x13s and merge as long as it's all fine. -- Kieran > --- > src/libcamera/pipeline/simple/simple.cpp | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp > index c97904076b63..262192b849e2 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; > -- > 2.43.0 >
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index c97904076b63..262192b849e2 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;