This commit is contained in:
Johnny 2023-05-02 20:40:40 +08:00
parent 1dd0c69aa0
commit bfec1b1e0e
4 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ size_t RtcpContext::getLost() {
throw std::runtime_error("没有实现, rtp发送者无法统计丢包率"); throw std::runtime_error("没有实现, rtp发送者无法统计丢包率");
} }
size_t RtcpContext::geLostInterval() { size_t RtcpContext::getLostInterval() {
throw std::runtime_error("没有实现, rtp发送者无法统计丢包率"); throw std::runtime_error("没有实现, rtp发送者无法统计丢包率");
} }
@ -231,7 +231,7 @@ size_t RtcpContextForRecv::getLost() {
return getExpectedPackets() - _packets; return getExpectedPackets() - _packets;
} }
size_t RtcpContextForRecv::geLostInterval() { size_t RtcpContextForRecv::getLostInterval() {
auto lost = getLost(); auto lost = getLost();
auto ret = lost - _last_lost; auto ret = lost - _last_lost;
_last_lost = lost; _last_lost = lost;
@ -248,7 +248,7 @@ Buffer::Ptr RtcpContextForRecv::createRtcpRR(uint32_t rtcp_ssrc, uint32_t rtp_ss
uint8_t fraction = 0; uint8_t fraction = 0;
auto expected_interval = getExpectedPacketsInterval(); auto expected_interval = getExpectedPacketsInterval();
if (expected_interval) { if (expected_interval) {
fraction = uint8_t(geLostInterval() << 8 / expected_interval); fraction = uint8_t(getLostInterval() << 8 / expected_interval);
} }
item->fraction = fraction; item->fraction = fraction;

View File

@ -78,7 +78,7 @@ public:
/** /**
* *
*/ */
virtual size_t geLostInterval(); virtual size_t getLostInterval();
protected: protected:
// 收到或发送的rtp的字节数 // 收到或发送的rtp的字节数
@ -120,7 +120,7 @@ public:
size_t getExpectedPackets() const override; size_t getExpectedPackets() const override;
size_t getExpectedPacketsInterval() override; size_t getExpectedPacketsInterval() override;
size_t getLost() override; size_t getLost() override;
size_t geLostInterval() override; size_t getLostInterval() override;
void onRtcp(RtcpHeader *rtcp) override; void onRtcp(RtcpHeader *rtcp) override;
private: private:

View File

@ -299,7 +299,7 @@ float RtpProcess::getLossRate(MediaSource &sender, TrackType type) {
if (!expected) { if (!expected) {
return -1; return -1;
} }
return geLostInterval() * 100 / expected; return getLostInterval() * 100 / expected;
} }
}//namespace mediakit }//namespace mediakit

View File

@ -696,7 +696,7 @@ public:
if (!expected) { if (!expected) {
return -1; return -1;
} }
return _rtcp_context.geLostInterval() * 100 / expected; return _rtcp_context.getLostInterval() * 100 / expected;
} }
private: private: