issue with static pads

Yogesh Tyagi yogesh.bit2006 at gmail.com
Sat Nov 16 21:42:04 PST 2013


Hi,

In a gstreamer plugin I am maintaining, two static, one src and one sink
pads are getting created in init function of a decoder element  by
following code:

 // Create the sink pad.
  template =
      gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
      gst_static_caps_get (sink_scaps));
  pad = ismd_gst_pad_new_from_template (template, name);
  gst_object_unref (template);
  g_free (name);

  // Now that we have a sink pad, let everyone know
  ismd_gst_element_register_sinkpad (smd_element, pad);
  gst_element_add_pad (GST_ELEMENT (smd_element), GST_PAD (pad));

  template =
      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
      gst_static_caps_get (source_scaps));

  for (i = 1; i <= count; i++) {
    // Create the source pad.
    name = g_strdup_printf ("src_%d", i);
    pad = ismd_gst_pad_new_from_template (template, name);

    // Now that we have a source pad, let everyone know
    ismd_gst_element_register_srcpad (smd_element, pad);
    gst_element_add_pad (GST_ELEMENT (smd_element), GST_PAD (pad));
    g_free (name);
  }
  gst_object_unref (template);
}

but these pads are not getting removed in finalize method .I have an event
associated with src pad of this decoder element which is not getting freed
up when decode element is removed because this event is set to be removed
in the method which removes pads of this plugin.But there is no code
explicitly calling the method meant to remove pads, for these static pads
of decoder element so event is also not getting freed up.This is causing
event leak in the system.

It is not required to remove static pads when element finalizes? Can
somebody provide some inputs on this problem?

Thanks,
Yogesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131117/364c3125/attachment.html>


More information about the gstreamer-devel mailing list