[libcamera-devel] [RFC PATCH 10/17] libcamera: IPAModule: Replace ipa_context with IPAInterface

Paul Elder paul.elder at ideasonboard.com
Wed Aug 26 13:09:19 CEST 2020


With the new IPC infrastructure, we no longer need the C interface as
provided by struct ipa_context. Make ipaCreate_() and createInterface()
return IPAInterface.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 include/libcamera/internal/ipa_module.h |  4 ++--
 src/libcamera/ipa_module.cpp            | 16 +---------------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h
index c2df2476..19fc5827 100644
--- a/include/libcamera/internal/ipa_module.h
+++ b/include/libcamera/internal/ipa_module.h
@@ -33,7 +33,7 @@ public:
 
 	bool load();
 
-	struct ipa_context *createContext();
+	IPAInterface *createInterface();
 
 	bool match(PipelineHandler *pipe,
 		   uint32_t minVersion, uint32_t maxVersion) const;
@@ -52,7 +52,7 @@ private:
 	bool loaded_;
 
 	void *dlHandle_;
-	typedef struct ipa_context *(*IPAIntfFactory)();
+	typedef IPAInterface *(*IPAIntfFactory)(void);
 	IPAIntfFactory ipaCreate_;
 };
 
diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index de512a7f..008325c4 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -438,21 +438,7 @@ bool IPAModule::load()
 	return true;
 }
 
-/**
- * \brief Instantiate an IPA context
- *
- * After loading the IPA module with load(), this method creates an instance of
- * the IPA module context. Ownership of the context is passed to the caller, and
- * the context shall be destroyed by calling the \ref ipa_context_ops::destroy
- * "ipa_context::ops::destroy()" function.
- *
- * Calling this function on a module that has not yet been loaded, or an
- * invalid module (as returned by load() and isValid(), respectively) is
- * an error.
- *
- * \return The IPA context on success, or nullptr on error
- */
-struct ipa_context *IPAModule::createContext()
+IPAInterface *IPAModule::createInterface()
 {
 	if (!valid_ || !loaded_)
 		return nullptr;
-- 
2.27.0



More information about the libcamera-devel mailing list