ipa: Switch to the plain C API

Switch IPA communication to the plain C API. As the IPAInterface class
is easier to use for pipeline handlers than a plain C API, retain it and
add an IPAContextWrapper that translate between the C++ and the C APIs.

On the IPA module side usage of IPAInterface may be desired for IPAs
implemented in C++ that want to link to libcamera. For those IPAs, a new
IPAInterfaceWrapper helper class is introduced to wrap the IPAInterface
implemented internally by the IPA module into an ipa_context,
ipa_context_ops and ipa_callback_ops.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Jacopo Mondi
2019-09-15 17:30:26 +03:00
committed by Laurent Pinchart
parent bc9527de45
commit 132d99bc8f
17 changed files with 676 additions and 23 deletions
+2 -3
View File
@@ -7,7 +7,6 @@
#ifndef __LIBCAMERA_IPA_MODULE_H__
#define __LIBCAMERA_IPA_MODULE_H__
#include <memory>
#include <string>
#include <ipa/ipa_interface.h>
@@ -30,7 +29,7 @@ public:
bool load();
std::unique_ptr<IPAInterface> createInstance();
struct ipa_context *createContext();
bool match(PipelineHandler *pipe,
uint32_t minVersion, uint32_t maxVersion) const;
@@ -45,7 +44,7 @@ private:
bool loaded_;
void *dlHandle_;
typedef IPAInterface *(*IPAIntfFactory)(void);
typedef struct ipa_context *(*IPAIntfFactory)(void);
IPAIntfFactory ipaCreate_;
int loadIPAModuleInfo();