[libcamera-devel] [PATCH v1 11/23] gst: libcamerapad: Add a method to access the role

Nicolas Dufresne nicolas at ndufresne.ca
Wed Jan 29 04:31:58 CET 2020


From: Nicolas Dufresne <nicolas.dufresne at collabora.com>

Signed-off-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>
---
 src/gstreamer/gstlibcamerapad.cpp | 8 ++++++++
 src/gstreamer/gstlibcamerapad.h   | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp
index c6c22e4..b18584c 100644
--- a/src/gstreamer/gstlibcamerapad.cpp
+++ b/src/gstreamer/gstlibcamerapad.cpp
@@ -99,3 +99,11 @@ gst_libcamera_pad_class_init(GstLibcameraPadClass *klass)
 						     | G_PARAM_STATIC_STRINGS));
 	g_object_class_install_property(object_class, PROP_STREAM_ROLE, spec);
 }
+
+StreamRole
+gst_libcamera_pad_get_role(GstPad *pad)
+{
+	auto *self = GST_LIBCAMERA_PAD(pad);
+	GST_OBJECT_LOCKER(self);
+	return self->role;
+}
diff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h
index 2e745f1..3dea0e7 100644
--- a/src/gstreamer/gstlibcamerapad.h
+++ b/src/gstreamer/gstlibcamerapad.h
@@ -7,6 +7,7 @@
  */
 
 #include <gst/gst.h>
+#include <libcamera/stream.h>
 
 #ifndef __GST_LIBCAMERA_PAD_H__
 #define __GST_LIBCAMERA_PAD_H__
@@ -15,5 +16,6 @@
 G_DECLARE_FINAL_TYPE(GstLibcameraPad, gst_libcamera_pad,
 		     GST_LIBCAMERA, PAD, GstPad)
 
+libcamera::StreamRole gst_libcamera_pad_get_role(GstPad *pad);
 
 #endif /* __GST_LIBCAMERA_PAD_H__ */
-- 
2.24.1



More information about the libcamera-devel mailing list