mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-22 13:27:52 +08:00
Compare commits
3 Commits
8e49008a06
...
5e9bc1fdca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e9bc1fdca | ||
|
|
111274c08a | ||
|
|
da98101aac |
@ -147,8 +147,8 @@ public interface PlatformChannelMapper {
|
||||
" <if test='query != null'> " +
|
||||
" AND (coalesce(wdc.gb_device_id, wdc.device_id) LIKE concat('%',#{query},'%') OR wpgc.custom_device_id LIKE concat('%',#{query},'%') " +
|
||||
" OR coalesce(wdc.gb_name, wdc.name) LIKE concat('%',#{query},'%') OR wpgc.custom_name LIKE concat('%',#{query},'%'))</if> " +
|
||||
" <if test='online == true'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'ON'</if> " +
|
||||
" <if test='online == false'> AND coalesce(wpgc.status, wdc.gb_status, wdc.status) = 'OFF'</if> " +
|
||||
" <if test='online == true'> AND coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) = 'ON'</if> " +
|
||||
" <if test='online == false'> AND coalesce(wpgc.custom_status, wdc.gb_status, wdc.status) = 'OFF'</if> " +
|
||||
" <if test='hasShare == true'> AND wpgc.platform_id = #{platformId}</if> " +
|
||||
" <if test='hasShare == false'> AND wpgc.platform_id is null</if> " +
|
||||
" <if test='dataType != null'> AND wdc.data_type = #{dataType}</if> " +
|
||||
|
||||
@ -28,7 +28,7 @@ public class SendRtpServerServiceImpl implements ISendRtpServerService {
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<Object, Object> redisTemplate;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public SendRtpInfo createSendRtpInfo(MediaServer mediaServer, String ip, Integer port, String ssrc, String requesterId,
|
||||
@ -230,31 +230,27 @@ public class SendRtpServerServiceImpl implements ISendRtpServerService {
|
||||
log.warn("{}获取redis连接信息失败", mediaServer.getId());
|
||||
return -1;
|
||||
}
|
||||
return getSendPort(startPort, endPort, sendIndexKey, sendRtpSet);
|
||||
}
|
||||
|
||||
private synchronized int getSendPort(int startPort, int endPort, String sendIndexKey, Set<Integer> sendRtpPortSet){
|
||||
// TODO 这里改为只取偶数端口
|
||||
RedisAtomicInteger redisAtomicInteger = new RedisAtomicInteger(sendIndexKey , redisTemplate.getConnectionFactory());
|
||||
if (redisAtomicInteger.get() < startPort) {
|
||||
redisAtomicInteger.set(startPort);
|
||||
return startPort;
|
||||
}else {
|
||||
int port = redisAtomicInteger.getAndIncrement();
|
||||
if (port > endPort) {
|
||||
redisAtomicInteger.set(startPort);
|
||||
if (sendRtpPortSet.contains(startPort)) {
|
||||
return getSendPort(startPort, endPort, sendIndexKey, sendRtpPortSet);
|
||||
}else {
|
||||
return startPort;
|
||||
for (int i = 0; i < endPort - startPort; i++) {
|
||||
int port = redisAtomicInteger.getAndIncrement();
|
||||
if (port > endPort) {
|
||||
redisAtomicInteger.set(startPort);
|
||||
if (sendRtpSet.contains(startPort)) {
|
||||
continue;
|
||||
}else {
|
||||
return startPort;
|
||||
}
|
||||
}
|
||||
if (!sendRtpSet.contains(port)) {
|
||||
return port;
|
||||
}
|
||||
}
|
||||
if (sendRtpPortSet.contains(port)) {
|
||||
return getSendPort(startPort, endPort, sendIndexKey, sendRtpPortSet);
|
||||
}else {
|
||||
return port;
|
||||
}
|
||||
}
|
||||
log.warn("{}获取发送端口失败, 无可用端口", mediaServer.getId());
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -861,7 +861,7 @@
|
||||
320623,如东县,3206
|
||||
320681,启东市,3206
|
||||
320682,如皋市,3206
|
||||
320684,海门市,3206
|
||||
320684,海门区,3206
|
||||
320685,海安市,3206
|
||||
3207,连云港市,32
|
||||
320703,连云区,3207
|
||||
@ -918,8 +918,6 @@
|
||||
33,浙江省,
|
||||
3301,杭州市,33
|
||||
330102,上城区,3301
|
||||
330103,下城区,3301
|
||||
330104,江干区,3301
|
||||
330105,拱墅区,3301
|
||||
330106,西湖区,3301
|
||||
330108,滨江区,3301
|
||||
@ -927,6 +925,8 @@
|
||||
330110,余杭区,3301
|
||||
330111,富阳区,3301
|
||||
330112,临安区,3301
|
||||
330113,临平区,3301
|
||||
330114,钱塘区,3301
|
||||
330122,桐庐县,3301
|
||||
330127,淳安县,3301
|
||||
330182,建德市,3301
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user