mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-22 05:17:49 +08:00
Compare commits
5 Commits
fd1f2b0fdf
...
83ccc37ff2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83ccc37ff2 | ||
|
|
ae44feef5b | ||
|
|
3c4cc4c98e | ||
|
|
24f2906cf2 | ||
|
|
34d1dbb399 |
@ -100,7 +100,7 @@ public class MobilePositionController {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
String key = DeferredResultHolder.CALLBACK_CMD_MOBILE_POSITION + deviceId;
|
||||
try {
|
||||
cmder.mobilePostitionQuery(device, event -> {
|
||||
cmder.mobilePositionQuery(device, event -> {
|
||||
RequestMessage msg = new RequestMessage();
|
||||
msg.setId(uuid);
|
||||
msg.setKey(key);
|
||||
|
||||
@ -264,7 +264,7 @@ public interface ISIPCommander {
|
||||
*
|
||||
* @param device 视频设备
|
||||
*/
|
||||
void mobilePostitionQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException;
|
||||
void mobilePositionQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException;
|
||||
|
||||
/**
|
||||
* 订阅、取消订阅移动位置
|
||||
|
||||
@ -1153,21 +1153,21 @@ public class SIPCommander implements ISIPCommander {
|
||||
* @param device 视频设备
|
||||
*/
|
||||
@Override
|
||||
public void mobilePostitionQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException {
|
||||
public void mobilePositionQuery(Device device, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException {
|
||||
|
||||
StringBuffer mobilePostitionXml = new StringBuffer(200);
|
||||
StringBuffer mobilePositionXml = new StringBuffer(200);
|
||||
String charset = device.getCharset();
|
||||
mobilePostitionXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
|
||||
mobilePostitionXml.append("<Query>\r\n");
|
||||
mobilePostitionXml.append("<CmdType>MobilePosition</CmdType>\r\n");
|
||||
mobilePostitionXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
|
||||
mobilePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
||||
mobilePostitionXml.append("<Interval>60</Interval>\r\n");
|
||||
mobilePostitionXml.append("</Query>\r\n");
|
||||
mobilePositionXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
|
||||
mobilePositionXml.append("<Query>\r\n");
|
||||
mobilePositionXml.append("<CmdType>MobilePosition</CmdType>\r\n");
|
||||
mobilePositionXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
|
||||
mobilePositionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
||||
mobilePositionXml.append("<Interval>60</Interval>\r\n");
|
||||
mobilePositionXml.append("</Query>\r\n");
|
||||
|
||||
|
||||
|
||||
Request request = headerProvider.createMessageRequest(device, mobilePostitionXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
||||
Request request = headerProvider.createMessageRequest(device, mobilePositionXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()));
|
||||
|
||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent);
|
||||
|
||||
@ -1182,19 +1182,19 @@ public class SIPCommander implements ISIPCommander {
|
||||
@Override
|
||||
public SIPRequest mobilePositionSubscribe(Device device, SipTransactionInfo sipTransactionInfo, SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException {
|
||||
|
||||
StringBuffer subscribePostitionXml = new StringBuffer(200);
|
||||
StringBuffer subscribePositionXml = new StringBuffer(200);
|
||||
String charset = device.getCharset();
|
||||
subscribePostitionXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
|
||||
subscribePostitionXml.append("<Query>\r\n");
|
||||
subscribePostitionXml.append("<CmdType>MobilePosition</CmdType>\r\n");
|
||||
subscribePostitionXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
|
||||
subscribePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
||||
subscribePositionXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
|
||||
subscribePositionXml.append("<Query>\r\n");
|
||||
subscribePositionXml.append("<CmdType>MobilePosition</CmdType>\r\n");
|
||||
subscribePositionXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
|
||||
subscribePositionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n");
|
||||
if (device.getSubscribeCycleForMobilePosition() > 0) {
|
||||
subscribePostitionXml.append("<Interval>" + device.getMobilePositionSubmissionInterval() + "</Interval>\r\n");
|
||||
subscribePositionXml.append("<Interval>" + device.getMobilePositionSubmissionInterval() + "</Interval>\r\n");
|
||||
}else {
|
||||
subscribePostitionXml.append("<Interval>5</Interval>\r\n");
|
||||
subscribePositionXml.append("<Interval>5</Interval>\r\n");
|
||||
}
|
||||
subscribePostitionXml.append("</Query>\r\n");
|
||||
subscribePositionXml.append("</Query>\r\n");
|
||||
|
||||
CallIdHeader callIdHeader;
|
||||
|
||||
@ -1209,7 +1209,7 @@ public class SIPCommander implements ISIPCommander {
|
||||
// 移动位置订阅有效期不小于 30 秒
|
||||
subscribeCycleForMobilePosition = Math.max(subscribeCycleForMobilePosition, 30);
|
||||
}
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, subscribePostitionXml.toString(), sipTransactionInfo, subscribeCycleForMobilePosition, "presence",callIdHeader); //Position;id=" + tm.substring(tm.length() - 4));
|
||||
SIPRequest request = (SIPRequest) headerProvider.createSubscribeRequest(device, subscribePositionXml.toString(), sipTransactionInfo, subscribeCycleForMobilePosition, "presence",callIdHeader); //Position;id=" + tm.substring(tm.length() - 4));
|
||||
|
||||
sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent, okEvent);
|
||||
return request;
|
||||
|
||||
@ -339,23 +339,23 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(MediaServer mediaSerItem) {
|
||||
if (mediaServerMapper.queryOne(mediaSerItem.getId(), userSetting.getServerId()) != null) {
|
||||
mediaServerMapper.update(mediaSerItem);
|
||||
public void update(MediaServer mediaServer) {
|
||||
if (mediaServerMapper.queryOne(mediaServer.getId()) != null) {
|
||||
mediaServerMapper.update(mediaServer);
|
||||
}else {
|
||||
mediaServerMapper.add(mediaSerItem);
|
||||
mediaServerMapper.add(mediaServer);
|
||||
}
|
||||
|
||||
MediaServer mediaServerInRedis = getOne(mediaSerItem.getId());
|
||||
MediaServer mediaServerInRedis = getOne(mediaServer.getId());
|
||||
|
||||
if (mediaServerInRedis == null || !ssrcFactory.hasMediaServerSSRC(mediaSerItem.getId())) {
|
||||
ssrcFactory.initMediaServerSSRC(mediaSerItem.getId(),null);
|
||||
if (mediaServerInRedis == null || !ssrcFactory.hasMediaServerSSRC(mediaServer.getId())) {
|
||||
ssrcFactory.initMediaServerSSRC(mediaServer.getId(),null);
|
||||
}
|
||||
|
||||
String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId();
|
||||
redisTemplate.opsForHash().put(key, mediaSerItem.getId(), mediaSerItem);
|
||||
if (mediaSerItem.isStatus()) {
|
||||
resetOnlineServerItem(mediaSerItem);
|
||||
redisTemplate.opsForHash().put(key, mediaServer.getId(), mediaServer);
|
||||
if (mediaServer.isStatus()) {
|
||||
resetOnlineServerItem(mediaServer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
MediaServer mediaServer = (MediaServer) redisTemplate.opsForHash().get(key, mediaServerId);
|
||||
if (mediaServer == null) {
|
||||
// 尝试从数据库获取
|
||||
mediaServer = mediaServerMapper.queryOne(mediaServerId, userSetting.getServerId());
|
||||
mediaServer = mediaServerMapper.queryOneWithServerId(mediaServerId, userSetting.getServerId());
|
||||
if (mediaServer != null) {
|
||||
redisTemplate.opsForHash().put(key, mediaServer.getId(), mediaServer);
|
||||
}
|
||||
@ -488,7 +488,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
log.info("[添加媒体节点] 失败, mediaServer的类型:为空");
|
||||
return;
|
||||
}
|
||||
if (mediaServerMapper.queryOne(mediaServer.getId(), userSetting.getServerId()) != null) {
|
||||
if (mediaServerMapper.queryOne(mediaServer.getId()) != null) {
|
||||
log.info("[添加媒体节点] 失败, 媒体服务ID已存在,请修改媒体服务器配置, {}", mediaServer.getId());
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(),"保存失败,媒体服务ID [ " + mediaServer.getId() + " ] 已存在,请修改媒体服务器配置");
|
||||
}
|
||||
@ -597,7 +597,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
}
|
||||
MediaServer mediaServer = mediaNodeServerService.checkMediaServer(ip, port, secret);
|
||||
if (mediaServer != null) {
|
||||
if (mediaServerMapper.queryOne(mediaServer.getId(), userSetting.getServerId()) != null) {
|
||||
if (mediaServerMapper.queryOne(mediaServer.getId()) != null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "媒体服务ID [" + mediaServer.getId() + " ] 已存在,请修改媒体服务器配置");
|
||||
}
|
||||
}
|
||||
@ -637,7 +637,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
|
||||
@Override
|
||||
public MediaServer getOneFromDatabase(String mediaServerId) {
|
||||
return mediaServerMapper.queryOne(mediaServerId, userSetting.getServerId());
|
||||
return mediaServerMapper.queryOne(mediaServerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -180,8 +180,8 @@ public class ZLMMediaServerStatusManager {
|
||||
}
|
||||
|
||||
private void online(MediaServer mediaServer, ZLMServerConfig config) {
|
||||
MediaServer mediaServerInDb = mediaServerService.getOneFromDatabase(mediaServer.getId());
|
||||
if (mediaServerInDb == null || mediaServerService.getOne(mediaServer.getId()) == null) {
|
||||
MediaServer mediaServerInDb = mediaServerService.getOne(mediaServer.getId());
|
||||
if (mediaServerInDb == null || !mediaServerInDb.isStatus()) {
|
||||
log.info("[ZLM-连接成功] ID:{}, 地址: {}:{}", mediaServer.getId(), mediaServer.getIp(), mediaServer.getHttpPort());
|
||||
if (config == null) {
|
||||
ZLMResult<List<JSONObject>> mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServer);
|
||||
@ -200,7 +200,7 @@ public class ZLMMediaServerStatusManager {
|
||||
mediaServer.setHookAliveInterval(config.getHookAliveInterval());
|
||||
initPort(mediaServer, config);
|
||||
mediaServerService.update(mediaServer);
|
||||
setZLMConfig(mediaServer, true);
|
||||
setZLMConfig(mediaServer, false);
|
||||
}
|
||||
offlineZlmPrimaryMap.remove(mediaServer.getId());
|
||||
offlineZlmsecondaryMap.remove(mediaServer.getId());
|
||||
@ -233,7 +233,7 @@ public class ZLMMediaServerStatusManager {
|
||||
mediaServerItem.setTranscodeSuffix(zlmServerConfig.getTranscodeSuffix());
|
||||
}
|
||||
mediaServerItem.setRtpProxyPort(zlmServerConfig.getRtpProxyPort());
|
||||
mediaServerItem.setHookAliveInterval(10F);
|
||||
mediaServerItem.setHookAliveInterval(zlmServerConfig.getHookAliveInterval());
|
||||
}
|
||||
|
||||
public void setZLMConfig(MediaServer mediaServerItem, boolean restart) {
|
||||
@ -264,7 +264,6 @@ public class ZLMMediaServerStatusManager {
|
||||
param.put("hook.on_rtp_server_timeout",String.format("%s/on_rtp_server_timeout", hookPrefix));
|
||||
param.put("hook.on_record_mp4",String.format("%s/on_record_mp4", hookPrefix));
|
||||
param.put("hook.timeoutSec","30");
|
||||
param.put("hook.alive_interval", mediaServerItem.getHookAliveInterval());
|
||||
// 推流断开后可以在超时时间内重新连接上继续推流,这样播放器会接着播放。
|
||||
// 置0关闭此特性(推流断开会导致立即断开播放器)
|
||||
// 此参数不应大于播放器超时时间
|
||||
|
||||
@ -134,8 +134,11 @@ public interface MediaServerMapper {
|
||||
" </script>"})
|
||||
int updateByHostAndPort(MediaServer mediaServerItem);
|
||||
|
||||
@Select("SELECT * FROM wvp_media_server WHERE id=#{id}")
|
||||
MediaServer queryOne(@Param("id") String id);
|
||||
|
||||
@Select("SELECT * FROM wvp_media_server WHERE id=#{id} and server_id = #{serverId}")
|
||||
MediaServer queryOne(@Param("id") String id, @Param("serverId") String serverId);
|
||||
MediaServer queryOneWithServerId(@Param("id") String id, @Param("serverId") String serverId);
|
||||
|
||||
@Select("SELECT * FROM wvp_media_server where server_id = #{serverId}")
|
||||
List<MediaServer> queryAll(@Param("serverId") String serverId);
|
||||
|
||||
@ -257,6 +257,13 @@ export default {
|
||||
this.sendRtpPortRange2 = 60000
|
||||
this.serverCheck = 1
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '测试失败,请检查媒体服务地址及端口是否正确!',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
},
|
||||
next: function() {
|
||||
this.currentStep = 2
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
<div id="shared" style="margin-right: 20px;">
|
||||
<el-form ref="passwordForm" :rules="rules" status-icon label-width="80px">
|
||||
<el-form-item label="新密码" prop="newPassword">
|
||||
<el-input v-model="newPassword" autocomplete="off" />
|
||||
<el-input v-model="newPassword" autocomplete="off" type="password" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="confirmPassword">
|
||||
<el-input v-model="confirmPassword" autocomplete="off" />
|
||||
<el-input v-model="confirmPassword" autocomplete="off" type="password" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@ -88,6 +88,14 @@ export default {
|
||||
}
|
||||
},
|
||||
onSubmit: function() {
|
||||
if (this.newPassword !== this.confirmPassword) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '两次输入密码不一致!',
|
||||
type: 'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$store.dispatch('user/changePasswordForAdmin', {
|
||||
password: this.newPassword,
|
||||
userId: this.form.id
|
||||
|
||||
@ -10,9 +10,12 @@
|
||||
<div v-if="item.type === 'abl'" class="card-img-abl" />
|
||||
<div style="padding: 14px;text-align: left">
|
||||
<span style="font-size: 16px">{{ item.id }}</span>
|
||||
<el-button v-if="!item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">编辑</el-button>
|
||||
<el-button v-if="item.defaultServer" icon="el-icon-edit" style="padding: 0;float: right;" type="text" @click="edit(item)">查看</el-button>
|
||||
<el-button v-if="!item.defaultServer" icon="el-icon-delete" style="margin-right: 10px;padding: 0;float: right;" type="text" @click="del(item)">移除</el-button>
|
||||
<div style="float: right">
|
||||
<el-button v-if="!item.defaultServer" icon="el-icon-delete" circle size="mini" @click="del(item)"></el-button>
|
||||
<el-button v-if="!item.defaultServer" icon="el-icon-edit" circle size="mini" @click="edit(item)"></el-button>
|
||||
<el-button v-if="item.defaultServer" icon="el-icon-edit" circle size="mini" @click="edit(item)"></el-button>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 13px; line-height: 12px; ">
|
||||
<span style="font-size: 14px; color: #999; margin-top: 5px; ">{{ item.ip }}</span>
|
||||
<span style="font-size: 14px; color: #999; margin-top: 5px; float: right;">{{ item.createTime }}</span>
|
||||
@ -87,6 +90,7 @@ export default {
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
this.getServerList()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
@ -94,7 +98,7 @@ export default {
|
||||
getNumberByWidth() {
|
||||
const candidateNums = [1, 2, 3, 4, 6, 8, 12, 24]
|
||||
const clientWidth = window.innerWidth - 30
|
||||
const interval = 20
|
||||
const interval = 40
|
||||
const itemWidth = 360
|
||||
const num = (clientWidth + interval) / (itemWidth + interval)
|
||||
const result = Math.ceil(24 / num)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user