新增动态更新rtp server过滤ssrc接口updateRtpServerSSRC(#2390)

This commit is contained in:
xiongziliang
2023-04-21 23:08:48 +08:00
parent c2b8f3e80e
commit b5a0a2e858
5 changed files with 72 additions and 12 deletions

View File

@@ -1182,6 +1182,18 @@ void installWebApi() {
val["hit"] = 1;
});
api_regist("/index/api/updateRtpServerSSRC",[](API_ARGS_MAP){
CHECK_SECRET();
CHECK_ARGS("stream_id", "ssrc");
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
auto it = s_rtpServerMap.find(allArgs["stream_id"]);
if (it == s_rtpServerMap.end()) {
throw ApiRetException("RtpServer not found by stream_id", API::NotFound);
}
it->second->updateSSRC(allArgs["ssrc"]);
});
api_regist("/index/api/listRtpServer",[](API_ARGS_MAP){
CHECK_SECRET();