[libcamera-devel] [PATCH v3 06/27] gst: libcamerasrc: Allocate and add static pad
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Mar 6 21:26:16 CET 2020
From: Nicolas Dufresne <nicolas.dufresne at collabora.com>
This pad will always be present and will allow simple pipeline to be used to
stream from the camera.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/gstreamer/gstlibcamerasrc.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 79d4196..cba936c 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -12,6 +12,7 @@
struct _GstLibcameraSrc {
GstElement parent;
+ GstPad *srcpad;
};
G_DEFINE_TYPE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT);
@@ -31,6 +32,10 @@ GstStaticPadTemplate request_src_template = {
static void
gst_libcamera_src_init(GstLibcameraSrc *self)
{
+ GstPadTemplate *templ = gst_element_get_pad_template(GST_ELEMENT(self), "src");
+
+ self->srcpad = gst_pad_new_from_template(templ, "src");
+ gst_element_add_pad(GST_ELEMENT(self), self->srcpad);
}
static void
--
2.24.1
More information about the libcamera-devel
mailing list