Skip to content

rtpsource: fix stats for queued packets

When packets are queued in rtpsource (for example during source probation) their stats are not considered, they are usually only a few packets but maybe it's worth keeping track of their stats for completeness.

When looking at this I noticed two things:

So I am marking the MR as WIP and asking the following question:

Should lower level overhead been taken into account also for bitrate estimation?

If it should then a change like the following could make sense:

diff --git a/gst/rtpmanager/rtpsource.c b/gst/rtpmanager/rtpsource.c
index aef681f57..b7d40b519 100644
--- a/gst/rtpmanager/rtpsource.c
+++ b/gst/rtpmanager/rtpsource.c
@@ -1214,7 +1214,7 @@ update_receiver_stats (RTPSource * src, RTPPacketInfo * pinfo,
   src->stats.bytes_received += pinfo->bytes;
   src->stats.packets_received += pinfo->packets;
   /* for the bitrate estimation */
-  src->bytes_received += pinfo->payload_len;
+  src->bytes_received += pinfo->bytes;

   GST_LOG ("seq %u, PC: %" G_GUINT64_FORMAT ", OC: %" G_GUINT64_FORMAT,
       seqnr, src->stats.packets_received, src->stats.octets_received);

If it shoudln't then maybe lower level overhead can be removed from pinfo->bytes, and consequently from stats.bytes_received too.

This would also affect some tests I am writing to check stats values after pushing packets.

Thanks, Antonio

Edited by Antonio Ospite

Merge request reports

Loading