[farsight2/master] Add gstrtpbin property to the FsRtpSession and set it at construct time from the conference

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


---
 gst/fsrtpconference/fs-rtp-conference.c |    3 ++-
 gst/fsrtpconference/fs-rtp-session.c    |   26 ++++++++++++++++++++++----
 gst/fsrtpconference/fs-rtp-session.h    |    3 ++-
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-conference.c b/gst/fsrtpconference/fs-rtp-conference.c
index 06243f2..86574db 100644
--- a/gst/fsrtpconference/fs-rtp-conference.c
+++ b/gst/fsrtpconference/fs-rtp-conference.c
@@ -311,7 +311,8 @@ fs_rtp_conference_new_session (FsBaseConference *conf,
   } while (fs_rtp_conference_get_session_by_id_locked (self, id));
   GST_OBJECT_UNLOCK (self);
 
-  new_session = FS_SESSION_CAST (fs_rtp_session_new (media_type, id));
+  new_session = FS_SESSION_CAST (fs_rtp_session_new (media_type,
+      self->priv->gstrtpbin, id));
 
   GST_OBJECT_LOCK (self);
   self->priv->sessions = g_list_append (self->priv->sessions, new_session);
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index ea4be3f..76a5fad 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -55,7 +55,8 @@ enum
   PROP_NATIVE_CODECS,
   PROP_NATIVE_CODECS_CONFIG,
   PROP_NEGOTIATED_CODECS,
-  PROP_CURRENT_SEND_CODEC
+  PROP_CURRENT_SEND_CODEC,
+  PROP_GSTRTPBIN
 };
 
 struct _FsRtpSessionPrivate
@@ -63,6 +64,8 @@ struct _FsRtpSessionPrivate
   FsMediaType media_type;
   guint id;
 
+  GstElement *gstrtpbin;
+
   gboolean disposed;
 };
 
@@ -169,6 +172,14 @@ fs_rtp_session_class_init (FsRtpSessionClass *klass)
                                     PROP_CURRENT_SEND_CODEC,
                                     "current-send-codec");
 
+    g_object_class_install_property (gobject_class,
+      PROP_GSTRTPBIN,
+      g_param_spec_object ("gstrtpbin",
+        "The GstRtpBin this stream refers to",
+        "This is a convience pointer for the GstRtpbin",
+        GST_TYPE_ELEMENT,
+        G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
   gobject_class->dispose = fs_rtp_session_dispose;
   gobject_class->finalize = fs_rtp_session_finalize;
 
@@ -220,10 +231,13 @@ fs_rtp_session_get_property (GObject *object,
     case PROP_ID:
       g_value_set_uint (value, self->priv->id);
       break;
+    case PROP_GSTRTPBIN:
+      g_value_set_object (value, self->priv->gstrtpbin);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
- }
+  }
 }
 
 static void
@@ -241,10 +255,13 @@ fs_rtp_session_set_property (GObject *object,
     case PROP_ID:
       self->priv->id = g_value_get_uint (value);
       break;
+    case PROP_GSTRTPBIN:
+      self->priv->gstrtpbin = g_value_dup_object (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
- }
+  }
 }
 
 /**
@@ -349,10 +366,11 @@ fs_rtp_session_set_send_codec (FsSession *session, FsCodec *send_codec,
 }
 
 FsRtpSession *
-fs_rtp_session_new (FsMediaType media_type, guint id)
+fs_rtp_session_new (FsMediaType media_type, GstElement *gstrtpbin, guint id)
 {
   return g_object_new (FS_TYPE_RTP_SESSION,
                        "media-type", media_type,
+                       "gstrtpbin", gstrtpbin,
                        "id", id,
                        NULL);
 }
diff --git a/gst/fsrtpconference/fs-rtp-session.h b/gst/fsrtpconference/fs-rtp-session.h
index 39279fb..59cd6b4 100644
--- a/gst/fsrtpconference/fs-rtp-session.h
+++ b/gst/fsrtpconference/fs-rtp-session.h
@@ -66,7 +66,8 @@ struct _FsRtpSession
 
 GType fs_rtp_session_get_type (void);
 
-FsRtpSession *fs_rtp_session_new (FsMediaType media_type, guint id);
+FsRtpSession *fs_rtp_session_new (FsMediaType media_type, GstElement *gstrtpbin,
+                                  guint id);
 
 GstCaps *fs_rtp_session_request_pt_map (FsRtpSession *session, guint pt);
 
-- 
1.5.6.5




More information about the farsight-commits mailing list