From a783562a34893fb1f96fea4ba6584d8e8e61d9b2 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 11 Sep 2024 23:18:14 +0200 Subject: libcamera: media_object: Add MediaLink string representations Various parts of libcamera print the representation of a MediaLink by inline joining the parts to make a string representation. This repeated use case can be supported with a common helper to print the MediaLink in a common manner using the existing toString() and operator<< overload style to make it easier to report on MediaLink types. This implementation will report in the following style: 'imx283 1-001a'[0] -> 'video-mux'[0] Reviewed-by: Laurent Pinchart Reviewed-by: Stefan Klug Signed-off-by: Kieran Bingham --- include/libcamera/internal/media_object.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index d80d5f45..9356d204 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -48,6 +48,8 @@ public: unsigned int flags() const { return flags_; } int setEnabled(bool enable); + std::string toString() const; + private: LIBCAMERA_DISABLE_COPY_AND_MOVE(MediaLink) @@ -61,6 +63,8 @@ private: unsigned int flags_; }; +std::ostream &operator<<(std::ostream &out, const MediaLink &link); + class MediaPad : public MediaObject { public: -- cgit v1.2.1