Skip to content

Commit

Permalink
rtptwcc: add payloadtype to RTPTWCCPacket
Browse files Browse the repository at this point in the history
The consumer of the stats can then separate between different media-types,
and do individual stats for each of them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
  • Loading branch information
knutinh authored and GStreamer Marge Bot committed Aug 25, 2021
1 parent 8194ab1 commit 0440cb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions gst/rtpmanager/rtpstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions gst/rtpmanager/rtptwcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ typedef struct
GstClockTime socket_ts;
GstClockTime remote_ts;
guint16 seqnum;
guint8 pt;
guint size;
gboolean lost;
} SentPacket;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions gst/rtpmanager/rtptwcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct _RTPTWCCPacket
RTPTWCCPacketStatus status;
guint16 seqnum;
guint size;
guint8 pt;
};

RTPTWCCManager * rtp_twcc_manager_new (guint mtu);
Expand Down

0 comments on commit 0440cb1

Please sign in to comment.