From 0440cb12debc4db811489227258418d98837474d Mon Sep 17 00:00:00 2001 From: Knut Inge Hvidsten Date: Fri, 26 Mar 2021 11:57:42 +0100 Subject: [PATCH] rtptwcc: add payloadtype to RTPTWCCPacket The consumer of the stats can then separate between different media-types, and do individual stats for each of them. Part-of: --- gst/rtpmanager/rtpstats.c | 1 + gst/rtpmanager/rtptwcc.c | 3 +++ gst/rtpmanager/rtptwcc.h | 1 + 3 files changed, 5 insertions(+) diff --git a/gst/rtpmanager/rtpstats.c b/gst/rtpmanager/rtpstats.c index 45fff37058..0f35046f1e 100644 --- a/gst/rtpmanager/rtpstats.c +++ b/gst/rtpmanager/rtpstats.c @@ -484,6 +484,7 @@ rtp_twcc_stats_get_packets_structure (GArray * twcc_packets) "seqnum", G_TYPE_UINT, pkt->seqnum, "local-ts", G_TYPE_UINT64, pkt->local_ts, "remote-ts", G_TYPE_UINT64, pkt->remote_ts, + "payload-type", G_TYPE_UCHAR, pkt->pt, "size", G_TYPE_UINT, pkt->size, "lost", G_TYPE_BOOLEAN, pkt->status == RTP_TWCC_PACKET_STATUS_NOT_RECV, NULL); diff --git a/gst/rtpmanager/rtptwcc.c b/gst/rtpmanager/rtptwcc.c index 47cf8ae0ab..bcb4fc02c6 100644 --- a/gst/rtpmanager/rtptwcc.c +++ b/gst/rtpmanager/rtptwcc.c @@ -65,6 +65,7 @@ typedef struct GstClockTime socket_ts; GstClockTime remote_ts; guint16 seqnum; + guint8 pt; guint size; gboolean lost; } SentPacket; @@ -842,6 +843,7 @@ sent_packet_init (SentPacket * packet, guint16 seqnum, RTPPacketInfo * pinfo) packet->seqnum = seqnum; packet->ts = pinfo->running_time; packet->size = pinfo->payload_len; + packet->pt = pinfo->pt; packet->remote_ts = GST_CLOCK_TIME_NONE; packet->socket_ts = GST_CLOCK_TIME_NONE; packet->lost = FALSE; @@ -1095,6 +1097,7 @@ rtp_twcc_manager_parse_fci (RTPTWCCManager * twcc, pkt->local_ts = found->ts; } pkt->size = found->size; + pkt->pt = found->pt; GST_LOG ("matching pkt: #%u with local_ts: %" GST_TIME_FORMAT " size: %u", pkt->seqnum, GST_TIME_ARGS (pkt->local_ts), pkt->size); diff --git a/gst/rtpmanager/rtptwcc.h b/gst/rtpmanager/rtptwcc.h index 79b56877a0..a826e9a4c9 100644 --- a/gst/rtpmanager/rtptwcc.h +++ b/gst/rtpmanager/rtptwcc.h @@ -49,6 +49,7 @@ struct _RTPTWCCPacket RTPTWCCPacketStatus status; guint16 seqnum; guint size; + guint8 pt; }; RTPTWCCManager * rtp_twcc_manager_new (guint mtu);