添加停止、恢复rtp代理rtp超时检查功能

This commit is contained in:
sunhui
2020-12-25 16:05:38 +08:00
parent bc125e65be
commit c32c2146b2
7 changed files with 126 additions and 1 deletions

View File

@@ -873,6 +873,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