session: give caps to session
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 25 Jul 2013 23:24:07 +0000 (01:24 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 26 Jul 2013 10:17:59 +0000 (12:17 +0200)
Let the session parse the caps and update its SSRC when needed.

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

index b971fd3..65b4b11 100644 (file)
@@ -1883,15 +1883,9 @@ gst_rtp_session_setcaps_send_rtp (GstPad * pad, GstRtpSession * rtpsession,
     GstCaps * caps)
 {
   GstRtpSessionPrivate *priv;
-  GstStructure *s = gst_caps_get_structure (caps, 0);
-  guint ssrc;
 
   priv = rtpsession->priv;
 
-  if (gst_structure_get_uint (s, "ssrc", &ssrc)) {
-    GST_DEBUG_OBJECT (rtpsession, "setting internal SSRC to %08x", ssrc);
-    rtp_session_set_internal_ssrc (priv->session, ssrc);
-  }
   rtp_session_update_send_caps (priv->session, caps);
 
   return TRUE;
index 29bf7b6..14edc55 100644 (file)
@@ -2440,11 +2440,19 @@ ignore:
 void
 rtp_session_update_send_caps (RTPSession * sess, GstCaps * caps)
 {
+  GstStructure *s;
+  guint ssrc;
+
   g_return_if_fail (RTP_IS_SESSION (sess));
   g_return_if_fail (GST_IS_CAPS (caps));
 
   GST_LOG ("received caps %" GST_PTR_FORMAT, caps);
 
+  s = gst_caps_get_structure (caps, 0);
+
+  if (gst_structure_get_uint (s, "ssrc", &ssrc))
+    rtp_session_set_internal_ssrc (sess, ssrc);
+
   RTP_SESSION_LOCK (sess);
   rtp_source_update_caps (sess->source, caps);
   RTP_SESSION_UNLOCK (sess);