mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-23 01:57:50 +08:00
update server/WebApi.cpp.
This commit is contained in:
parent
df9a9649b0
commit
2f2868fab3
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
||||||
@ -343,6 +343,7 @@ Value makeMediaSourceJson(MediaSource &media){
|
|||||||
switch(codec_type){
|
switch(codec_type){
|
||||||
case TrackAudio : {
|
case TrackAudio : {
|
||||||
auto audio_track = dynamic_pointer_cast<AudioTrack>(track);
|
auto audio_track = dynamic_pointer_cast<AudioTrack>(track);
|
||||||
|
obj["loss"] = media.getLossRate(TrackAudio);
|
||||||
obj["sample_rate"] = audio_track->getAudioSampleRate();
|
obj["sample_rate"] = audio_track->getAudioSampleRate();
|
||||||
obj["channels"] = audio_track->getAudioChannel();
|
obj["channels"] = audio_track->getAudioChannel();
|
||||||
obj["sample_bit"] = audio_track->getAudioSampleBit();
|
obj["sample_bit"] = audio_track->getAudioSampleBit();
|
||||||
@ -350,6 +351,7 @@ Value makeMediaSourceJson(MediaSource &media){
|
|||||||
}
|
}
|
||||||
case TrackVideo : {
|
case TrackVideo : {
|
||||||
auto video_track = dynamic_pointer_cast<VideoTrack>(track);
|
auto video_track = dynamic_pointer_cast<VideoTrack>(track);
|
||||||
|
obj["loss"] = media.getLossRate(TrackVideo);
|
||||||
obj["width"] = video_track->getVideoWidth();
|
obj["width"] = video_track->getVideoWidth();
|
||||||
obj["height"] = video_track->getVideoHeight();
|
obj["height"] = video_track->getVideoHeight();
|
||||||
obj["fps"] = round(video_track->getVideoFps());
|
obj["fps"] = round(video_track->getVideoFps());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user