From bfec1b1e0e14dd7332aa5357caa39e9ba7241418 Mon Sep 17 00:00:00 2001 From: Johnny Date: Tue, 2 May 2023 20:40:40 +0800 Subject: [PATCH] fix typo --- src/Rtcp/RtcpContext.cpp | 6 +++--- src/Rtcp/RtcpContext.h | 4 ++-- src/Rtp/RtpProcess.cpp | 2 +- webrtc/WebRtcTransport.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Rtcp/RtcpContext.cpp b/src/Rtcp/RtcpContext.cpp index 796d3303..6d4469b4 100644 --- a/src/Rtcp/RtcpContext.cpp +++ b/src/Rtcp/RtcpContext.cpp @@ -34,7 +34,7 @@ size_t RtcpContext::getLost() { throw std::runtime_error("没有实现, rtp发送者无法统计丢包率"); } -size_t RtcpContext::geLostInterval() { +size_t RtcpContext::getLostInterval() { throw std::runtime_error("没有实现, rtp发送者无法统计丢包率"); } @@ -231,7 +231,7 @@ size_t RtcpContextForRecv::getLost() { return getExpectedPackets() - _packets; } -size_t RtcpContextForRecv::geLostInterval() { +size_t RtcpContextForRecv::getLostInterval() { auto lost = getLost(); auto ret = lost - _last_lost; _last_lost = lost; @@ -248,7 +248,7 @@ Buffer::Ptr RtcpContextForRecv::createRtcpRR(uint32_t rtcp_ssrc, uint32_t rtp_ss uint8_t fraction = 0; auto expected_interval = getExpectedPacketsInterval(); if (expected_interval) { - fraction = uint8_t(geLostInterval() << 8 / expected_interval); + fraction = uint8_t(getLostInterval() << 8 / expected_interval); } item->fraction = fraction; diff --git a/src/Rtcp/RtcpContext.h b/src/Rtcp/RtcpContext.h index 31b6167d..79920311 100644 --- a/src/Rtcp/RtcpContext.h +++ b/src/Rtcp/RtcpContext.h @@ -78,7 +78,7 @@ public: /** * 上次结果与本次结果间丢包个数 */ - virtual size_t geLostInterval(); + virtual size_t getLostInterval(); protected: // 收到或发送的rtp的字节数 @@ -120,7 +120,7 @@ public: size_t getExpectedPackets() const override; size_t getExpectedPacketsInterval() override; size_t getLost() override; - size_t geLostInterval() override; + size_t getLostInterval() override; void onRtcp(RtcpHeader *rtcp) override; private: diff --git a/src/Rtp/RtpProcess.cpp b/src/Rtp/RtpProcess.cpp index fac1bd2b..8b6bcb3d 100644 --- a/src/Rtp/RtpProcess.cpp +++ b/src/Rtp/RtpProcess.cpp @@ -299,7 +299,7 @@ float RtpProcess::getLossRate(MediaSource &sender, TrackType type) { if (!expected) { return -1; } - return geLostInterval() * 100 / expected; + return getLostInterval() * 100 / expected; } }//namespace mediakit diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 7dc9e816..fe8c6e5c 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -696,7 +696,7 @@ public: if (!expected) { return -1; } - return _rtcp_context.geLostInterval() * 100 / expected; + return _rtcp_context.getLostInterval() * 100 / expected; } private: