[libcamera-devel] [PATCH v6 5/6] ipa: raspberrypi: Add a Merge method to RPiController::Metadata

Naushir Patuck naush at raspberrypi.com
Mon May 10 11:58:14 CEST 2021


Add a new Merge method to the Metadata class. This will merge all unique
key/value pairs from a source metadata map to the destination map.

Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
Reviewed-by: David Plowman <david.plowman at raspberrypi.com>
---
 src/ipa/raspberrypi/controller/metadata.hpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp
index 3a97a5f5c502..fd6aac880bad 100644
--- a/src/ipa/raspberrypi/controller/metadata.hpp
+++ b/src/ipa/raspberrypi/controller/metadata.hpp
@@ -73,6 +73,12 @@ public:
 		return *this;
 	}
 
+	void Merge(Metadata &other)
+	{
+		std::scoped_lock lock(mutex_, other.mutex_);
+		data_.merge(other.data_);
+	}
+
 	template<typename T>
 	T *GetLocked(std::string const &tag)
 	{
-- 
2.25.1



More information about the libcamera-devel mailing list