[libcamera-devel] [PATCH 1/2] media_entity: Overload == operator to use media-entities in maps

Marian Cichy m.cichy at pengutronix.de
Tue Mar 9 12:29:48 CET 2021


Signed-off-by: Marian Cichy <m.cichy at pengutronix.de>
---
 include/libcamera/internal/media_object.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h
index 1c82c279..1ed95863 100644
--- a/include/libcamera/internal/media_object.h
+++ b/include/libcamera/internal/media_object.h
@@ -102,6 +102,8 @@ public:
 
 	int setDeviceNode(const std::string &deviceNode);
 
+	bool operator==(const MediaEntity &other) { return name() == other.name(); }
+
 private:
 	LIBCAMERA_DISABLE_COPY_AND_MOVE(MediaEntity)
 
-- 
2.29.2



More information about the libcamera-devel mailing list