修复拉流代理
parent
bd52096884
commit
f0e9c85c85
|
@ -78,7 +78,7 @@ public class GB28181ResourceServiceImpl implements IResourceService {
|
||||||
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
StreamInfo streamInfo = (StreamInfo)data;
|
StreamInfo streamInfo = (StreamInfo)data;
|
||||||
callback.call(commonGbChannel, mediaServerItem, ErrorCode.ERROR100.getCode(), ErrorCode.SUCCESS.getMsg(), streamInfo);
|
callback.call(commonGbChannel, mediaServerItem, ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), streamInfo);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
callback.call(commonGbChannel, null, code, msg, null);
|
callback.call(commonGbChannel, null, code, msg, null);
|
||||||
|
|
|
@ -272,6 +272,9 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
|
||||||
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
||||||
// 记录到数据库
|
// 记录到数据库
|
||||||
}
|
}
|
||||||
|
if (callback == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
callback.call(commonGbChannel, mediaServerItem, code, message, streamInfo);
|
callback.call(commonGbChannel, mediaServerItem, code, message, streamInfo);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
param.setEnable(false);
|
param.setEnable(false);
|
||||||
// 直接移除
|
// 直接移除
|
||||||
if (param.isEnableRemoveNoneReader()) {
|
if (param.isEnableRemoveNoneReader()) {
|
||||||
delProxyFromDb(param.getApp(), param.getStream());
|
delProxyFromDb(param);
|
||||||
}else {
|
}else {
|
||||||
updateProxyToDb(param);
|
updateProxyToDb(param);
|
||||||
}
|
}
|
||||||
|
@ -483,20 +483,23 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
logger.error("[更新代理存储到数据库] 错误,ID: {} 不在数据库中", param.getId());
|
logger.error("[更新代理存储到数据库] 错误,ID: {} 不在数据库中", param.getId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(streamProxyInDb.getGbId().trim()) && ObjectUtils.isEmpty(param.getGbId().trim())) {
|
if (!ObjectUtils.isEmpty(streamProxyInDb.getGbId())
|
||||||
|
&& ObjectUtils.isEmpty(param.getGbId())) {
|
||||||
// 国标ID已经移除
|
// 国标ID已经移除
|
||||||
if (streamProxyInDb.getCommonGbChannelId() > 0) {
|
if (streamProxyInDb.getCommonGbChannelId() > 0) {
|
||||||
commonGbChannelService.deleteById(streamProxyInDb.getCommonGbChannelId());
|
commonGbChannelService.deleteById(streamProxyInDb.getCommonGbChannelId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ObjectUtils.isEmpty(param.getGbId().trim()) && ObjectUtils.isEmpty(streamProxyInDb.getGbId().trim())) {
|
if (!ObjectUtils.isEmpty(param.getGbId())
|
||||||
|
&& ObjectUtils.isEmpty(streamProxyInDb.getGbId())) {
|
||||||
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
||||||
// 国标ID已经添加
|
// 国标ID已经添加
|
||||||
if (commonGbChannelService.add(commonGbChannel) > 0) {
|
if (commonGbChannelService.add(commonGbChannel) > 0) {
|
||||||
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
param.setCommonGbChannelId(commonGbChannel.getCommonGbId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!param.getGbId().equals(streamProxyInDb.getGbId())) {
|
if (param.getGbId() != null && streamProxyInDb.getGbId() != null
|
||||||
|
&& !param.getGbId().equals(streamProxyInDb.getGbId())) {
|
||||||
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
CommonGbChannel commonGbChannel = CommonGbChannel.getInstance(param);
|
||||||
commonGbChannel.setCommonGbId(streamProxyInDb.getCommonGbChannelId());
|
commonGbChannel.setCommonGbId(streamProxyInDb.getCommonGbChannelId());
|
||||||
// 国标ID已经改变
|
// 国标ID已经改变
|
||||||
|
@ -535,8 +538,13 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
return new PageInfo<>(all);
|
return new PageInfo<>(all);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void delProxyFromDb(String app, String stream) {
|
private void delProxyFromDb(StreamProxy streamProxy) {
|
||||||
StreamProxy streamProxyItem = streamProxyMapper.selectOne(app, stream);
|
StreamProxy streamProxyItem;
|
||||||
|
if (streamProxy.getId() <= 0) {
|
||||||
|
streamProxyItem = streamProxyMapper.selectOne(streamProxy.getApp(), streamProxy.getStream());
|
||||||
|
}else {
|
||||||
|
streamProxyItem = streamProxy;
|
||||||
|
}
|
||||||
if (streamProxyItem == null) {
|
if (streamProxyItem == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -544,7 +552,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
commonGbChannelService.deleteById(streamProxyItem.getCommonGbChannelId());
|
commonGbChannelService.deleteById(streamProxyItem.getCommonGbChannelId());
|
||||||
}
|
}
|
||||||
streamProxyMapper.delById(streamProxyItem.getId());
|
streamProxyMapper.delById(streamProxyItem.getId());
|
||||||
redisCatchStorage.removeStream(streamProxyItem.getMediaServerId(), "PULL", app, stream);
|
redisCatchStorage.removeStream(streamProxyItem.getMediaServerId(), "PULL",
|
||||||
|
streamProxy.getApp(), streamProxy.getStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -568,9 +577,8 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
delProxyFromDb(streamProxy.getApp(), streamProxy.getStream());
|
|
||||||
}
|
}
|
||||||
|
delProxyFromDb(streamProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue