[farsight2/master] Add a pointer to the session into the substream
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:59 PST 2008
---
gst/fsrtpconference/fs-rtp-session.c | 2 +-
gst/fsrtpconference/fs-rtp-substream.c | 28 +++++++++++++++++++++++++---
gst/fsrtpconference/fs-rtp-substream.h | 9 +++++++--
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index e40ffe9..e6aa08a 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -1392,7 +1392,7 @@ fs_rtp_session_new_recv_pad (FsRtpSession *session, GstPad *new_pad,
gchar *codec_bin_name = NULL;
GError *error = NULL;
- substream = fs_rtp_substream_new (session->priv->conference, new_pad,
+ substream = fs_rtp_substream_new (session->priv->conference, session, new_pad,
ssrc, pt, &error);
if (substream == NULL) {
diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index 0c0b42f..6f4e4ff 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -35,6 +35,7 @@ enum
{
PROP_0,
PROP_CONFERENCE,
+ PROP_SESSION,
PROP_RTPBIN_PAD,
PROP_SSRC,
PROP_PT,
@@ -43,7 +44,9 @@ enum
struct _FsRtpSubStreamPrivate {
gboolean disposed;
+ /* These are only pointers, we don't own references */
FsRtpConference *conference;
+ FsRtpSession *session;
guint32 ssrc;
guint pt;
@@ -101,11 +104,19 @@ fs_rtp_sub_stream_class_init (FsRtpSubStreamClass *klass)
g_object_class_install_property (gobject_class,
PROP_CONFERENCE,
g_param_spec_object ("conference",
- "The Conference this substream stream refers to",
+ "The FsRtpConference this substream stream refers to",
"This is a convience pointer for the Conference",
FS_TYPE_RTP_CONFERENCE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_SESSION,
+ g_param_spec_object ("session",
+ "The FsRtpSession this substream stream refers to",
+ "This is a convience pointer for the parent FsRtpSession",
+ FS_TYPE_RTP_SESSION,
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
g_object_class_install_property (gobject_class,
PROP_RTPBIN_PAD,
@@ -256,6 +267,9 @@ fs_rtp_sub_stream_set_property (GObject *object,
case PROP_CONFERENCE:
self->priv->conference = g_value_get_object (value);
break;
+ case PROP_SESSION:
+ self->priv->session = g_value_get_object (value);
+ break;
case PROP_RTPBIN_PAD:
self->priv->rtpbin_pad = g_value_dup_object (value);
break;
@@ -281,6 +295,9 @@ fs_rtp_sub_stream_get_property (GObject *object,
case PROP_CONFERENCE:
g_value_set_object (value, self->priv->conference);
break;
+ case PROP_SESSION:
+ g_value_set_object (value, self->priv->session);
+ break;
case PROP_RTPBIN_PAD:
g_value_set_object (value, self->priv->rtpbin_pad);
break;
@@ -403,11 +420,16 @@ fs_rtp_sub_stream_add_codecbin (FsRtpSubStream *substream,
}
FsRtpSubStream *
-fs_rtp_sub_stream_new (FsRtpConference *conference, GstPad *rtpbin_pad,
- guint32 ssrc, guint pt, GError **error)
+fs_rtp_sub_stream_new (FsRtpConference *conference,
+ FsRtpSession *session,
+ GstPad *rtpbin_pad,
+ guint32 ssrc,
+ guint pt,
+ GError **error)
{
FsRtpSubStream *substream = g_object_new (FS_TYPE_RTP_SUB_STREAM,
"conference", conference,
+ "session", session,
"rtpbin-pad", rtpbin_pad,
"ssrc", ssrc,
"pt", pt,
diff --git a/gst/fsrtpconference/fs-rtp-substream.h b/gst/fsrtpconference/fs-rtp-substream.h
index 4da6991..037c1e3 100644
--- a/gst/fsrtpconference/fs-rtp-substream.h
+++ b/gst/fsrtpconference/fs-rtp-substream.h
@@ -29,6 +29,7 @@
#include <gst/gst.h>
#include "fs-rtp-conference.h"
+#include "fs-rtp-session.h"
G_BEGIN_DECLS
@@ -70,8 +71,12 @@ struct _FsRtpSubStream
GType fs_rtp_sub_stream_get_type (void);
-FsRtpSubStream *fs_rtp_substream_new ( FsRtpConference *conference, GstPad *pad,
- guint32 ssrc, guint pt, GError **error);
+FsRtpSubStream *fs_rtp_substream_new (FsRtpConference *conference,
+ FsRtpSession *session,
+ GstPad *pad,
+ guint32 ssrc,
+ guint pt,
+ GError **error);
gboolean fs_rtp_sub_stream_add_codecbin (FsRtpSubStream *substream,
--
1.5.6.5
More information about the farsight-commits
mailing list