summaryrefslogtreecommitdiff
path: root/src/libcamera/include
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2019-05-27 17:39:09 -0400
committerPaul Elder <paul.elder@ideasonboard.com>2019-06-05 10:44:52 -0400
commit7faa67889fffc4de5fdbeaf9d969d91bbd734e6c (patch)
treedae07c55531f501ddb09ca2c0c60574a89089840 /src/libcamera/include
parent9b4eb44581f4cecf87fb8f2d753e00553d6d6c29 (diff)
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>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r--src/libcamera/include/ipa_module.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h
index a4c6dbdf..7ac5cad5 100644
--- a/src/libcamera/include/ipa_module.h
+++ b/src/libcamera/include/ipa_module.h
@@ -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();
};