[farsight2/master] Add function to remove SSRCs on rtcp bye in the rtpsession

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:21:17 PST 2008


---
 gst/fsrtpconference/fs-rtp-session.c |   36 ++++++++++++++++++++++++++++++++++
 gst/fsrtpconference/fs-rtp-session.h |    2 +
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 0790320..92360a4 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -2543,3 +2543,39 @@ _substream_no_rtcp_timedout_cb (FsRtpSubStream *substream,
 
   FS_RTP_SESSION_UNLOCK (session);
 }
+
+/**
+ * fs_rtp_session_bye_ssrc:
+ * @session: a #FsRtpSession
+ * @ssrc: The ssrc
+ *
+ * This function is called when a RTCP BYE is received
+ */
+void
+fs_rtp_session_bye_ssrc (FsRtpSession *session,
+    guint32 ssrc)
+{
+  GList *item;
+
+  /* First remove it from the known SSRCs */
+
+  FS_RTP_SESSION_LOCK (session);
+
+  for (item = g_list_first (session->priv->streams);
+       item;
+       item = g_list_next (item))
+  {
+    FsRtpStream *stream = FS_RTP_STREAM (item->data);
+
+    fs_rtp_stream_remove_known_ssrc (stream, ssrc);
+  }
+
+  FS_RTP_SESSION_UNLOCK (session);
+
+  /*
+   * TODO:
+   *
+   * Remove running streams with that SSRC .. lets also check if they
+   * come from the right ip/port/etc ??
+   */
+}
diff --git a/gst/fsrtpconference/fs-rtp-session.h b/gst/fsrtpconference/fs-rtp-session.h
index 06cce1f..e172188 100644
--- a/gst/fsrtpconference/fs-rtp-session.h
+++ b/gst/fsrtpconference/fs-rtp-session.h
@@ -110,6 +110,8 @@ void fs_rtp_session_associate_ssrc_cname (FsRtpSession *session,
     guint32 ssrc,
     const gchar *cname);
 
+void fs_rtp_session_bye_ssrc (FsRtpSession *session,
+    guint32 ssrc);
 
 G_END_DECLS
 
-- 
1.5.6.5




More information about the farsight-commits mailing list