rtpsession: Track RTX ssrc caps
authorArun Raghavan <arun@centricular.com>
Mon, 6 Apr 2015 07:26:50 +0000 (12:56 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 16 Apr 2015 15:33:37 +0000 (17:33 +0200)
This is needed so that we can generate SR for RTX stream correctly (the
clock rate is required).

https://bugzilla.gnome.org/show_bug.cgi?id=747394

gst/rtpmanager/gstrtprtxsend.c
gst/rtpmanager/rtpsession.c

index 8859dec..117a2d4 100644 (file)
@@ -606,9 +606,17 @@ gst_rtp_rtx_send_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
       data = gst_rtp_rtx_send_get_ssrc_data (rtx, ssrc);
       gst_structure_get_int (s, "clock-rate", &data->clock_rate);
 
+      /* The session might need to know the RTX ssrc */
+      caps = gst_caps_copy (caps);
+      gst_caps_set_simple (caps, "rtx-ssrc", G_TYPE_UINT, data->rtx_ssrc, NULL);
+
       GST_DEBUG_OBJECT (rtx, "got clock-rate from caps: %d for ssrc: %u",
           data->clock_rate, ssrc);
       GST_OBJECT_UNLOCK (rtx);
+
+      gst_event_unref (event);
+      event = gst_event_new_caps (caps);
+      gst_caps_unref (caps);
       break;
     }
     default:
index 0175125..a711c88 100644 (file)
@@ -2701,6 +2701,15 @@ rtp_session_update_send_caps (RTPSession * sess, GstCaps * caps)
       rtp_source_update_caps (source, caps);
       g_object_unref (source);
     }
+
+    if (gst_structure_get_uint (s, "rtx-ssrc", &ssrc)) {
+      source =
+          obtain_internal_source (sess, ssrc, &created, GST_CLOCK_TIME_NONE);
+      if (source) {
+        rtp_source_update_caps (source, caps);
+        g_object_unref (source);
+      }
+    }
     RTP_SESSION_UNLOCK (sess);
   }
 }