[Bug 750881] glmixerbin: correctly free input chain on pad release

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sat Jun 13 05:08:02 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=750881

--- Comment #3 from Vasilis Liaskovitis <vliaskov at gmail.com> ---
thanks for the fix!

One more question: i have to make this also work on top of older repo
(gst-plugins-bad 4521524de), where gstglvideomixer was still based on
gstglmixer (and not gstglmixerbin). Even in that old design, gstglmixer's
_clean_upload() function is not called on pad release, leading to similar leaks
(_clean_upload is only called in gst_gl_mixer_stop). In this design there is no
gst_gl_mixer_release_pad function, since this is handled by parent class
videoaggregator. 

Are there any suggestions on how to properly handle this in the old design?
Does it make sense to add a gst_gl_mixer_release_pad? e.g. :

diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c
index 1532697..f5acd98 100644
--- a/ext/gl/gstglmixer.c
+++ b/ext/gl/gstglmixer.c
@@ -59,6 +59,8 @@ static GstBuffer *_default_pad_upload_buffer (GstGLMixer *
mix,

 static void gst_gl_mixer_set_context (GstElement * element,
     GstContext * context);
+static gboolean _clean_upload (GstAggregator * agg, GstAggregatorPad * aggpad,
+    gpointer udata);

 enum
 {
@@ -574,10 +576,28 @@ static gboolean gst_gl_mixer_set_allocation (GstGLMixer *
mix,
 static void gst_gl_mixer_finalize (GObject * object);

 static void
+gst_gl_mixer_release_pad (GstElement * element, GstPad * pad)
+{
+  GstAggregatorPad *aggpad;
+  GstAggregator *agg = NULL;
+
+  agg = GST_AGGREGATOR (element);
+  aggpad = GST_AGGREGATOR_PAD (pad);
+
+
+  _clean_upload (agg, aggpad, NULL);
+  GST_ELEMENT_CLASS (gst_gl_mixer_parent_class)->release_pad (GST_ELEMENT
+      (agg), pad);
+
+  return;
+}
+
+static void
 gst_gl_mixer_class_init (GstGLMixerClass * klass)
 {
   GObjectClass *gobject_class;
   GstElementClass *element_class;
+  GstElementClass *gstelement_class = (GstElementClass *) klass;

   GstVideoAggregatorClass *videoaggregator_class =
       (GstVideoAggregatorClass *) klass;
@@ -602,6 +622,9 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass)

   element_class->set_context = GST_DEBUG_FUNCPTR (gst_gl_mixer_set_context);

+  gstelement_class->release_pad =
+      GST_DEBUG_FUNCPTR (gst_gl_mixer_release_pad);
+


Maybe this is relevant for a 1.4.x backport also, though I am not working on
1.4.x at the moment.

thanks for any hints

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list