[libcamera-devel] [PATCH 3/6] libcamera: pipeline: Add helper to process meta data coming from IPA

Niklas Söderlund niklas.soderlund at ragnatech.se
Sat Aug 31 23:02:17 CEST 2019


Add a helper to process meta data coming out of an IPA and associating
it with a request. The helper don't do much yet, it's expected that
more code will be needed in the future to deal with versioning of the
meta data structure coming from the IPA and the structure provided to
applications.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 src/libcamera/include/pipeline_handler.h |  2 ++
 src/libcamera/pipeline_handler.cpp       | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
index ca40e7ef2b85f372..3c08ecb0260675e0 100644
--- a/src/libcamera/include/pipeline_handler.h
+++ b/src/libcamera/include/pipeline_handler.h
@@ -102,6 +102,8 @@ protected:
 
 	void prepareInternalBuffer(Buffer *buffer, Request *request,
 				   BufferMemory *mem);
+	void processMetaData(Request *request, const IPAMetaData &metaData);
+
 	CameraManager *manager_;
 
 private:
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 613751619a398968..04293921d4d81d98 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -523,6 +523,22 @@ void PipelineHandler::prepareInternalBuffer(Buffer *buffer, Request *request,
 	buffer->mem_ = mem;
 }
 
+/**
+ * \brief Helper to process meta data from the IPA
+ * \param[in] request The request to associate the \a metaData with
+ * \param[in] metaData The meta data to process
+ *
+ * This function is a helper for pipline handler implementations to process
+ * meta data retrived from an IPA. It is mandatory to call this function with
+ * any meta data returned from the IPA before it's passed to the application.
+ */
+void PipelineHandler::processMetaData(Request *request,
+				      const IPAMetaData &metaData)
+{
+	request->metaData_ = metaData;
+	request->metaData_.ready = true;
+}
+
 /**
  * \brief Slot for the MediaDevice disconnected signal
  */
-- 
2.22.1



More information about the libcamera-devel mailing list