mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +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).
|
||||
@@ -343,6 +343,7 @@ Value makeMediaSourceJson(MediaSource &media){
|
||||
switch(codec_type){
|
||||
case TrackAudio : {
|
||||
auto audio_track = dynamic_pointer_cast<AudioTrack>(track);
|
||||
obj["loss"] = media.getLossRate(TrackAudio);
|
||||
obj["sample_rate"] = audio_track->getAudioSampleRate();
|
||||
obj["channels"] = audio_track->getAudioChannel();
|
||||
obj["sample_bit"] = audio_track->getAudioSampleBit();
|
||||
@@ -350,6 +351,7 @@ Value makeMediaSourceJson(MediaSource &media){
|
||||
}
|
||||
case TrackVideo : {
|
||||
auto video_track = dynamic_pointer_cast<VideoTrack>(track);
|
||||
obj["loss"] = media.getLossRate(TrackVideo);
|
||||
obj["width"] = video_track->getVideoWidth();
|
||||
obj["height"] = video_track->getVideoHeight();
|
||||
obj["fps"] = round(video_track->getVideoFps());
|
||||
|
||||
Reference in New Issue
Block a user