rtc拉流代理支持显示sockInfo和码率

This commit is contained in:
mtdxc
2025-09-29 09:00:46 +08:00
committed by 夏楚
parent 016f6e0e59
commit 13f603328f
5 changed files with 40 additions and 3 deletions

View File

@@ -2023,4 +2023,24 @@ Json::Value IceAgent::getChecklistInfo() const {
return result;
}
size_t IceAgent::getRecvSpeed() {
size_t ret = 0;
for (auto s : _socket_candidate_manager.getAllSockets()) {
if (s && s->getSock()) {
ret += s->getSock()->getRecvSpeed();
}
}
return ret;
}
size_t IceAgent::getRecvTotalBytes() {
size_t ret = 0;
for (auto s : _socket_candidate_manager.getAllSockets()) {
if (s && s->getSock()) {
ret += s->getSock()->getRecvTotalBytes();
}
}
return ret;
}
} // namespace RTC