[libcamera-devel] [PATCH v3 06/13] libcamera: pipeline: Add helper to process meta data coming from IPA
Niklas Söderlund
niklas.soderlund at ragnatech.se
Fri Sep 27 04:44:10 CEST 2019
Add a helper to process meta data coming out of an IPA and associating
it with a request. The helper is needed as the pipeline handler needs to
access the private meta data member of the request, something only the
base pipeline class handler can do.
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
src/libcamera/include/pipeline_handler.h | 3 +++
src/libcamera/pipeline_handler.cpp | 16 ++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
index 4400c7ed835f551d..d2581a327c0804c3 100644
--- a/src/libcamera/include/pipeline_handler.h
+++ b/src/libcamera/include/pipeline_handler.h
@@ -30,6 +30,7 @@ class DeviceMatch;
class MediaDevice;
class PipelineHandler;
class Request;
+struct IPAMetaData;
class CameraData
{
@@ -94,6 +95,8 @@ protected:
CameraData *cameraData(const Camera *camera);
+ 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 b8a3787e10a587b5..da0ad678b652768c 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -480,6 +480,22 @@ void PipelineHandler::hotplugMediaDevice(MediaDevice *media)
media->disconnected.connect(this, &PipelineHandler::mediaDeviceDisconnected);
}
+/**
+ * \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.23.0
More information about the libcamera-devel
mailing list