From 72c11e46254742b9d8e26cdb3ddf1bfc2c204340 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Thu, 5 Oct 2023 17:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=20playback=20=E8=AE=A2=E9=98=85=E5=99=A8?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/core/sip/message/subscribe/SipSubscribe.java | 8 -------- .../skcks/docking/gb28181/service/play/PlayService.java | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipSubscribe.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipSubscribe.java index 6c1559e..21f90e6 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipSubscribe.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipSubscribe.java @@ -24,16 +24,11 @@ public class SipSubscribe { @Qualifier(DefaultSipExecutor.EXECUTOR_BEAN_NAME) private final Executor executor; private final ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); - private GenericSubscribe recordInfoSubscribe; - private GenericSubscribe inviteSubscribe; private GenericTimeoutSubscribe sipResponseSubscribe; private GenericTimeoutSubscribe sipRequestSubscribe; @PostConstruct private void init() { - // TODO 准备废弃 - recordInfoSubscribe = new RecordInfoSubscribe(executor); - inviteSubscribe = new InviteSubscribe(executor); // 通用订阅器 sipResponseSubscribe = new SipResponseSubscribe(executor, scheduledExecutorService); sipRequestSubscribe = new SipRequestSubscribe(executor, scheduledExecutorService); @@ -41,9 +36,6 @@ public class SipSubscribe { @PreDestroy private void destroy() { - inviteSubscribe.close(); - recordInfoSubscribe.close(); - sipResponseSubscribe.close(); sipRequestSubscribe.close(); } diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/play/PlayService.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/play/PlayService.java index 1cadb81..a252b1d 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/play/PlayService.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/play/PlayService.java @@ -310,7 +310,7 @@ public class PlayService { @Override public void onComplete() { - subscribe.getRecordInfoSubscribe().delPublisher(subscribeKey); + subscribe.getSipResponseSubscribe().delPublisher(subscribeKey); } }; byeSubscribe(inviteRequestBuilder,provider,callId,DateUtil.between(startTime,endTime,DateUnit.SECOND),()->{ @@ -339,9 +339,9 @@ public class PlayService { @Override @SneakyThrows public void onNext(SIPRequest item) { - subscribe.getRecordInfoSubscribe().delPublisher(GenericSubscribe.Helper.getKey(Request.INVITE, callId)); + sipRequestSubscribe.delPublisher(GenericSubscribe.Helper.getKey(Request.INVITE, callId)); request = item; - subscribe.getRecordInfoSubscribe().complete(subscribeKey); + sipRequestSubscribe.complete(subscribeKey); } @Override @@ -360,7 +360,7 @@ public class PlayService { provider.sendRequest(byeRequest); } cb.run(); - subscribe.getRecordInfoSubscribe().delPublisher(subscribeKey); + sipRequestSubscribe.delPublisher(subscribeKey); } }; sipRequestSubscribe.addSubscribe(subscribeKey,subscriber);