gst/rtpmanager/gstrtpsession.c: Use method to get the internal SSRC.
authorWim Taymans <wim.taymans@gmail.com>
Mon, 29 Dec 2008 15:49:37 +0000 (15:49 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 29 Dec 2008 15:49:37 +0000 (15:49 +0000)
Original commit message from CVS:
* gst/rtpmanager/gstrtpsession.c:
(gst_rtp_session_getcaps_send_rtp):
Use method to get the internal SSRC.
* gst/rtpmanager/rtpsession.c: (rtp_session_class_init),
(rtp_session_set_property), (rtp_session_get_property):
Add property to congiure the internal SSRC of the session.
Fixes #565910.

ChangeLog
gst/rtpmanager/gstrtpsession.c
gst/rtpmanager/rtpsession.c

index c0c44b2..149eaf8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2008-12-29  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * gst/rtpmanager/gstrtpsession.c:
+       (gst_rtp_session_getcaps_send_rtp):
+       Use method to get the internal SSRC.
+
+       * gst/rtpmanager/rtpsession.c: (rtp_session_class_init),
+       (rtp_session_set_property), (rtp_session_get_property):
+       Add property to congiure the internal SSRC of the session.
+       Fixes #565910.
+
+2008-12-29  Wim Taymans  <wim.taymans@collabora.co.uk>
+
+       * gst/rtpmanager/rtpsession.c: (rtp_session_class_init),
+       (rtp_session_set_property), (rtp_session_get_property):
+       Add property to change the internal SSRC of the session.
+
+2008-12-29  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst/rtpmanager/rtpsession.c: (rtp_session_set_internal_ssrc):
        Only change the SSRC of the session and reset the internal source when
        the SSRC actually changed. See #565910.
index 1c22318..e9af897 100644 (file)
@@ -1653,15 +1653,17 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad)
   GstRtpSessionPrivate *priv;
   GstCaps *result;
   GstStructure *s1, *s2;
+  guint ssrc;
 
   rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
   priv = rtpsession->priv;
 
+  ssrc = rtp_session_get_internal_ssrc (priv->session);
+
   /* we can basically accept anything but we prefer to receive packets with our
    * internal SSRC so that we don't have to patch it. Create a structure with
    * the SSRC and another one without. */
-  s1 = gst_structure_new ("application/x-rtp",
-      "ssrc", G_TYPE_UINT, priv->session->source->ssrc, NULL);
+  s1 = gst_structure_new ("application/x-rtp", "ssrc", G_TYPE_UINT, ssrc, NULL);
   s2 = gst_structure_new ("application/x-rtp", NULL);
 
   result = gst_caps_new_full (s1, s2, NULL);
index b2d8449..1b7f3a4 100644 (file)
@@ -63,6 +63,7 @@ enum
 enum
 {
   PROP_0,
+  PROP_INTERNAL_SSRC,
   PROP_INTERNAL_SOURCE,
   PROP_BANDWIDTH,
   PROP_RTCP_FRACTION,
@@ -244,6 +245,11 @@ rtp_session_class_init (RTPSessionClass * klass)
       NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
       RTP_TYPE_SOURCE);
 
+  g_object_class_install_property (gobject_class, PROP_INTERNAL_SSRC,
+      g_param_spec_uint ("internal-ssrc", "Internal SSRC",
+          "The internal SSRC used for the session",
+          0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
   g_object_class_install_property (gobject_class, PROP_INTERNAL_SOURCE,
       g_param_spec_object ("internal-source", "Internal Source",
           "The internal source element of the session",
@@ -451,6 +457,9 @@ rtp_session_set_property (GObject * object, guint prop_id,
   sess = RTP_SESSION (object);
 
   switch (prop_id) {
+    case PROP_INTERNAL_SSRC:
+      rtp_session_set_internal_ssrc (sess, g_value_get_uint (value));
+      break;
     case PROP_BANDWIDTH:
       rtp_session_set_bandwidth (sess, g_value_get_double (value));
       break;
@@ -503,6 +512,9 @@ rtp_session_get_property (GObject * object, guint prop_id,
   sess = RTP_SESSION (object);
 
   switch (prop_id) {
+    case PROP_INTERNAL_SSRC:
+      g_value_set_uint (value, rtp_session_get_internal_ssrc (sess));
+      break;
     case PROP_INTERNAL_SOURCE:
       g_value_take_object (value, rtp_session_get_internal_source (sess));
       break;