Message ID | 20200227200407.490616-12-nicolas.dufresne@collabora.com |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Nicolas, Thank you for the patch. On Thu, Feb 27, 2020 at 03:03:51PM -0500, Nicolas Dufresne wrote: > Each pad can have a different roles. Users will have to request and configure s/roles/role/ > their pads roles before moving higher state. s/moving/moving to a/ ? > > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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 6212c3b..d4f5b15 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); > + GLibLocker lock(GST_OBJECT(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> Missing blank line here. > +#include <libcamera/stream.h> > > #ifndef __GST_LIBCAMERA_PAD_H__ > #define __GST_LIBCAMERA_PAD_H__ The #include statements should go after the header guard. Looks like I missed all this in the review of v1, sorry. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> still applies. > @@ -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__ */
diff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp index 6212c3b..d4f5b15 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); + GLibLocker lock(GST_OBJECT(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__ */