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 <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Nicolas Dufresne 2020-01-21 17:16:40 -05:00 committed by Laurent Pinchart
parent 1d8cbaf214
commit d41b356564
2 changed files with 15 additions and 5 deletions

View file

@ -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;
}