From f64129177e1e124c56eb2bd29d12c6d1022f7e03 Mon Sep 17 00:00:00 2001 From: Johnny Date: Wed, 13 Oct 2021 15:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20RtcpContext=20=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtcp/RtcpContext.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Rtcp/RtcpContext.h b/src/Rtcp/RtcpContext.h index d4e30d7b..b25a4ed3 100644 --- a/src/Rtcp/RtcpContext.h +++ b/src/Rtcp/RtcpContext.h @@ -81,27 +81,13 @@ public: size_t geLostInterval(); protected: - //时间戳抖动值 - double _jitter = 0; //收到或发送的rtp的字节数 size_t _bytes = 0; //收到或发送的rtp的个数 size_t _packets = 0; - //第一个seq的值 - uint16_t _seq_base = 0; - //rtp最大seq - uint16_t _seq_max = 0; - //rtp回环次数 - uint16_t _seq_cycles = 0; - //上次回环发生时,记录的rtp包数 - size_t _last_cycle_packets = 0; - //上次的seq - uint16_t _last_rtp_seq = 0; //上次的rtp时间戳,毫秒 uint32_t _last_rtp_stamp = 0; uint64_t _last_ntp_stamp_ms = 0; - //上次的rtp的系统时间戳(毫秒)用于统计抖动 - uint64_t _last_rtp_sys_stamp = 0; //上次统计的丢包总数 size_t _last_lost = 0; //上次统计应收rtp包总数 @@ -120,6 +106,20 @@ public: }; class RtcpContextForRecv : public RtcpContext { + //时间戳抖动值 + double _jitter = 0; + //第一个seq的值 + uint16_t _seq_base = 0; + //rtp最大seq + uint16_t _seq_max = 0; + //rtp回环次数 + uint16_t _seq_cycles = 0; + //上次回环发生时,记录的rtp包数 + size_t _last_cycle_packets = 0; + //上次的seq + uint16_t _last_rtp_seq = 0; + //上次的rtp的系统时间戳(毫秒)用于统计抖动 + uint64_t _last_rtp_sys_stamp = 0; public: void onRtp(uint16_t seq, uint32_t stamp, uint64_t ntp_stamp_ms, uint32_t sample_rate, size_t bytes) override; Buffer::Ptr createRtcpRR(uint32_t rtcp_ssrc, uint32_t rtp_ssrc) override;