From be34a7ce4d914bdd2b7647fb925f8d7876cac515 Mon Sep 17 00:00:00 2001 From: Heikki Tampio Date: Fri, 9 Dec 2022 10:00:08 +0200 Subject: [PATCH] rtcp: Replace dropped_pkts with lost_pkts Use same term from standard --- include/uvgrtp/rtcp.hh | 2 +- src/rtcp.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uvgrtp/rtcp.hh b/include/uvgrtp/rtcp.hh index 0460c82..ac9ef9b 100644 --- a/include/uvgrtp/rtcp.hh +++ b/include/uvgrtp/rtcp.hh @@ -37,7 +37,7 @@ namespace uvgrtp { struct receiver_statistics { /* receiver stats */ uint32_t received_pkts = 0; /* Number of packets received */ - uint32_t dropped_pkts = 0; /* Number of dropped RTP packets */ + uint32_t lost_pkts = 0; /* Number of dropped RTP packets */ uint32_t received_bytes = 0; /* Number of bytes received excluding RTP Header */ bool received_rtp_packet = false; // since last report diff --git a/src/rtcp.cc b/src/rtcp.cc index c6ea83d..418262b 100644 --- a/src/rtcp.cc +++ b/src/rtcp.cc @@ -766,7 +766,7 @@ void uvgrtp::rtcp::zero_stats(uvgrtp::sender_statistics *stats) void uvgrtp::rtcp::zero_stats(uvgrtp::receiver_statistics *stats) { stats->received_pkts = 0; - stats->dropped_pkts = 0; + stats->lost_pkts = 0; stats->received_bytes = 0; stats->received_rtp_packet = false; @@ -977,7 +977,7 @@ void uvgrtp::rtcp::update_session_statistics(const uvgrtp::frame::rtp_frame *fra int expected = extended_max - participants_[frame->header.ssrc]->stats.base_seq + 1; int dropped = expected - participants_[frame->header.ssrc]->stats.received_pkts; - participants_[frame->header.ssrc]->stats.dropped_pkts = dropped >= 0 ? dropped : 0; + participants_[frame->header.ssrc]->stats.lost_pkts = dropped >= 0 ? dropped : 0; // the arrival time expressed as an RTP timestamp uint32_t arrival = participants_[frame->header.ssrc]->stats.initial_rtp + @@ -1693,7 +1693,7 @@ rtp_error_t uvgrtp::rtcp::generate_report() // only add report blocks if we have received data from them if (p.second->stats.received_rtp_packet) { - uint32_t dropped_packets = p.second->stats.dropped_pkts; + uint32_t dropped_packets = p.second->stats.lost_pkts; // TODO: Fraction should be the number of packets lost compared to number of packets expected (see fraction lost in RFC 3550) // see https://datatracker.ietf.org/doc/html/rfc3550#appendix-A.3