return;
}
+ cname = gst_structure_get_string (s, "cname");
+
/* if the jitterbuffer directly got the NTP timestamp then don't work
* through the RTCP SR, otherwise extract it from there */
if (gst_structure_get_uint64 (s, "inband-ntpnstime", &inband_ntpnstime)
gst_rtcp_buffer_map (buffer, GST_MAP_READ, &rtcp);
GST_RTCP_BUFFER_FOR_PACKETS (more, &rtcp, &packet) {
+ if (have_sr && (cname || have_sdes))
+ break;
+
/* first packet must be SR or RR or else the validate would have failed */
switch (gst_rtcp_packet_get_type (&packet)) {
case GST_RTCP_TYPE_SR:
continue;
have_sr = TRUE;
+
+ /* If we already have the CNAME don't require parsing SDES */
+ if (cname) {
+ GST_RTP_BIN_LOCK (bin);
+ /* associate the stream to CNAME */
+ gst_rtp_bin_associate (bin, stream, strlen (cname),
+ (const guint8 *) cname, ntpnstime, extrtptime, base_rtptime,
+ base_time, clock_rate, clock_base);
+ GST_RTP_BIN_UNLOCK (bin);
+ break;
+ }
+
break;
case GST_RTCP_TYPE_SDES:
{
GstClockTime peer_latency;
guint64 ext_rtptime;
GstBuffer *last_sr;
+ guint32 last_sr_ssrc;
/* some accounting */
guint64 num_pushed;
GST_DEBUG_OBJECT (jitterbuffer, "keeping RTCP packet for later");
} else if (valid) {
GstStructure *s;
+ GList *l;
s = gst_structure_new ("application/x-rtp-sync",
"base-rtptime", G_TYPE_UINT64, base_rtptime,
"base-time", G_TYPE_UINT64, base_time,
"clock-rate", G_TYPE_UINT, clock_rate,
"clock-base", G_TYPE_UINT64, clock_base,
+ "ssrc", G_TYPE_UINT, priv->last_sr_ssrc,
"sr-ext-rtptime", G_TYPE_UINT64, ext_rtptime,
"sr-buffer", GST_TYPE_BUFFER, priv->last_sr, NULL);
+ for (l = priv->cname_ssrc_mappings; l; l = l->next) {
+ const CNameSSRCMapping *map = l->data;
+
+ if (map->ssrc == priv->last_ssrc) {
+ gst_structure_set (s, "cname", G_TYPE_STRING, map->cname, NULL);
+ break;
+ }
+ }
+
GST_DEBUG_OBJECT (jitterbuffer, "signaling sync");
gst_buffer_replace (&priv->last_sr, NULL);
JBUF_UNLOCK (priv);
priv->ext_rtptime = ext_rtptime;
gst_buffer_replace (&priv->last_sr, buffer);
+ priv->last_sr_ssrc = ssrc;
do_handle_sync (jitterbuffer);