Browse Source

启用失败的流转发如果开启无人观看自动移除则不保存在数据库

pull/276/head
648540858 3 years ago
parent
commit
20a3cb9e73
  1. 17
      src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java

17
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java

@ -105,23 +105,22 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
result.append("保存成功");
if (param.isEnable()) {
JSONObject jsonObject = addStreamProxyToZlm(param);
if (jsonObject == null) {
if (jsonObject == null || jsonObject.getInteger("code") != 0) {
streamLive = false;
result.append(", 但是启用失败,请检查流地址是否可用");
param.setEnable(false);
// 直接移除
if (param.isEnable_remove_none_reader()) {
del(param.getApp(), param.getStream());
}else {
videoManagerStorager.updateStreamProxy(param);
}
}else {
Integer code = jsonObject.getInteger("code");
if (code == 0) {
streamLive = true;
StreamInfo streamInfo = mediaService.getStreamInfoByAppAndStream(
mediaInfo, param.getApp(), param.getStream(), null);
wvpResult.setData(streamInfo);
}else {
result.append(", 但是启用失败,请检查流地址是否可用");
param.setEnable(false);
videoManagerStorager.updateStreamProxy(param);
}
}
}
@ -202,8 +201,10 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
platformGbStreamMapper.delByAppAndStream(app, stream);
// TODO 如果关联的推流, 那么状态设置为离线
}
redisCatchStorage.removeStream(streamProxyItem.getMediaServerId(), "PULL", app, stream);
}
}
@Override

Loading…
Cancel
Save