From d41b356564caef80ceee4096405a1ef439976cfa Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 21 Jan 2020 17:16:40 -0500 Subject: gst: libcamerapad: Add a method to access the role Each pad can have a different roles. Users will have to request and configure their pads role before moving to a higher state. Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/gstreamer/gstlibcamerapad.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gstreamer/gstlibcamerapad.cpp') diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp index ca5c8203..ed24557b 100644 --- a/src/gstreamer/gstlibcamerapad.cpp +++ b/src/gstreamer/gstlibcamerapad.cpp @@ -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; +} -- cgit v1.2.1