summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-10-23 02:51:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-11-25 10:52:05 +0200
commitbaf3be12effed489770aaf02b9df3b743d4b7e50 (patch)
tree78f47129a41d41c09b7089be4bf80c79b54cd134 /include
parentc7bbe0ca3a015f9b4d59724d8489ff90b6be2e81 (diff)
libcamera: stream: Add operator<<() to print StreamRole as a string
libcamera prints stream role values in log messages. To be more user-friendly, add a specialization of operator<<() to print the role name as a string instead of a numerical value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/stream.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index f0ae7e62..efec695a 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -9,6 +9,7 @@
#include <map>
#include <memory>
+#include <ostream>
#include <string>
#include <vector>
@@ -70,6 +71,8 @@ enum StreamRole {
using StreamRoles = std::vector<StreamRole>;
+std::ostream &operator<<(std::ostream &out, StreamRole role);
+
class Stream
{
public: