mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-29 21:47:50 +08:00
Compare commits
4 Commits
89bb56c6b1
...
2fe9769716
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fe9769716 | ||
|
|
875c4aed6d | ||
|
|
2fc63caf13 | ||
|
|
75c38d6c9a |
@ -859,6 +859,9 @@ public class PlayServiceImpl implements IPlayService {
|
||||
}
|
||||
}else {
|
||||
log.info("[Invite 200OK] 收到invite 200, 发现下级自定义了ssrc: {}", ssrcInResponse);
|
||||
String oldStreamId = String.format("%08x", Long.parseLong(ssrcInfo.getSsrc())).toUpperCase();
|
||||
String newStreamId = String.format("%08x", Long.parseLong(ssrcInResponse)).toUpperCase();
|
||||
receiveRtpServerService.refreshAuthenticateInfo(oldStreamId, newStreamId);
|
||||
// ssrc 不一致
|
||||
if (mediaServerItem.isRtpEnable()) {
|
||||
// 多端口
|
||||
|
||||
@ -50,7 +50,7 @@ public class SSRCFactory {
|
||||
public void init() {
|
||||
String sipDomain = sipConfig.getDomain();
|
||||
domainPart = sipDomain.length() >= 8 ? sipDomain.substring(3, 8) : sipDomain;
|
||||
scheduler.scheduleAtFixedRate(this::rebuild, 10, 30, TimeUnit.SECONDS);
|
||||
scheduler.scheduleAtFixedRate(this::rebuild, 5, 5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public String getPlaySsrc(String mediaServerId) {
|
||||
@ -127,7 +127,7 @@ public class SSRCFactory {
|
||||
usedMap.put(server.getId(), bits);
|
||||
if (count > 8000) {
|
||||
log.info("[SSRC重建] 媒体节点 {} 的SSRC使用率已超过80%,请注意扩展服务提升性能", server.getId());
|
||||
} else {
|
||||
}
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("[SSRC重建] 节点 {} 已占用 {} 个SSRC", server.getId(), count);
|
||||
}
|
||||
@ -135,4 +135,3 @@ public class SSRCFactory {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,4 +39,6 @@ public interface IReceiveRtpServerService {
|
||||
void addAuthenticateInfo(String streamId, String streamReplace, Boolean enableAudio, Boolean enableMp4, Integer mp4MaxSecond);
|
||||
|
||||
ResultForOnPublish getAuthenticateInfo(String streamId);
|
||||
|
||||
void refreshAuthenticateInfo(String oldStreamId, String newStreamId);
|
||||
}
|
||||
|
||||
@ -406,4 +406,22 @@ public class RtpServerServiceImpl implements IReceiveRtpServerService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshAuthenticateInfo(String oldStreamId, String newStreamId) {
|
||||
if (oldStreamId == null || newStreamId == null || oldStreamId.equals(newStreamId)) {
|
||||
return;
|
||||
}
|
||||
String oldKey = String.format("%s:%s", VideoManagerConstants.RTP_AUTHENTICATE, oldStreamId);
|
||||
Object obj = redisTemplate.opsForValue().get(oldKey);
|
||||
if (obj instanceof ResultForOnPublish) {
|
||||
String newKey = String.format("%s:%s", VideoManagerConstants.RTP_AUTHENTICATE, newStreamId);
|
||||
redisTemplate.opsForValue().set(newKey, obj);
|
||||
redisTemplate.expire(newKey, 60, TimeUnit.SECONDS);
|
||||
redisTemplate.delete(oldKey);
|
||||
log.info("[刷新RTP鉴权信息] {} -> {}", oldStreamId, newStreamId);
|
||||
} else {
|
||||
log.warn("[刷新RTP鉴权信息] 未找到旧key: {}", oldKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user