Commit b8d17565 by dingcan

修改代码格式

parent c1b4ccd0
...@@ -280,19 +280,22 @@ std::shared_ptr<SockInfo> RtpProcess::getOriginSock(MediaSource &sender) const { ...@@ -280,19 +280,22 @@ std::shared_ptr<SockInfo> RtpProcess::getOriginSock(MediaSource &sender) const {
toolkit::EventPoller::Ptr RtpProcess::getOwnerPoller(MediaSource &sender) { toolkit::EventPoller::Ptr RtpProcess::getOwnerPoller(MediaSource &sender) {
return _sock ? _sock->getPoller() : nullptr; return _sock ? _sock->getPoller() : nullptr;
} }
void RtpProcess::setHelper(const std::weak_ptr<RtcpContext> &help)
{ void RtpProcess::setHelper(const std::weak_ptr<RtcpContext> help){
_help=help; _help = std::move(help);
} }
int RtpProcess::getLossRate(MediaSource &sender, TrackType type)
{ int RtpProcess::getLossRate(MediaSource &sender, TrackType type){
auto help = _help.lock(); auto help = _help.lock();
if(!help){
return -1;
}
auto expected = help->getExpectedPacketsInterval(); auto expected = help->getExpectedPacketsInterval();
if (!expected) { if (!expected) {
return 0; return 0;
} }
return help->geLostInterval() * 100 / expected; return help->geLostInterval() * 100 / expected;
} }
}//namespace mediakit }//namespace mediakit
#endif//defined(ENABLE_RTPPROXY) #endif//defined(ENABLE_RTPPROXY)
\ No newline at end of file
...@@ -67,7 +67,7 @@ public: ...@@ -67,7 +67,7 @@ public:
int getTotalReaderCount(); int getTotalReaderCount();
void setListener(const std::weak_ptr<MediaSourceEvent> &listener); void setListener(const std::weak_ptr<MediaSourceEvent> &listener);
void setHelper(const std::weak_ptr<RtcpContext> &help); void setHelper(const std::weak_ptr<RtcpContext> help);
int getLossRate(MediaSource &sender, TrackType type) override; int getLossRate(MediaSource &sender, TrackType type) override;
protected: protected:
bool inputFrame(const Frame::Ptr &frame) override; bool inputFrame(const Frame::Ptr &frame) override;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论