diff options
author | Tulio Beloqui <tulio.beloqui@pexip.com> | 2021-04-13 17:19:22 +0300 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-08-25 11:36:06 +0300 |
commit | 266c2d06198030bb523c37ef1b27f96e639f965f (patch) | |
tree | 830953b5642be13cc295017d1f82d387fc0b765c /gst/rtpmanager/rtptwcc.c | |
parent | 0440cb12debc4db811489227258418d98837474d (diff) |
rtptwcc: changes to use rtp buffer arrival time and current time.
For TWCC we are more interested to track the arrival time (receive side)
and the current time (sender side) of the buffers rather than the
running time.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
Diffstat (limited to 'gst/rtpmanager/rtptwcc.c')
-rw-r--r-- | gst/rtpmanager/rtptwcc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gst/rtpmanager/rtptwcc.c b/gst/rtpmanager/rtptwcc.c index bcb4fc02c..691428c21 100644 --- a/gst/rtpmanager/rtptwcc.c +++ b/gst/rtpmanager/rtptwcc.c @@ -159,7 +159,11 @@ recv_packet_init (RecvPacket * packet, guint16 seqnum, RTPPacketInfo * pinfo) { memset (packet, 0, sizeof (RecvPacket)); packet->seqnum = seqnum; - packet->ts = pinfo->running_time; + + if (GST_CLOCK_TIME_IS_VALID (pinfo->arrival_time)) + packet->ts = pinfo->arrival_time; + else + packet->ts = pinfo->current_time; } static guint8 @@ -784,7 +788,7 @@ rtp_twcc_manager_recv_packet (RTPTWCCManager * twcc, RTPPacketInfo * pinfo) GST_LOG ("Receive: twcc-seqnum: %u, pt: %u, marker: %d, ts: %" GST_TIME_FORMAT, seqnum, pinfo->pt, pinfo->marker, - GST_TIME_ARGS (pinfo->running_time)); + GST_TIME_ARGS (pinfo->arrival_time)); if (!pinfo->marker) twcc->packet_count_no_marker++; @@ -841,7 +845,7 @@ static void sent_packet_init (SentPacket * packet, guint16 seqnum, RTPPacketInfo * pinfo) { packet->seqnum = seqnum; - packet->ts = pinfo->running_time; + packet->ts = pinfo->current_time; packet->size = pinfo->payload_len; packet->pt = pinfo->pt; packet->remote_ts = GST_CLOCK_TIME_NONE; @@ -864,8 +868,9 @@ rtp_twcc_manager_send_packet (RTPTWCCManager * twcc, RTPPacketInfo * pinfo) g_array_append_val (twcc->sent_packets, packet); - GST_LOG ("Send: twcc-seqnum: %u, pt: %u, marker: %d, ts: %" GST_TIME_FORMAT, - seqnum, pinfo->pt, pinfo->marker, GST_TIME_ARGS (pinfo->running_time)); + GST_LOG ("Send: twcc-seqnum: %u, pt: %u, marker: %d, ts: %" + GST_TIME_FORMAT, seqnum, pinfo->pt, pinfo->marker, + GST_TIME_ARGS (pinfo->current_time)); } static void |