修复通道位置的展示
parent
bf6e09d231
commit
313243195e
|
@ -186,6 +186,18 @@ public class DeviceChannel {
|
||||||
@Schema(description = "纬度")
|
@Schema(description = "纬度")
|
||||||
private double latitude;
|
private double latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@Schema(description = "自定义经度")
|
||||||
|
private double customLongitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@Schema(description = "自定义纬度")
|
||||||
|
private double customLatitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 经度 GCJ02
|
* 经度 GCJ02
|
||||||
*/
|
*/
|
||||||
|
@ -586,4 +598,20 @@ public class DeviceChannel {
|
||||||
public void setStreamIdentification(String streamIdentification) {
|
public void setStreamIdentification(String streamIdentification) {
|
||||||
this.streamIdentification = streamIdentification;
|
this.streamIdentification = streamIdentification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double getCustomLongitude() {
|
||||||
|
return customLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomLongitude(double customLongitude) {
|
||||||
|
this.customLongitude = customLongitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getCustomLatitude() {
|
||||||
|
return customLatitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomLatitude(double customLatitude) {
|
||||||
|
this.customLatitude = customLatitude;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,6 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
if (parentPlatform != null) {
|
if (parentPlatform != null) {
|
||||||
Map<String, Object> param = getSendRtpParam(sendRtpItem);
|
Map<String, Object> param = getSendRtpParam(sendRtpItem);
|
||||||
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
||||||
// redisCatchStorage.sendStartSendRtp(sendRtpItem);
|
|
||||||
WVPResult wvpResult = redisRpcService.startSendRtp(sendRtpItem);
|
WVPResult wvpResult = redisRpcService.startSendRtp(sendRtpItem);
|
||||||
if (wvpResult.getCode() == 0) {
|
if (wvpResult.getCode() == 0) {
|
||||||
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
|
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
|
||||||
|
|
|
@ -138,10 +138,10 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
|
||||||
redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform);
|
redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform);
|
||||||
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
if (!userSetting.getServerId().equals(sendRtpItem.getServerId())) {
|
||||||
redisRpcService.stopSendRtp(sendRtpItem);
|
redisRpcService.stopSendRtp(sendRtpItem);
|
||||||
|
redisCatchStorage.deleteSendRTPServer(null, null, sendRtpItem.getCallId(), null);
|
||||||
}else {
|
}else {
|
||||||
MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
||||||
redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(),
|
redisCatchStorage.deleteSendRTPServer(null, null, callIdHeader.getCallId(), null);
|
||||||
callIdHeader.getCallId(), null);
|
|
||||||
zlmServerFactory.stopSendRtpStream(mediaInfo, param);
|
zlmServerFactory.stopSendRtpStream(mediaInfo, param);
|
||||||
if (userSetting.getUseCustomSsrcForParentInvite()) {
|
if (userSetting.getUseCustomSsrcForParentInvite()) {
|
||||||
mediaServerService.releaseSsrc(mediaInfo.getId(), sendRtpItem.getSsrc());
|
mediaServerService.releaseSsrc(mediaInfo.getId(), sendRtpItem.getSsrc());
|
||||||
|
|
|
@ -775,7 +775,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
redisRpcService.waitePushStreamOnline(sendRtpItem, (sendRtpItemFromRedis) -> {
|
redisRpcService.waitePushStreamOnline(sendRtpItem, (sendRtpItemFromRedis) -> {
|
||||||
dynamicTask.stop(sendRtpItem.getCallId());
|
dynamicTask.stop(sendRtpItem.getCallId());
|
||||||
if (sendRtpItemFromRedis.getServerId().equals(userSetting.getServerId())) {
|
if (sendRtpItemFromRedis.getServerId().equals(userSetting.getServerId())) {
|
||||||
|
logger.info("[级联点播] 等待的推流在本平台上线 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
int localPort = sendRtpPortManager.getNextPort(mediaServerItem);
|
int localPort = sendRtpPortManager.getNextPort(mediaServerItem);
|
||||||
if (localPort == 0) {
|
if (localPort == 0) {
|
||||||
logger.warn("上级点时创建sendRTPItem失败,可能是服务器端口资源不足");
|
logger.warn("上级点时创建sendRTPItem失败,可能是服务器端口资源不足");
|
||||||
|
@ -827,7 +827,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
* 来自其他wvp的推流
|
* 来自其他wvp的推流
|
||||||
*/
|
*/
|
||||||
private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, ParentPlatform platform) {
|
private void otherWvpPushStream(SendRtpItem sendRtpItem, SIPRequest request, ParentPlatform platform) {
|
||||||
logger.info("[级联点播]直播流来自其他平台,发送redis消息");
|
logger.info("[级联点播] 来自其他wvp的推流 {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem);
|
sendRtpItem = redisRpcService.getSendRtpItem(sendRtpItem);
|
||||||
// 写入redis, 超时时回复
|
// 写入redis, 超时时回复
|
||||||
sendRtpItem.setStatus(1);
|
sendRtpItem.setStatus(1);
|
||||||
|
|
|
@ -180,6 +180,13 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
logger.warn("[mobilePosition移动位置Notify] 未找到通道{}所属的设备", channelId);
|
logger.warn("[mobilePosition移动位置Notify] 未找到通道{}所属的设备", channelId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 兼容设备部分设备上报是通道编号与设备编号一致的情况
|
||||||
|
if(deviceId.equals(channelId)) {
|
||||||
|
List<DeviceChannel> deviceChannels = deviceChannelService.queryChaneListByDeviceId(deviceId);
|
||||||
|
if (deviceChannels.size() == 1) {
|
||||||
|
channelId = deviceChannels.get(0).getChannelId();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!ObjectUtils.isEmpty(device.getName())) {
|
if (!ObjectUtils.isEmpty(device.getName())) {
|
||||||
mobilePosition.setDeviceName(device.getName());
|
mobilePosition.setDeviceName(device.getName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse getSendRtpItem(RedisRpcRequest request) {
|
public RedisRpcResponse getSendRtpItem(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
logger.info("[redis-rpc] 获取发流的信息: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 获取发流的信息: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort());
|
||||||
// 查询本级是否有这个流
|
// 查询本级是否有这个流
|
||||||
MediaServerItem mediaServerItem = mediaServerService.getMediaServerByAppAndStream(sendRtpItem.getApp(), sendRtpItem.getStream());
|
MediaServerItem mediaServerItem = mediaServerService.getMediaServerByAppAndStream(sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
if (mediaServerItem == null) {
|
if (mediaServerItem == null) {
|
||||||
|
@ -114,11 +114,11 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse waitePushStreamOnline(RedisRpcRequest request) {
|
public RedisRpcResponse waitePushStreamOnline(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
logger.info("[redis-rpc] 监听流上线: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 监听流上线: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort());
|
||||||
// 查询本级是否有这个流
|
// 查询本级是否有这个流
|
||||||
MediaServerItem mediaServerItem = mediaServerService.getMediaServerByAppAndStream(sendRtpItem.getApp(), sendRtpItem.getStream());
|
MediaServerItem mediaServerItem = mediaServerService.getMediaServerByAppAndStream(sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
if (mediaServerItem != null) {
|
if (mediaServerItem != null) {
|
||||||
logger.info("[redis-rpc] 监听流上线时发现流已存在直接返回: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 监听流上线时发现流已存在直接返回: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setBody(sendRtpItem);
|
response.setBody(sendRtpItem);
|
||||||
response.setStatusCode(200);
|
response.setStatusCode(200);
|
||||||
|
@ -128,7 +128,7 @@ public class RedisRpcController {
|
||||||
sendRtpItem.getApp(), sendRtpItem.getStream(), true, "rtsp", null);
|
sendRtpItem.getApp(), sendRtpItem.getStream(), true, "rtsp", null);
|
||||||
|
|
||||||
hookSubscribe.addSubscribe(hook, (MediaServerItem mediaServerItemInUse, HookParam hookParam) -> {
|
hookSubscribe.addSubscribe(hook, (MediaServerItem mediaServerItemInUse, HookParam hookParam) -> {
|
||||||
logger.info("[redis-rpc] 监听流上线,流已上线: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 监听流上线,流已上线: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort());
|
||||||
// 读取redis中的上级点播信息,生成sendRtpItm发送出去
|
// 读取redis中的上级点播信息,生成sendRtpItm发送出去
|
||||||
if (sendRtpItem.getSsrc() == null) {
|
if (sendRtpItem.getSsrc() == null) {
|
||||||
// 上级平台点播时不使用上级平台指定的ssrc,使用自定义的ssrc,参考国标文档-点播外域设备媒体流SSRC处理方式
|
// 上级平台点播时不使用上级平台指定的ssrc,使用自定义的ssrc,参考国标文档-点播外域设备媒体流SSRC处理方式
|
||||||
|
@ -138,6 +138,7 @@ public class RedisRpcController {
|
||||||
sendRtpItem.setMediaServerId(mediaServerItemInUse.getId());
|
sendRtpItem.setMediaServerId(mediaServerItemInUse.getId());
|
||||||
sendRtpItem.setLocalIp(mediaServerItemInUse.getSdpIp());
|
sendRtpItem.setLocalIp(mediaServerItemInUse.getSdpIp());
|
||||||
sendRtpItem.setServerId(userSetting.getServerId());
|
sendRtpItem.setServerId(userSetting.getServerId());
|
||||||
|
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setBody(sendRtpItem);
|
response.setBody(sendRtpItem);
|
||||||
response.setStatusCode(200);
|
response.setStatusCode(200);
|
||||||
|
@ -153,7 +154,7 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse stopWaitePushStreamOnline(RedisRpcRequest request) {
|
public RedisRpcResponse stopWaitePushStreamOnline(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
logger.info("[redis-rpc] 停止监听流上线: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 停止监听流上线: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
|
|
||||||
// 监听流上线。 流上线直接发送sendRtpItem消息给实际的信令处理者
|
// 监听流上线。 流上线直接发送sendRtpItem消息给实际的信令处理者
|
||||||
HookSubscribeForStreamChange hook = HookSubscribeFactory.on_stream_changed(
|
HookSubscribeForStreamChange hook = HookSubscribeFactory.on_stream_changed(
|
||||||
|
@ -168,6 +169,7 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse startSendRtp(RedisRpcRequest request) {
|
public RedisRpcResponse startSendRtp(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
|
logger.info("[redis-rpc] 开始发流: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort());
|
||||||
MediaServerItem mediaServerItem = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
MediaServerItem mediaServerItem = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
||||||
if (mediaServerItem == null) {
|
if (mediaServerItem == null) {
|
||||||
logger.info("[redis-rpc] startSendRtp->未找到MediaServer: {}", sendRtpItem.getMediaServerId() );
|
logger.info("[redis-rpc] startSendRtp->未找到MediaServer: {}", sendRtpItem.getMediaServerId() );
|
||||||
|
@ -185,9 +187,11 @@ public class RedisRpcController {
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setStatusCode(200);
|
response.setStatusCode(200);
|
||||||
if (jsonObject.getInteger("code") == 0) {
|
if (jsonObject.getInteger("code") == 0) {
|
||||||
|
logger.info("[redis-rpc] 发流成功: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort());
|
||||||
WVPResult wvpResult = WVPResult.success();
|
WVPResult wvpResult = WVPResult.success();
|
||||||
response.setBody(wvpResult);
|
response.setBody(wvpResult);
|
||||||
}else {
|
}else {
|
||||||
|
logger.info("[redis-rpc] 发流失败: {}/{}, 目标地址: {}:{}, {}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort(), jsonObject);
|
||||||
WVPResult wvpResult = WVPResult.fail(jsonObject.getInteger("code"), jsonObject.getString("msg"));
|
WVPResult wvpResult = WVPResult.fail(jsonObject.getInteger("code"), jsonObject.getString("msg"));
|
||||||
response.setBody(wvpResult);
|
response.setBody(wvpResult);
|
||||||
}
|
}
|
||||||
|
@ -199,7 +203,7 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse stopSendRtp(RedisRpcRequest request) {
|
public RedisRpcResponse stopSendRtp(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
logger.info("[redis-rpc] 停止推流: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 停止推流: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
MediaServerItem mediaServerItem = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
MediaServerItem mediaServerItem = mediaServerService.getOne(sendRtpItem.getMediaServerId());
|
||||||
if (mediaServerItem == null) {
|
if (mediaServerItem == null) {
|
||||||
logger.info("[redis-rpc] stopSendRtp->未找到MediaServer: {}", sendRtpItem.getMediaServerId() );
|
logger.info("[redis-rpc] stopSendRtp->未找到MediaServer: {}", sendRtpItem.getMediaServerId() );
|
||||||
|
@ -210,13 +214,13 @@ public class RedisRpcController {
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setStatusCode(200);
|
response.setStatusCode(200);
|
||||||
if (jsonObject.getInteger("code") == 0) {
|
if (jsonObject.getInteger("code") == 0) {
|
||||||
logger.info("[redis-rpc] 停止推流成功: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 停止推流成功: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
WVPResult wvpResult = WVPResult.success();
|
WVPResult wvpResult = WVPResult.success();
|
||||||
response.setBody(wvpResult);
|
response.setBody(wvpResult);
|
||||||
}else {
|
}else {
|
||||||
int code = jsonObject.getInteger("code");
|
int code = jsonObject.getInteger("code");
|
||||||
String msg = jsonObject.getString("msg");
|
String msg = jsonObject.getString("msg");
|
||||||
logger.info("[redis-rpc] 停止推流失败: {}/{}, code: {}, msg: {}", sendRtpItem.getApp(), sendRtpItem.getStream(),code, msg );
|
logger.info("[redis-rpc] 停止推流失败: {}/{}, 目标地址: {}:{}, code: {}, msg: {}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort(), code, msg );
|
||||||
WVPResult wvpResult = WVPResult.fail(code, msg);
|
WVPResult wvpResult = WVPResult.fail(code, msg);
|
||||||
response.setBody(wvpResult);
|
response.setBody(wvpResult);
|
||||||
}
|
}
|
||||||
|
@ -228,7 +232,7 @@ public class RedisRpcController {
|
||||||
*/
|
*/
|
||||||
public RedisRpcResponse rtpSendStopped(RedisRpcRequest request) {
|
public RedisRpcResponse rtpSendStopped(RedisRpcRequest request) {
|
||||||
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItem = JSON.parseObject(request.getParam().toString(), SendRtpItem.class);
|
||||||
logger.info("[redis-rpc] 推流已经停止: {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream() );
|
logger.info("[redis-rpc] 推流已经停止: {}/{}, 目标地址: {}:{}", sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getIp(), sendRtpItem.getPort() );
|
||||||
SendRtpItem sendRtpItemInCatch = redisCatchStorage.querySendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getStream(), sendRtpItem.getCallId());
|
SendRtpItem sendRtpItemInCatch = redisCatchStorage.querySendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getStream(), sendRtpItem.getCallId());
|
||||||
RedisRpcResponse response = request.getResponse();
|
RedisRpcResponse response = request.getResponse();
|
||||||
response.setStatusCode(200);
|
response.setStatusCode(200);
|
||||||
|
|
|
@ -15,12 +15,15 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.HookParam;
|
import com.genersoft.iot.vmp.media.zlm.dto.hook.HookParam;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class RedisRpcServiceImpl implements IRedisRpcService {
|
public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(RedisRpcServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisRpcConfig redisRpcConfig;
|
private RedisRpcConfig redisRpcConfig;
|
||||||
|
@ -52,6 +55,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WVPResult startSendRtp(SendRtpItem sendRtpItem) {
|
public WVPResult startSendRtp(SendRtpItem sendRtpItem) {
|
||||||
|
logger.info("[请求其他WVP] 开始推流,wvp:{}, {}/{}", sendRtpItem.getServerId(), sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
RedisRpcRequest request = buildRequest("startSendRtp", sendRtpItem);
|
RedisRpcRequest request = buildRequest("startSendRtp", sendRtpItem);
|
||||||
request.setToId(sendRtpItem.getServerId());
|
request.setToId(sendRtpItem.getServerId());
|
||||||
RedisRpcResponse response = redisRpcConfig.request(request, 10);
|
RedisRpcResponse response = redisRpcConfig.request(request, 10);
|
||||||
|
@ -68,6 +72,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void waitePushStreamOnline(SendRtpItem sendRtpItem, CommonCallback<SendRtpItem> callback) {
|
public void waitePushStreamOnline(SendRtpItem sendRtpItem, CommonCallback<SendRtpItem> callback) {
|
||||||
|
logger.info("[请求所有WVP监听流上线] {}/{}", sendRtpItem.getApp(), sendRtpItem.getStream());
|
||||||
// 监听流上线。 流上线直接发送sendRtpItem消息给实际的信令处理者
|
// 监听流上线。 流上线直接发送sendRtpItem消息给实际的信令处理者
|
||||||
HookSubscribeForStreamChange hook = HookSubscribeFactory.on_stream_changed(
|
HookSubscribeForStreamChange hook = HookSubscribeFactory.on_stream_changed(
|
||||||
sendRtpItem.getApp(), sendRtpItem.getStream(), true, "rtsp", null);
|
sendRtpItem.getApp(), sendRtpItem.getStream(), true, "rtsp", null);
|
||||||
|
@ -91,6 +96,7 @@ public class RedisRpcServiceImpl implements IRedisRpcService {
|
||||||
request.setToId(sendRtpItem.getServerId());
|
request.setToId(sendRtpItem.getServerId());
|
||||||
redisRpcConfig.request(request, response -> {
|
redisRpcConfig.request(request, response -> {
|
||||||
SendRtpItem sendRtpItemFromOther = JSON.parseObject(response.getBody().toString(), SendRtpItem.class);
|
SendRtpItem sendRtpItemFromOther = JSON.parseObject(response.getBody().toString(), SendRtpItem.class);
|
||||||
|
logger.info("[请求所有WVP监听流上线] 流上线 {}/{}->{}", sendRtpItemFromOther.getApp(), sendRtpItemFromOther.getStream(), sendRtpItemFromOther);
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
callback.run(sendRtpItemFromOther);
|
callback.run(sendRtpItemFromOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,8 @@ public interface DeviceChannelMapper {
|
||||||
"<if test='status != null'>, status=#{status}</if>" +
|
"<if test='status != null'>, status=#{status}</if>" +
|
||||||
"<if test='streamId != null'>, stream_id=#{streamId}</if>" +
|
"<if test='streamId != null'>, stream_id=#{streamId}</if>" +
|
||||||
"<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" +
|
"<if test='hasAudio != null'>, has_audio=#{hasAudio}</if>" +
|
||||||
", custom_longitude=#{longitude}" +
|
"<if test='customLongitude != null'>, custom_longitude=#{customLongitude}</if>" +
|
||||||
", custom_latitude=#{latitude}" +
|
"<if test='customLatitude != null'>, custom_latitude=#{customLatitude}</if>" +
|
||||||
"<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" +
|
"<if test='longitudeGcj02 != null'>, longitude_gcj02=#{longitudeGcj02}</if>" +
|
||||||
"<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" +
|
"<if test='latitudeGcj02 != null'>, latitude_gcj02=#{latitudeGcj02}</if>" +
|
||||||
"<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" +
|
"<if test='longitudeWgs84 != null'>, longitude_wgs84=#{longitudeWgs84}</if>" +
|
||||||
|
@ -89,8 +89,10 @@ public interface DeviceChannelMapper {
|
||||||
"dc.password, " +
|
"dc.password, " +
|
||||||
"COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, " +
|
"COALESCE(dc.custom_ptz_type, dc.ptz_type) AS ptz_type, " +
|
||||||
"dc.status, " +
|
"dc.status, " +
|
||||||
"COALESCE(dc.custom_longitude, dc.longitude) AS longitude, " +
|
"dc.longitude, " +
|
||||||
"COALESCE(dc.custom_latitude, dc.latitude) AS latitude, " +
|
"dc.latitude, " +
|
||||||
|
"dc.custom_longitude, " +
|
||||||
|
"dc.custom_latitude, " +
|
||||||
"dc.stream_id, " +
|
"dc.stream_id, " +
|
||||||
"dc.device_id, " +
|
"dc.device_id, " +
|
||||||
"dc.parental, " +
|
"dc.parental, " +
|
||||||
|
@ -345,6 +347,8 @@ public interface DeviceChannelMapper {
|
||||||
"<if test='item.hasAudio != null'>, has_audio=#{item.hasAudio}</if>" +
|
"<if test='item.hasAudio != null'>, has_audio=#{item.hasAudio}</if>" +
|
||||||
"<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" +
|
"<if test='item.longitude != null'>, longitude=#{item.longitude}</if>" +
|
||||||
"<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
|
"<if test='item.latitude != null'>, latitude=#{item.latitude}</if>" +
|
||||||
|
"<if test='customLongitude != null'>, custom_longitude=#{item.customLongitude}</if>" +
|
||||||
|
"<if test='custom_latitude != null'>, custom_latitude=#{item.customLatitude}</if>" +
|
||||||
"<if test='item.longitudeGcj02 != null'>, longitude_gcj02=#{item.longitudeGcj02}</if>" +
|
"<if test='item.longitudeGcj02 != null'>, longitude_gcj02=#{item.longitudeGcj02}</if>" +
|
||||||
"<if test='item.latitudeGcj02 != null'>, latitude_gcj02=#{item.latitudeGcj02}</if>" +
|
"<if test='item.latitudeGcj02 != null'>, latitude_gcj02=#{item.latitudeGcj02}</if>" +
|
||||||
"<if test='item.longitudeWgs84 != null'>, longitude_wgs84=#{item.longitudeWgs84}</if>" +
|
"<if test='item.longitudeWgs84 != null'>, longitude_wgs84=#{item.longitudeWgs84}</if>" +
|
||||||
|
|
|
@ -2,4 +2,4 @@ spring:
|
||||||
application:
|
application:
|
||||||
name: wvp
|
name: wvp
|
||||||
profiles:
|
profiles:
|
||||||
active: local2
|
active: local
|
|
@ -315,7 +315,9 @@ export default {
|
||||||
e.ptzType = e.ptzType + "";
|
e.ptzType = e.ptzType + "";
|
||||||
that.$set(e, "edit", false);
|
that.$set(e, "edit", false);
|
||||||
that.$set(e, "location", "");
|
that.$set(e, "location", "");
|
||||||
if (e.longitude && e.latitude) {
|
if (e.customLongitude && e.customLatitude) {
|
||||||
|
that.$set(e, "location", e.customLongitude + "," + e.customLatitude);
|
||||||
|
}else if (e.longitude && e.latitude) {
|
||||||
that.$set(e, "location", e.longitude + "," + e.latitude);
|
that.$set(e, "location", e.longitude + "," + e.latitude);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -463,7 +465,9 @@ export default {
|
||||||
e.ptzType = e.ptzType + "";
|
e.ptzType = e.ptzType + "";
|
||||||
this.$set(e, "edit", false);
|
this.$set(e, "edit", false);
|
||||||
this.$set(e, "location", "");
|
this.$set(e, "location", "");
|
||||||
if (e.longitude && e.latitude) {
|
if (e.customLongitude && e.customLatitude) {
|
||||||
|
this.$set(e, "location", e.customLongitude + "," + e.customLatitude);
|
||||||
|
}else if (e.longitude && e.latitude) {
|
||||||
this.$set(e, "location", e.longitude + "," + e.latitude);
|
this.$set(e, "location", e.longitude + "," + e.latitude);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -585,8 +589,8 @@ export default {
|
||||||
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
row.longitude = parseFloat(segements[0]);
|
row.customLongitude = parseFloat(segements[0]);
|
||||||
row.latitude = parseFloat(segements[1]);
|
row.custom_latitude = parseFloat(segements[1]);
|
||||||
if (!(row.longitude && row.latitude)) {
|
if (!(row.longitude && row.latitude)) {
|
||||||
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
this.$message.warning("位置信息格式有误,例:117.234,36.378");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue