utils: codegen: ipc: Split proxy types

Even though there is an abstract class to represent the interface of an IPA,
the threaded and IPC versions are still multiplexed using the same type,
which uses a boolean to actually dispatch to the right function.

Instead of doing that, split the classes into "threaded" and "isolated"
variants, and make `IPAManager` choose accordingly.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-07-22 16:38:22 +02:00
parent 6c251ae3ef
commit 25b254fe61
3 changed files with 119 additions and 96 deletions
+8 -1
View File
@@ -44,7 +44,14 @@ public:
return nullptr;
const GlobalConfiguration &configuration = cm->_d()->configuration();
std::unique_ptr<T> proxy = std::make_unique<T>(m, !self->isSignatureValid(m), configuration);
auto proxy = [&]() -> std::unique_ptr<T> {
if (self->isSignatureValid(m))
return std::make_unique<typename T::Threaded>(m, configuration);
else
return std::make_unique<typename T::Isolated>(m, configuration);
}();
if (!proxy->isValid()) {
LOG(IPAManager, Error) << "Failed to load proxy";
return nullptr;