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>
This commit is contained in:
committed by
Kieran Bingham
parent
183bab1643
commit
8a79800089
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user