mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
新增rtp udp收流增加丢包率
This commit is contained in:
@@ -280,6 +280,18 @@ std::shared_ptr<SockInfo> RtpProcess::getOriginSock(MediaSource &sender) const {
|
||||
toolkit::EventPoller::Ptr RtpProcess::getOwnerPoller(MediaSource &sender) {
|
||||
return _sock ? _sock->getPoller() : nullptr;
|
||||
}
|
||||
|
||||
void RtpProcess::setHelper(const std::weak_ptr<RtcpContext> &help)
|
||||
{
|
||||
_help=help;
|
||||
}
|
||||
int RtpProcess::getLossRate(MediaSource &sender, TrackType type)
|
||||
{
|
||||
auto help = _help.lock();
|
||||
auto expected = help->getExpectedPacketsInterval();
|
||||
if (!expected) {
|
||||
return 0;
|
||||
}
|
||||
return help->geLostInterval() * 100 / expected;
|
||||
}
|
||||
}//namespace mediakit
|
||||
#endif//defined(ENABLE_RTPPROXY)
|
||||
Reference in New Issue
Block a user