mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
修复编译问题
This commit is contained in:
parent
e8b0993493
commit
c9d755f4e8
@ -1 +1 @@
|
|||||||
Subproject commit dd101bcc31290e3d1ec1ae939d937f2712719a0d
|
Subproject commit a71747c7d0811263b12ef9112ec13fdffe2ab171
|
@ -1025,24 +1025,20 @@ void installWebApi() {
|
|||||||
api_regist("/index/api/openRtpServer",[](API_ARGS_MAP){
|
api_regist("/index/api/openRtpServer",[](API_ARGS_MAP){
|
||||||
CHECK_SECRET();
|
CHECK_SECRET();
|
||||||
CHECK_ARGS("port", "enable_tcp", "stream_id");
|
CHECK_ARGS("port", "enable_tcp", "stream_id");
|
||||||
bool enable_reuse=true;
|
bool enable_reuse = true;
|
||||||
if(!allArgs["enable_reuse"].empty()){
|
if (!allArgs["enable_reuse"].empty()) {
|
||||||
enable_reuse = allArgs["enable_reuse"].as<bool>();
|
enable_reuse = allArgs["enable_reuse"].as<bool>();
|
||||||
}
|
}
|
||||||
auto stream_id = allArgs["stream_id"];
|
auto stream_id = allArgs["stream_id"];
|
||||||
|
|
||||||
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
|
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
|
||||||
if(s_rtpServerMap.find(stream_id) != s_rtpServerMap.end()) {
|
if (s_rtpServerMap.find(stream_id) != s_rtpServerMap.end()) {
|
||||||
//为了防止RtpProcess所有权限混乱的问题,不允许重复添加相同的stream_id
|
//为了防止RtpProcess所有权限混乱的问题,不允许重复添加相同的stream_id
|
||||||
throw InvalidArgsException("该stream_id已存在");
|
throw InvalidArgsException("该stream_id已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RtpServer::Ptr server = std::make_shared<RtpServer>();
|
RtpServer::Ptr server = std::make_shared<RtpServer>();
|
||||||
server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(),"0.0.0.0",enable_reuse);
|
server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(), "0.0.0.0", enable_reuse);
|
||||||
server->setOnDetach([stream_id]() {
|
server->setOnDetach([stream_id]() {
|
||||||
//设置rtp超时移除事件
|
//设置rtp超时移除事件
|
||||||
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
|
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
|
||||||
|
Loading…
Reference in New Issue
Block a user