rtpstats: Keep number of nacks sent/received per source

Currently, the nack packets sent or received are kept at session level,
which makes it impossible to distinguish how many of these packages were
sent/received per ssrc when several sources are in the same session. This
patch is aligned with the https://www.w3.org/TR/webrtc-stats/#dom-rtcrtpstreamstats

https://bugzilla.gnome.org/show_bug.cgi?id=776714
This commit is contained in:
Santiago Carot-Nemesio 2017-01-02 13:42:04 +01:00 committed by Sebastian Dröge
parent 494246f75c
commit a1e4249131
3 changed files with 10 additions and 1 deletions

View file

@ -2774,6 +2774,8 @@ rtp_session_process_feedback (RTPSession * sess, GstRTCPPacket * packet,
case GST_RTCP_TYPE_RTPFB:
switch (fbtype) {
case GST_RTCP_RTPFB_TYPE_NACK:
if (src)
src->stats.recv_nack_count++;
rtp_session_process_nack (sess, sender_ssrc, media_ssrc,
fci_data, fci_length, current_time);
break;
@ -3526,6 +3528,7 @@ session_nack (const gchar * key, RTPSource * source, ReportData * data)
rtp_source_clear_nacks (source);
data->may_suppress = FALSE;
source->stats.sent_nack_count += n_nacks;
}
/* perform cleanup of sources that timed out */

View file

@ -271,6 +271,8 @@ rtp_source_reset (RTPSource * src)
src->stats.sent_pli_count = 0;
src->stats.sent_fir_count = 0;
src->stats.sent_nack_count = 0;
src->stats.recv_nack_count = 0;
}
static void
@ -400,7 +402,9 @@ rtp_source_create_stats (RTPSource * src)
"sent-pli-count", G_TYPE_UINT, src->stats.sent_pli_count,
"recv-pli-count", G_TYPE_UINT, src->stats.recv_pli_count,
"sent-fir-count", G_TYPE_UINT, src->stats.sent_fir_count,
"recv-fir-count", G_TYPE_UINT, src->stats.recv_fir_count, NULL);
"recv-fir-count", G_TYPE_UINT, src->stats.recv_fir_count,
"sent-nack-count", G_TYPE_UINT, src->stats.sent_nack_count,
"recv-nack-count", G_TYPE_UINT, src->stats.recv_nack_count, NULL);
/* get the last SR. */
have_sr = rtp_source_get_last_sr (src, &time, &ntptime, &rtptime,

View file

@ -142,6 +142,8 @@ typedef struct {
guint recv_pli_count;
guint sent_fir_count;
guint recv_fir_count;
guint sent_nack_count;
guint recv_nack_count;
/* when we received stuff */
GstClockTime prev_rtptime;