zlmStreamRegistHookEvent 调整

This commit is contained in:
shikong 2024-03-14 09:15:49 +08:00
parent 0fd058e1c5
commit 7b350e899b

View File

@ -170,18 +170,18 @@ public class DeviceProxyService {
log.info("结束 zlm rtp 推流, app {}, stream {}, ssrc {}", app, callId, ssrc);
zlmMediaService.stopSendRtp(stopSendRtp);
}, 5, TimeUnit.SECONDS);
}, 10, TimeUnit.SECONDS);
// 如果 5秒内 重新注册, 取消停止RTP推流
// 如果 10秒内 重新注册, 取消停止RTP推流
zlmStreamChangeHookService.getRegistHandler(app).put(callId,()->{
schedule.cancel(true);
zlmStreamRegistHookEvent(app, callId, ssrc);
});
// 如果 注销 5.5 秒内 没有再注册, 就彻底取消相关事件的订阅
// 如果 注销 10.5 秒内 没有再注册, 就彻底取消相关事件的订阅
scheduledExecutorService.schedule(()->{
zlmStreamChangeHookService.getRegistHandler(app).remove(callId);
},5500, TimeUnit.MILLISECONDS);
},10500, TimeUnit.MILLISECONDS);
});
});
}