Skip to content

Commit

Permalink
Stats Packets are in fifo
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaBaranov committed May 29, 2024
1 parent d06e07b commit 766fb6e
Show file tree
Hide file tree
Showing 3 changed files with 204 additions and 259 deletions.
7 changes: 4 additions & 3 deletions subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,15 @@ gst_rtp_rtx_buffer_new (GstRtpRtxSend * rtx, GstBuffer * buffer, guint8 padlen)
SSRCRtxData *data;
guint32 ssrc;
guint16 seqnum;
guint32 orig_ssrc;
guint16 orig_seqnum;
guint8 fmtp;

gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp);

/* get needed data from GstRtpRtxSend */
ssrc = gst_rtp_buffer_get_ssrc (&rtp);
data = gst_rtp_rtx_send_get_ssrc_data (rtx, ssrc);
orig_ssrc = gst_rtp_buffer_get_ssrc (&rtp);
data = gst_rtp_rtx_send_get_ssrc_data (rtx, orig_ssrc);
ssrc = data->rtx_ssrc;
seqnum = data->next_seqnum++;
fmtp = GPOINTER_TO_UINT (g_hash_table_lookup (rtx->rtx_pt_map,
Expand All @@ -785,7 +786,7 @@ gst_rtp_rtx_buffer_new (GstRtpRtxSend * rtx, GstBuffer * buffer, guint8 padlen)
"rtx seqnum: %u, rtx ssrc: %X", orig_seqnum,
seqnum, ssrc);

gst_buffer_add_rtp_repair_meta (new_buffer, ssrc, &orig_seqnum, 1);
gst_buffer_add_rtp_repair_meta (new_buffer, orig_ssrc, &orig_seqnum, 1);

/* gst_rtp_buffer_map does not map the payload so do it now */
gst_rtp_buffer_get_payload (&rtp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ void rtp_reception_stats_update_reception(RTPReceptionStats *stats,
Block * block;
if (!g_hash_table_lookup_extended (stats->seqnum_2_blocks,
GUINT_TO_POINTER (key), NULL, (gpointer *)&block)) {
GST_WARNING ("Got feedback for the data packet which was not yet covered with"
" any FEC block, seqnum: %u, ssrc: %u", seq, ssrc);
} else {
gsize idx = 0;
// Try to find it among the data packets.
Expand Down Expand Up @@ -244,6 +242,8 @@ _update_block (RTPReceptionStats *stats, Block * block)
// If we don't know the state of any packet in the block, let's
// return unknown.
if (cur_state == RTP_RECEPTION_PKT_UNKNOWN) {
GST_WARNING ("Unknown state of the packet, ssrc: %u, seq: %u", block->ssrc,
g_array_index (block->seqs, guint16, i));
return RTP_RECEPTION_PKT_UNKNOWN;
} else if (cur_state == RTP_RECEPTION_PKT_LOST) {
loss_count++;
Expand Down
Loading

0 comments on commit 766fb6e

Please sign in to comment.