[farsight2/master] Add a list of the rtpstreams to the rtpsession
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:48 PST 2008
---
gst/fsrtpconference/fs-rtp-session.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 477ba29..c97aaa6 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -98,6 +98,9 @@ struct _FsRtpSessionPrivate
GError *construction_error;
+ /* This list is protected by the session mutex */
+ GList *streams;
+
GMutex *mutex;
gboolean disposed;
@@ -667,6 +670,19 @@ fs_rtp_session_constructed (GObject *object)
}
+
+static void
+_remove_stream (gpointer user_data,
+ GObject *where_the_object_was)
+{
+ FsRtpSession *self = FS_RTP_SESSION (user_data);
+
+ FS_SESSION_LOCK (self);
+ self->priv->streams =
+ g_list_remove_all (self->priv->streams, where_the_object_was);
+ FS_SESSION_UNLOCK (self);
+}
+
/**
* fs_rtp_session_new_stream:
* @session: an #FsRtpSession
@@ -708,6 +724,12 @@ fs_rtp_session_new_stream (FsSession *session, FsParticipant *participant,
new_stream = FS_STREAM_CAST (fs_rtp_stream_new (self, rtpparticipant,
direction, st, error));
+ FS_SESSION_LOCK (self);
+ self->priv->streams = g_list_append (self->priv->streams, new_stream);
+ FS_SESSION_UNLOCK (self);
+
+ g_object_weak_ref (G_OBJECT (new_stream), _remove_stream, self);
+
return new_stream;
}
--
1.5.6.5
More information about the farsight-commits
mailing list