GST_DEBUG_OBJECT (bin, "handle sync from RTCP SR information");
+ /* get RTCP SR ntpnstime if available */
+ if (gst_structure_get_uint64 (s, "sr-ntpnstime", &ntpnstime) && 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);
+ return;
+ }
+
+ /* otherwise parse the RTCP packet */
buffer = gst_value_get_buffer (gst_structure_get_value (s, "sr-buffer"));
have_sr = FALSE;
guint64 ext_rtptime;
GstBuffer *last_sr;
guint32 last_sr_ssrc;
+ GstClockTime last_sr_ntpnstime;
/* some accounting */
guint64 num_pushed;
clock_base = priv->clock_base;
ext_rtptime = priv->ext_rtptime;
- GST_DEBUG_OBJECT (jitterbuffer, "ext SR %" G_GUINT64_FORMAT ", base %"
- G_GUINT64_FORMAT ", clock-rate %" G_GUINT32_FORMAT
- ", clock-base %" G_GUINT64_FORMAT ", last-rtptime %" G_GUINT64_FORMAT,
- ext_rtptime, base_rtptime, clock_rate, clock_base, last_rtptime);
+ GST_DEBUG_OBJECT (jitterbuffer,
+ "ext SR %" G_GUINT64_FORMAT ", NTP %" G_GUINT64_FORMAT ", base %"
+ G_GUINT64_FORMAT ", clock-rate %" G_GUINT32_FORMAT ", clock-base %"
+ G_GUINT64_FORMAT ", last-rtptime %" G_GUINT64_FORMAT, ext_rtptime,
+ priv->last_sr_ntpnstime, base_rtptime, clock_rate, clock_base,
+ last_rtptime);
if (base_rtptime == -1 || clock_rate == -1 || base_time == -1) {
/* we keep this SR packet for later. When we get a valid RTP packet the
"clock-base", G_TYPE_UINT64, clock_base,
"ssrc", G_TYPE_UINT, priv->last_sr_ssrc,
"sr-ext-rtptime", G_TYPE_UINT64, ext_rtptime,
+ "sr-ntpnstime", G_TYPE_UINT64, priv->last_sr_ntpnstime,
"sr-buffer", GST_TYPE_BUFFER, priv->last_sr, NULL);
for (l = priv->cname_ssrc_mappings; l; l = l->next) {
priv->ext_rtptime = ext_rtptime;
priv->last_sr_ssrc = ssrc;
+ priv->last_sr_ntpnstime = ntpnstime;
if (priv->last_ntpnstime != GST_CLOCK_TIME_NONE
&& ntpnstime - priv->last_ntpnstime < priv->sync_interval * GST_MSECOND) {