Merge pull request #651 from sunhui2013/master

添加停止、恢复rtp代理rtp超时检查功能,解决播放器暂停后断流问题
This commit is contained in:
夏楚
2020-12-27 20:56:33 +08:00
committed by GitHub
7 changed files with 126 additions and 1 deletions

View File

@@ -875,6 +875,37 @@ void installWebApi() {
}
});
api_regist1("/index/api/pauseRtpCheck", [](API_ARGS1) {
CHECK_SECRET();
CHECK_ARGS("stream_id");
//只是暂停流的检查流媒体服务器做为流负载服务收流就转发RTSP/RTMP有自己暂停协议
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
auto it = s_rtpServerMap.find(allArgs["stream_id"]);
if (it == s_rtpServerMap.end())
{
val["hit"] = 0;
return;
}
auto server = it->second;
server->pauseRtpCheck();
val["hit"] = 1;
});
api_regist1("/index/api/resumeRtpCheck", [](API_ARGS1) {
CHECK_SECRET();
CHECK_ARGS("stream_id");
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
auto it = s_rtpServerMap.find(allArgs["stream_id"]);
if (it == s_rtpServerMap.end())
{
val["hit"] = 0;
return;
}
auto server = it->second;
server->resumeRtpCheck();
val["hit"] = 1;
});
#endif//ENABLE_RTPPROXY