@@ -100,3 +100,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);
+ GLibLocker lock(GST_OBJECT(self));
+ return self->role;
+}
@@ -6,14 +6,16 @@
* gstlibcamerapad.h - GStreamer Capture Element
*/
-#include <gst/gst.h>
-
#ifndef __GST_LIBCAMERA_PAD_H__
#define __GST_LIBCAMERA_PAD_H__
+#include <gst/gst.h>
+
+#include <libcamera/stream.h>
+
#define GST_TYPE_LIBCAMERA_PAD gst_libcamera_pad_get_type()
-G_DECLARE_FINAL_TYPE(GstLibcameraPad, gst_libcamera_pad,
- GST_LIBCAMERA, PAD, GstPad)
+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__ */