rtpjitterbuffer: Use an extended RTP timestamp for the clock-base

It is compared to other extended RTP timestamps all over rtpjitterbuffer
and since 4df3da3bab the initial extended RTP timestamp is not equal
anymore to the plain RTP time.

Continue passing a non-extended RTP timestamp via the `sync` signal for
backwards compatibility. It will always be a timestamp inside the first
extended timestamp period anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6536>
This commit is contained in:
Sebastian Dröge 2024-04-04 13:11:54 +03:00 committed by GStreamer Marge Bot
parent 4a4eb56fc2
commit 0c34c85f7a

View file

@ -1611,14 +1611,15 @@ gst_jitter_buffer_sink_parse_caps (GstRtpJitterBuffer * jitterbuffer,
gst_rtp_packet_rate_ctx_reset (&priv->packet_rate_ctx, priv->clock_rate);
/* The clock base is the RTP timestamp corrsponding to the npt-start value. We
/* The clock base is the RTP timestamp corresponding to the npt-start value. We
* can use this to track the amount of time elapsed on the sender. */
if (gst_structure_get_uint (caps_struct, "clock-base", &val))
priv->clock_base = val;
else
priv->ext_timestamp = -1;
if (gst_structure_get_uint (caps_struct, "clock-base", &val)) {
priv->clock_base = gst_rtp_buffer_ext_timestamp (&priv->ext_timestamp, val);
priv->ext_timestamp = priv->clock_base;
} else {
priv->clock_base = -1;
priv->ext_timestamp = priv->clock_base;
}
GST_DEBUG_OBJECT (jitterbuffer, "got clock-base %" G_GINT64_FORMAT,
priv->clock_base);
@ -4686,7 +4687,7 @@ do_handle_sync_inband (GstRtpJitterBuffer * jitterbuffer, guint64 ntpnstime)
"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, priv->clock_base,
"clock-base", G_TYPE_UINT64, priv->clock_base & G_MAXUINT32,
"cname", G_TYPE_STRING, cname,
"ssrc", G_TYPE_UINT, priv->last_ssrc,
"inband-ext-rtptime", G_TYPE_UINT64, last_rtptime,
@ -4774,7 +4775,7 @@ do_handle_sync (GstRtpJitterBuffer * jitterbuffer)
"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,
"clock-base", G_TYPE_UINT64, priv->clock_base & G_MAXUINT32,
"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,