From 456174533d096ba272905f65cc3b982fb07f5319 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 23 Jan 2024 09:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=89=E5=8F=96=E8=A7=86=E9=A2=91=E6=97=B6?= =?UTF-8?q?=20=E8=8B=A51=E7=A7=92=E5=86=85=E6=9C=AA=E5=AE=8C=E6=88=90=20?= =?UTF-8?q?=E5=88=99=20=E6=AF=8F=E9=97=B4=E9=9A=941=E7=A7=92=20=E5=8F=91?= =?UTF-8?q?=E9=80=81=E4=B8=80=E6=AC=A1=20trying=20=E4=BF=9D=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mocking/service/device/DeviceProxyService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 6379064..63ad95b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -162,8 +162,8 @@ public class DeviceProxyService { public TaskProcessor playbackTask(){ return (SIPRequest request,String callId,String fromUrl, String toAddr,int toPort, MockingDevice device, String key, long time,String ssrc) -> { - Flow.Subscriber task = ffmpegTask(request, callbackTask, callId, key, device); ScheduledFuture schedule = trying(request); + Flow.Subscriber task = ffmpegTask(request, callbackTask, callId, key, device); try { String zlmRtpUrl = requestZlmPushStream(schedule, request, callId, fromUrl, toAddr, toPort, device, key, time, ssrc); FfmpegExecuteResultHandler executeResultHandler = mediaStatus(request, device, key); @@ -181,8 +181,8 @@ public class DeviceProxyService { public TaskProcessor downloadTask(){ return (SIPRequest request,String callId,String fromUrl, String toAddr,int toPort, MockingDevice device, String key, long time,String ssrc)->{ - Flow.Subscriber task = ffmpegTask(request, downloadTask, callId, key, device); ScheduledFuture schedule = trying(request); + Flow.Subscriber task = ffmpegTask(request, downloadTask, callId, key, device); try { String zlmRtpUrl = requestZlmPushStream(schedule, request, callId, fromUrl, toAddr, toPort, device, key, time, ssrc); FfmpegExecuteResultHandler executeResultHandler = mediaStatus(request, device, key); @@ -199,13 +199,13 @@ public class DeviceProxyService { } private ScheduledFuture trying(SIPRequest request){ - return scheduledExecutorService.schedule(() -> { + return scheduledExecutorService.scheduleAtFixedRate(() -> { InviteResponseBuilder inviteRequestBuilder = InviteResponseBuilder.builder().build(); Response tryingInviteResponse = inviteRequestBuilder.createTryingInviteResponse(request); String ip = request.getLocalAddress().getHostAddress(); String transPort = request.getTopmostViaHeader().getTransport(); sender.sendResponse(ip, transPort, ((provider, ip1, port) -> tryingInviteResponse)); - }, 200, TimeUnit.MILLISECONDS); + }, 0,1, TimeUnit.SECONDS); } public Flow.Subscriber ffmpegByeSubscriber(SIPRequest inviteRequest,String key, MockingDevice device, ConcurrentHashMap task){