From 7b7512f84dc2e189308ff75fa4e2d1cfcc382fb6 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 8 Jul 2024 15:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/service/IGbChannelService.java | 4 ---- .../service/impl/GbChannelServiceImpl.java | 19 --------------- .../iot/vmp/service/impl/PlayServiceImpl.java | 23 ++++++++++++------- .../service/impl/StreamPushServiceImpl.java | 10 ++++---- 4 files changed, 20 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java index 57bbc127..c599ccba 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/IGbChannelService.java @@ -22,10 +22,6 @@ public interface IGbChannelService { int online(List commonGBChannelList); - void closeSend(CommonGBChannel commonGBChannel); - - void closeSend(List commonGBChannelList); - void batchAdd(List commonGBChannels); void updateStatus(List channelList); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java index 58e9e338..ec7a7f94 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelServiceImpl.java @@ -44,8 +44,6 @@ public class GbChannelServiceImpl implements IGbChannelService { }catch (Exception e) { log.warn("[通道移除通知] 发送失败,{}", channel.getGbDeviceId(), e); } - // 结束发送 - closeSend(channel); } return 1; } @@ -119,8 +117,6 @@ public class GbChannelServiceImpl implements IGbChannelService { log.warn("[多个通道离线] 发送失败,数量:{}", onlineChannelList.size(), e); } } - // 结束国标级联的发送 - closeSend(onlineChannelList); return result; } @@ -180,21 +176,6 @@ public class GbChannelServiceImpl implements IGbChannelService { return result; } - @Override - public void closeSend(CommonGBChannel commonGBChannel) { - - } - - @Override - @Transactional - public void closeSend(List commonGBChannelList) { - if (!commonGBChannelList.isEmpty()) { - for (CommonGBChannel commonGBChannel : commonGBChannelList) { - closeSend(commonGBChannel); - } - } - } - @Override public void batchAdd(List commonGBChannels) { diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 130293da..a2a3d8d4 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -16,18 +16,24 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.utils.SipUtils; import com.genersoft.iot.vmp.media.bean.MediaInfo; +import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.bean.RecordInfo; import com.genersoft.iot.vmp.media.event.hook.Hook; +import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; import com.genersoft.iot.vmp.media.event.hook.HookType; import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent; import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent; import com.genersoft.iot.vmp.media.event.media.MediaNotFoundEvent; import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager; -import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; -import com.genersoft.iot.vmp.media.bean.MediaServer; -import com.genersoft.iot.vmp.service.*; -import com.genersoft.iot.vmp.service.bean.*; +import com.genersoft.iot.vmp.service.IDeviceChannelService; +import com.genersoft.iot.vmp.service.IDeviceService; +import com.genersoft.iot.vmp.service.IInviteStreamService; +import com.genersoft.iot.vmp.service.IPlayService; +import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; +import com.genersoft.iot.vmp.service.bean.ErrorCallback; +import com.genersoft.iot.vmp.service.bean.InviteErrorCode; +import com.genersoft.iot.vmp.service.bean.SSRCInfo; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.utils.CloudRecordUtils; @@ -38,8 +44,6 @@ import com.genersoft.iot.vmp.vmanager.bean.StreamContent; import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioBroadcastEvent; import gov.nist.javax.sip.message.SIPResponse; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; @@ -55,7 +59,10 @@ import java.io.File; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.ParseException; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import java.util.Vector; @SuppressWarnings(value = {"rawtypes", "unchecked"}) @Slf4j @@ -591,7 +598,7 @@ public class PlayServiceImpl implements IPlayService { callback.run(InviteErrorCode.ERROR_FOR_SIP_SENDING_FAILED.getCode(), InviteErrorCode.ERROR_FOR_SIP_SENDING_FAILED.getMsg(), null); } - inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channel.getChannelId(), null, + inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channel.getDeviceId(), null, InviteErrorCode.ERROR_FOR_SIP_SENDING_FAILED.getCode(), InviteErrorCode.ERROR_FOR_SIP_SENDING_FAILED.getMsg(), null); diff --git a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushServiceImpl.java index 351e3ad3..5b60c5ba 100755 --- a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushServiceImpl.java @@ -150,7 +150,7 @@ public class StreamPushServiceImpl implements IStreamPushService { push.setPushIng(false); if (push.getGbDeviceId() != null) { if (userSetting.isUsePushingAsStatus()) { - push.setGbStatus(false); + push.setGbStatus(0); updateStatus(push); // streamPushMapper.updatePushStatus(event.getApp(), event.getStream(), false); // eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF); @@ -279,10 +279,10 @@ public class StreamPushServiceImpl implements IStreamPushService { } streamPush.setPushIng(false); if (userSetting.isUsePushingAsStatus()) { - streamPush.setGbStatus(false); gbChannelService.offline(streamPush.getCommonGBChannel()); } - gbChannelService.closeSend(streamPush.getCommonGBChannel()); + redisCatchStorage.deleteSendRTPServer(null, streamPush.getGbDeviceId(), null, streamPush.getStream()); + mediaServerService.stopSendRtp(mediaServer, streamPush.getApp(), streamPush.getStream(), null); streamPush.setUpdateTime(DateUtil.getNow()); streamPushMapper.update(streamPush); return true; @@ -508,7 +508,7 @@ public class StreamPushServiceImpl implements IStreamPushService { if (push.getGbDeviceId() != null) { return; } - if (push.getGbStatus()) { + if (push.getGbStatus() == 1) { gbChannelService.online(push.getCommonGBChannel()); }else { gbChannelService.offline(push.getCommonGBChannel()); @@ -522,7 +522,7 @@ public class StreamPushServiceImpl implements IStreamPushService { StreamPush streamPushInDb = streamPushMapper.select(streamPushId); streamPushInDb.setPushIng(pushIng); if (userSetting.isUsePushingAsStatus()) { - streamPushInDb.setGbStatus(pushIng); + streamPushInDb.setGbStatus(pushIng?1:0); } streamPushInDb.setPushTime(DateUtil.getNow()); updateStatus(streamPushInDb);