rtpjitterbuffer: add RFC7273 active status to stats

Checking whether rtpjitterbuffer actually timestamps the buffers according to
the RFC7273 clock definition and rtpjitterbuffer configuration required looking
at the DEBUG logs.

This commit adds an entry in the rtpjitterbuffer stats to indicate if
conditions are met for RFC7273 to be active.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7829>
This commit is contained in:
François Laignel 2024-11-05 12:52:08 +01:00 committed by GStreamer Marge Bot
parent 49d8921232
commit 874a59bff2
2 changed files with 13 additions and 2 deletions

View File

@ -19596,7 +19596,7 @@
"construct": false,
"construct-only": false,
"controllable": false,
"default": "application/x-rtp-jitterbuffer-stats, num-pushed=(guint64)0, num-lost=(guint64)0, num-late=(guint64)0, num-duplicates=(guint64)0, avg-jitter=(guint64)0, rtx-count=(guint64)0, rtx-success-count=(guint64)0, rtx-per-packet=(double)0, rtx-rtt=(guint64)0;",
"default": "application/x-rtp-jitterbuffer-stats, num-pushed=(guint64)0, num-lost=(guint64)0, num-late=(guint64)0, num-duplicates=(guint64)0, avg-jitter=(guint64)0, rtx-count=(guint64)0, rtx-success-count=(guint64)0, rtx-per-packet=(double)0, rtx-rtt=(guint64)0, rfc7273-active=(boolean)false;",
"mutable": "null",
"readable": true,
"type": "GstStructure",

View File

@ -5695,8 +5695,17 @@ gst_rtp_jitter_buffer_create_stats (GstRtpJitterBuffer * jbuf)
{
GstRtpJitterBufferPrivate *priv = jbuf->priv;
GstStructure *s;
gboolean rfc7273_active;
JBUF_LOCK (priv);
rfc7273_active = priv->jbuf->rfc7273_sync
&& (priv->jbuf->mode == RTP_JITTER_BUFFER_MODE_SLAVE
|| priv->jbuf->mode == RTP_JITTER_BUFFER_MODE_SYNCED)
&& priv->jbuf->media_clock && (priv->jbuf->media_clock_offset != -1)
&& priv->jbuf->pipeline_clock
&& gst_clock_is_synced (priv->jbuf->media_clock);
s = gst_structure_new ("application/x-rtp-jitterbuffer-stats",
"num-pushed", G_TYPE_UINT64, priv->num_pushed,
"num-lost", G_TYPE_UINT64, priv->num_lost,
@ -5706,7 +5715,9 @@ gst_rtp_jitter_buffer_create_stats (GstRtpJitterBuffer * jbuf)
"rtx-count", G_TYPE_UINT64, priv->num_rtx_requests,
"rtx-success-count", G_TYPE_UINT64, priv->num_rtx_success,
"rtx-per-packet", G_TYPE_DOUBLE, priv->avg_rtx_num,
"rtx-rtt", G_TYPE_UINT64, priv->avg_rtx_rtt, NULL);
"rtx-rtt", G_TYPE_UINT64, priv->avg_rtx_rtt,
"rfc7273-active", G_TYPE_BOOLEAN, rfc7273_active, NULL);
JBUF_UNLOCK (priv);
return s;