summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2020-01-15 15:44:42 -0500
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-07 01:57:45 +0200
commit26c923a27c7f5993602ea6e8348eeff4b236b651 (patch)
tree154cb51a5d859f768eda0be66c63105ded368836
parent71a28f959313c573097fa23d5894b0104f092352 (diff)
gst: libcamerasrc: Allocate and add static pad
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@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/gstreamer/gstlibcamerasrc.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 79d4196c..cba936cb 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