summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.co.uk>2009-05-22 00:44:51 +0200
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-11 02:30:42 +0100
commit35090984687ddbe0d2a6fb39838b895a7e3d5c11 (patch)
tree6c9e9466c7a4541cdb50c30311f182e87226943d /gst/rtpmanager
parent2f6e9d7bf2008ce856b1b9ca0dd37dcbbced6064 (diff)
rtpbin: Implement releasing of rtp send pads
Diffstat (limited to 'gst/rtpmanager')
-rw-r--r--gst/rtpmanager/gstrtpbin.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index b4e61ac2..a1411e10 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -348,6 +348,7 @@ struct _GstRtpBinSession
GstPad *sync_src;
GstPad *send_rtp_sink;
GstPad *send_rtp_src;
+ GstPad *send_rtp_src_ghost;
GstPad *send_rtcp_src;
};
@@ -2196,7 +2197,7 @@ remove_recv_rtcp (GstRtpBin * rtpbin, GstRtpBinSession * session, GstPad * pad)
static GstPad *
create_send_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
{
- GstPad *result, *srcghost;
+ GstPad *result;
gchar *gname;
guint sessid;
GstRtpBinSession *session;
@@ -2240,10 +2241,10 @@ create_send_rtp (GstRtpBin * rtpbin, GstPadTemplate * templ, const gchar * name)
klass = GST_ELEMENT_GET_CLASS (rtpbin);
gname = g_strdup_printf ("send_rtp_src_%d", sessid);
templ = gst_element_class_get_pad_template (klass, "send_rtp_src_%d");
- srcghost =
+ session->send_rtp_src_ghost =
gst_ghost_pad_new_from_template (gname, session->send_rtp_src, templ);
- gst_pad_set_active (srcghost, TRUE);
- gst_element_add_pad (GST_ELEMENT_CAST (rtpbin), srcghost);
+ gst_pad_set_active (session->send_rtp_src_ghost, TRUE);
+ gst_element_add_pad (GST_ELEMENT_CAST (rtpbin), session->send_rtp_src_ghost);
g_free (gname);
return result;
@@ -2281,8 +2282,26 @@ no_srcpad:
static void
remove_send_rtp (GstRtpBin * rtpbin, GstRtpBinSession * session, GstPad * pad)
{
- g_warning ("gstrtpbin: releasing pad %s:%s is not implemented",
- GST_DEBUG_PAD_NAME (pad));
+ if (session->send_rtp_src_ghost) {
+ gst_pad_set_active (session->send_rtp_src_ghost, FALSE);
+ gst_element_remove_pad (GST_ELEMENT_CAST (rtpbin),
+ session->send_rtp_src_ghost);
+ session->send_rtp_src_ghost = NULL;
+ }
+
+ if (session->send_rtp_src) {
+ gst_object_unref (session->send_rtp_src);
+ session->send_rtp_src = NULL;
+ }
+
+ if (session->send_rtp_sink) {
+ gst_element_release_request_pad (GST_ELEMENT_CAST (session->session),
+ session->send_rtp_sink);
+ session->send_rtp_sink = NULL;
+ }
+
+ gst_pad_set_active (pad, FALSE);
+ gst_element_remove_pad (GST_ELEMENT_CAST (rtpbin), pad);
}
/* Create a pad for sending RTCP for the session in @name. Must be called with