Message ID | 20250422215920.4297-13-bryan.odonoghue@linaro.org |
---|---|
State | RFC |
Headers | show |
Series |
|
Related | show |
Hi Bryan, Thank you for the patch. On Tue, Apr 22, 2025 at 10:59:05PM +0100, Bryan O'Donoghue wrote: > Use the virtual base class function pointer in invokeMethod. When we point > the debayer_ object to a different class the instantiation of the virtual > method will be invoked. This means we can take a pointer to DebayerCpu or > DebayerOpenGL and get the desired function @ invokeMethod. This seems to be a fix that could be merged already, along with 18/27. The commit message needs a bit of an update: there's no DebayerOpenGL class yet. Are there other cleanups, fixes or refactoring patches that you think could be fast-tracked to shrink the series ? I'm thinking of patches that would make sense on their own, without depending on the design decisions of the rest of the series. > Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> > --- > src/libcamera/software_isp/software_isp.cpp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp > index e36aa246..c3dc21de 100644 > --- a/src/libcamera/software_isp/software_isp.cpp > +++ b/src/libcamera/software_isp/software_isp.cpp > @@ -263,7 +263,7 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg, > debayer_->moveToThread(&ispWorkerThread_); > ispWorkerThread_.start(); > > - return debayer_->invokeMethod(&DebayerCpu::configure, > + return debayer_->invokeMethod(&Debayer::configure, > ConnectionTypeBlocking, inputCfg, > outputCfgs, ccmEnabled_); > } > @@ -388,7 +388,7 @@ void SoftwareIsp::stop() > void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output) > { > ipa_->computeParams(frame); > - debayer_->invokeMethod(&DebayerCpu::process, > + debayer_->invokeMethod(&Debayer::process, > ConnectionTypeQueued, frame, input, output, debayerParams_); > } >
diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index e36aa246..c3dc21de 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -263,7 +263,7 @@ int SoftwareIsp::configure(const StreamConfiguration &inputCfg, debayer_->moveToThread(&ispWorkerThread_); ispWorkerThread_.start(); - return debayer_->invokeMethod(&DebayerCpu::configure, + return debayer_->invokeMethod(&Debayer::configure, ConnectionTypeBlocking, inputCfg, outputCfgs, ccmEnabled_); } @@ -388,7 +388,7 @@ void SoftwareIsp::stop() void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output) { ipa_->computeParams(frame); - debayer_->invokeMethod(&DebayerCpu::process, + debayer_->invokeMethod(&Debayer::process, ConnectionTypeQueued, frame, input, output, debayerParams_); }
Use the virtual base class function pointer in invokeMethod. When we point the debayer_ object to a different class the instantiation of the virtual method will be invoked. This means we can take a pointer to DebayerCpu or DebayerOpenGL and get the desired function @ invokeMethod. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- src/libcamera/software_isp/software_isp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)