fakevideosink: Use our pad template to create pad
authorThibault Saunier <tsaunier@igalia.com>
Mon, 6 Jan 2020 19:30:36 +0000 (16:30 -0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 6 Jan 2020 20:35:00 +0000 (20:35 +0000)
gst/debugutils/gstfakevideosink.c

index 0ebec64..20b0f77 100644 (file)
@@ -171,6 +171,7 @@ static void
 gst_fake_video_sink_init (GstFakeVideoSink * self)
 {
   GstElement *child;
+  GstPadTemplate *template = gst_static_pad_template_get (&sink_factory);
 
   child = gst_element_factory_make ("fakesink", "sink");
 
@@ -184,7 +185,8 @@ gst_fake_video_sink_init (GstFakeVideoSink * self)
 
     gst_bin_add (GST_BIN (self), child);
 
-    ghost_pad = gst_ghost_pad_new ("sink", sink_pad);
+    ghost_pad = gst_ghost_pad_new_from_template ("sink", sink_pad, template);
+    gst_object_unref (template);
     gst_element_add_pad (GST_ELEMENT (self), ghost_pad);
     gst_object_unref (sink_pad);