mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-29 05:24:04 +08:00
Add network traffic statistics (#4239)
Co-authored-by: xiongguangjie <xiong_panda@163.com> Co-authored-by: xia-chu <771730766@qq.com>
This commit is contained in:
@@ -110,13 +110,20 @@ std::shared_ptr<void> MediaSource::getOwnership() {
|
||||
});
|
||||
}
|
||||
|
||||
int MediaSource::getBytesSpeed(TrackType type){
|
||||
size_t MediaSource::getBytesSpeed(TrackType type) {
|
||||
if(type == TrackInvalid || type == TrackMax){
|
||||
return _speed[TrackVideo].getSpeed() + _speed[TrackAudio].getSpeed();
|
||||
}
|
||||
return _speed[type].getSpeed();
|
||||
}
|
||||
|
||||
size_t MediaSource::getTotalBytes(TrackType type) {
|
||||
if (type == TrackInvalid || type == TrackMax) {
|
||||
return _speed[TrackVideo].getTotalBytes() + _speed[TrackAudio].getTotalBytes();
|
||||
}
|
||||
return _speed[type].getTotalBytes();
|
||||
}
|
||||
|
||||
uint64_t MediaSource::getAliveSecond() const {
|
||||
// 使用Ticker对象获取存活时间的目的是防止修改系统时间导致回退 [AUTO-TRANSLATED:68474061]
|
||||
// The purpose of using the Ticker object to obtain the survival time is to prevent the modification of the system time from causing a rollback
|
||||
|
||||
Reference in New Issue
Block a user