mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 04:25:58 +08:00
!17 【功能请求】 /index/api/getMediaList接口 增加LOSS字段用于统计每个轨道丢包率反馈
* update webrtc/WebRtcPusher.h. * update webrtc/WebRtcPusher.cpp. * update webrtc/WebRtcTransport.h. * update webrtc/WebRtcTransport.cpp. * update src/Common/MediaSource.h. * update src/Common/MediaSource.cpp. * update server/WebApi.cpp.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
||||
*
|
||||
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
||||
@@ -213,6 +213,14 @@ bool MediaSource::close(bool force) {
|
||||
return listener->close(*this,force);
|
||||
}
|
||||
|
||||
int MediaSource::getLossRate(mediakit::TrackType type) {
|
||||
auto listener = _listener.lock();
|
||||
if (!listener) {
|
||||
return -1;
|
||||
}
|
||||
return listener->getLossRate(*this, type);
|
||||
}
|
||||
|
||||
void MediaSource::onReaderChanged(int size) {
|
||||
auto listener = _listener.lock();
|
||||
if (listener) {
|
||||
@@ -690,6 +698,14 @@ void MediaSourceEventInterceptor::onRegist(MediaSource &sender, bool regist) {
|
||||
}
|
||||
}
|
||||
|
||||
int MediaSourceEventInterceptor::getLossRate(MediaSource &sender, TrackType type){
|
||||
auto listener = _listener.lock();
|
||||
if (listener) {
|
||||
return listener->getLossRate(sender, type);
|
||||
}
|
||||
return -1; //异常返回-1
|
||||
}
|
||||
|
||||
bool MediaSourceEventInterceptor::setupRecord(MediaSource &sender, Recorder::type type, bool start, const string &custom_path, size_t max_second) {
|
||||
auto listener = _listener.lock();
|
||||
if (!listener) {
|
||||
|
||||
Reference in New Issue
Block a user