libcamera: ipa_module: allow instantiation of IPAInterface
Add functions for loading the IPAInterface factory function from an IPA module shared object, and for creating an instance of an IPAInterface. These functions will be used by IPAManager, from which a PipelineHandler will request an IPAInterface. Also update meson to add the "-ldl" linker argument, to allow loading of the factory function from a shared object. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -7,8 +7,10 @@
|
||||
#ifndef __LIBCAMERA_IPA_MODULE_H__
|
||||
#define __LIBCAMERA_IPA_MODULE_H__
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <libcamera/ipa/ipa_interface.h>
|
||||
#include <libcamera/ipa/ipa_module_info.h>
|
||||
|
||||
namespace libcamera {
|
||||
@@ -17,16 +19,26 @@ class IPAModule
|
||||
{
|
||||
public:
|
||||
explicit IPAModule(const std::string &libPath);
|
||||
~IPAModule();
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
const struct IPAModuleInfo &info() const;
|
||||
|
||||
bool load();
|
||||
|
||||
std::unique_ptr<IPAInterface> createInstance();
|
||||
|
||||
private:
|
||||
struct IPAModuleInfo info_;
|
||||
|
||||
std::string libPath_;
|
||||
bool valid_;
|
||||
bool loaded_;
|
||||
|
||||
void *dlHandle_;
|
||||
typedef IPAInterface *(*IPAIntfFactory)(void);
|
||||
IPAIntfFactory ipaCreate_;
|
||||
|
||||
int loadIPAModuleInfo();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user