From 845d049ad5f002c983f01421dc6bb7249cf69cbd Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Mon, 9 Oct 2023 15:07:36 +0800 Subject: [PATCH] =?UTF-8?q?/video=20=E6=94=AF=E6=8C=81=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20=E5=AE=9E=E6=97=B6=E5=9B=9E=E6=94=BE=20=E4=BB=A3=E6=9B=BF?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/gb28181/Gb28181DownloadService.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java index d10c7fb..81b7bd0 100644 --- a/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java +++ b/gb28181-wvp-proxy-service/src/main/java/cn/skcks/docking/gb28181/wvp/service/gb28181/Gb28181DownloadService.java @@ -51,7 +51,6 @@ import org.springframework.stereotype.Service; import javax.sdp.Connection; import javax.sdp.SdpFactory; import javax.sdp.TimeDescription; -import javax.sip.ListeningPoint; import javax.sip.header.CallIdHeader; import javax.sip.message.Request; import javax.sip.message.Response; @@ -221,18 +220,24 @@ public class Gb28181DownloadService { timeField.setStartTime(start); timeField.setStopTime(end); TimeDescription timeDescription = SdpFactory.getInstance().createTimeDescription(timeField); - GB28181Description gb28181Description = MediaSdpHelper.build(MediaSdpHelper.Action.DOWNLOAD, gbDeviceId, channel, Connection.IP4, ip, port, ssrc, streamMode, timeDescription); - gb28181Description.setSessionName(SdpFactory.getInstance().createSessionName(MediaSdpHelper.Action.DOWNLOAD.getAction())); + MediaSdpHelper.Action action = MediaSdpHelper.Action.DOWNLOAD; + if(proxySipConfig.isUsePlaybackToDownload()){ + action = MediaSdpHelper.Action.PLAY_BACK; + } + GB28181Description gb28181Description = MediaSdpHelper.build(action, gbDeviceId, channel, Connection.IP4, ip, port, ssrc, streamMode, timeDescription); + gb28181Description.setSessionName(SdpFactory.getInstance().createSessionName(action.getAction())); gb28181Description.setTimeDescriptions(new Vector<>(){{add(timeDescription);}}); MediaDescriptionImpl media = (MediaDescriptionImpl) gb28181Description.getMediaDescriptions(true).get(0); if(proxySipConfig.getStreamMode() != StreamMode.UDP){ media.getMedia().setProtocol("RTP/AVP/TCP"); } - media.setAttribute("downloadspeed", String.valueOf(4)); + if(!proxySipConfig.isUsePlaybackToDownload()){ + media.setAttribute("downloadspeed", String.valueOf(4)); + } URIField uriField = new URIField(); uriField.setURI(StringUtils.joinWith(":", channel, "0")); gb28181Description.setURI(uriField); - sender.sendRequest(inviteRequest(docking, device, gb28181Description, MediaSdpHelper.Action.DOWNLOAD, ssrc, streamId, result, time)); + sender.sendRequest(inviteRequest(docking, device, gb28181Description, action, ssrc, streamId, result, time)); return result; }