Commit 7b2ce2d2 authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

add pad-removed handler

which does not get called :(
parent 39377b9c
......@@ -43,7 +43,7 @@ pad_added_cb (GstElement *rtpbin, GstPad *srcpad, GstElement *depayloader)
GstPad *sinkpad;
g_debug ("%s", GST_PAD_NAME (srcpad));
g_debug ("pad added: %s", GST_PAD_NAME (srcpad));
sinkpad = gst_element_get_static_pad (depayloader, "sink");
if (gst_pad_link (srcpad, sinkpad) != GST_PAD_LINK_OK)
......@@ -52,6 +52,21 @@ pad_added_cb (GstElement *rtpbin, GstPad *srcpad, GstElement *depayloader)
gst_object_unref (sinkpad);
static void
pad_removed_cb (GstElement *rtpbin, GstPad *srcpad, GstElement *depayloader)
GstPad *sinkpad;
g_debug ("pad removed: %s", GST_PAD_NAME (srcpad));
sinkpad = gst_element_get_static_pad (depayloader, "sink");
if (!gst_pad_unlink (srcpad, sinkpad))
g_warning ("Failed to unlink from %s (probably never linked)",
GST_PAD_NAME (sinkpad));
gst_object_unref (sinkpad);
main (int argc, char **argv)
......@@ -184,6 +199,7 @@ main (int argc, char **argv)
/* need to link RTP pad to the depayloader */
g_signal_connect (data.recv_rtpbin, "pad-added", G_CALLBACK (pad_added_cb), data.depayloader);
g_signal_connect (data.recv_rtpbin, "pad-removed", G_CALLBACK (pad_removed_cb), data.depayloader);
/* out/send direction */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment