libcamera: software_isp: Start the ISP thread in configure

OpenGL is not thread-safe and in fact associates invisible handles with the
threadid of the calling context.

As a result we need to make configure() and process() in SoftISP execute on
the same thread.

Move start thread into configure() as a first step towards this.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
This commit is contained in:
Bryan O'Donoghue 2024-12-16 17:03:36 +00:00
parent 8ca941b7b5
commit 87ccbc69ca

View file

@ -159,8 +159,6 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
metadataReady.emit(frame, metadata);
});
ipa_->setSensorControls.connect(this, &SoftwareIsp::setSensorCtrls);
debayer_->moveToThread(&ispWorkerThread_);
}
SoftwareIsp::~SoftwareIsp()
@ -262,6 +260,9 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg,
if (ret < 0)
return ret;
debayer_->moveToThread(&ispWorkerThread_);
ispWorkerThread_.start();
return debayer_->configure(inputCfg, outputCfgs, ccmEnabled_);
}
@ -343,7 +344,6 @@ int SoftwareIsp::start()
if (ret)
return ret;
ispWorkerThread_.start();
return 0;
}