Merge branch 'master' of https://gitee.com/pan648540858/wvp-GB28181-pro
commit
2d0bc7bde0
|
@ -14,9 +14,10 @@ assignees: ''
|
|||
- 3. 端口开放情况
|
||||
- 4. 是否是公网部署
|
||||
- 5. 是否使用https
|
||||
- 6. 方便的话提供下使用的设备品牌或平台
|
||||
- 6. 接入设备/平台品牌
|
||||
- 7. 你做过哪些尝试
|
||||
- 8. 代码更新时间
|
||||
- 9. 是否是4G设备接入
|
||||
|
||||
**描述错误**
|
||||
描述下您遇到的问题
|
||||
|
|
|
@ -39,10 +39,10 @@ public class SipLayer implements CommandLineRunner {
|
|||
|
||||
private final Map<String, SipProviderImpl> tcpSipProviderMap = new ConcurrentHashMap<>();
|
||||
private final Map<String, SipProviderImpl> udpSipProviderMap = new ConcurrentHashMap<>();
|
||||
private final List<String> monitorIps = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
List<String> monitorIps = new ArrayList<>();
|
||||
if (ObjectUtils.isEmpty(sipConfig.getIp())) {
|
||||
try {
|
||||
// 获得本机的所有网络接口
|
||||
|
@ -139,12 +139,12 @@ public class SipLayer implements CommandLineRunner {
|
|||
}
|
||||
|
||||
public SipProviderImpl getUdpSipProvider(String ip) {
|
||||
if (ObjectUtils.isEmpty(ip)) {
|
||||
return null;
|
||||
}
|
||||
if (udpSipProviderMap.size() == 1) {
|
||||
return udpSipProviderMap.values().stream().findFirst().get();
|
||||
}
|
||||
if (ObjectUtils.isEmpty(ip)) {
|
||||
return null;
|
||||
}
|
||||
return udpSipProviderMap.get(ip);
|
||||
}
|
||||
|
||||
|
@ -163,16 +163,19 @@ public class SipLayer implements CommandLineRunner {
|
|||
}
|
||||
|
||||
public SipProviderImpl getTcpSipProvider(String ip) {
|
||||
if (ObjectUtils.isEmpty(ip)) {
|
||||
return null;
|
||||
}
|
||||
if (tcpSipProviderMap.size() == 1) {
|
||||
return tcpSipProviderMap.values().stream().findFirst().get();
|
||||
}
|
||||
if (ObjectUtils.isEmpty(ip)) {
|
||||
return null;
|
||||
}
|
||||
return tcpSipProviderMap.get(ip);
|
||||
}
|
||||
|
||||
public String getLocalIp(String deviceLocalIp) {
|
||||
if (monitorIps.size() == 1) {
|
||||
return monitorIps.get(0);
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(deviceLocalIp)) {
|
||||
return deviceLocalIp;
|
||||
}
|
||||
|
|
|
@ -43,9 +43,9 @@ public interface IStreamPushService {
|
|||
/**
|
||||
* 停止一路推流
|
||||
* @param app 应用名
|
||||
* @param streamId 流ID
|
||||
* @param stream 流ID
|
||||
*/
|
||||
boolean stop(String app, String streamId);
|
||||
boolean stop(String app, String stream);
|
||||
|
||||
/**
|
||||
* 新的节点加入
|
||||
|
|
|
@ -274,19 +274,19 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean stop(String app, String streamId) {
|
||||
logger.info("[推流 ] 停止流: {}/{}", app, streamId);
|
||||
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, streamId);
|
||||
public boolean stop(String app, String stream) {
|
||||
logger.info("[推流 ] 停止流: {}/{}", app, stream);
|
||||
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, stream);
|
||||
if (streamPushItem != null) {
|
||||
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);
|
||||
}
|
||||
|
||||
platformGbStreamMapper.delByAppAndStream(app, streamId);
|
||||
gbStreamMapper.del(app, streamId);
|
||||
int delStream = streamPushMapper.del(app, streamId);
|
||||
platformGbStreamMapper.delByAppAndStream(app, stream);
|
||||
gbStreamMapper.del(app, stream);
|
||||
int delStream = streamPushMapper.del(app, stream);
|
||||
if (delStream > 0) {
|
||||
MediaServer mediaServerItem = mediaServerService.getOne(streamPushItem.getMediaServerId());
|
||||
mediaServerService.closeStreams(mediaServerItem,app, streamId);
|
||||
mediaServerService.closeStreams(mediaServerItem,app, stream);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -113,8 +113,8 @@ public class StreamPushController {
|
|||
@Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public void stop(String app, String streamId){
|
||||
if (!streamPushService.stop(app, streamId)){
|
||||
public void stop(String app, String stream){
|
||||
if (!streamPushService.stop(app, stream)){
|
||||
throw new ControllerException(ErrorCode.ERROR100);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,4 +2,4 @@ spring:
|
|||
application:
|
||||
name: wvp
|
||||
profiles:
|
||||
active: local
|
||||
active: base
|
Loading…
Reference in New Issue