From 2d82d1b8eec67df9195b7ebc4b4318a7cdcc1f7f Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Wed, 3 Mar 2021 10:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dssrc=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../session/VideoStreamSessionManager.java | 17 ++++++++++------- .../gb28181/transmit/cmd/impl/SIPCommander.java | 4 ++-- web_src/.postcssrc.js | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/VideoStreamSessionManager.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/VideoStreamSessionManager.java index c69faf96..65e1e5f6 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/VideoStreamSessionManager.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/VideoStreamSessionManager.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Component; public class VideoStreamSessionManager { private ConcurrentHashMap sessionMap = new ConcurrentHashMap<>(); + private ConcurrentHashMap ssrcMap = new ConcurrentHashMap<>(); public String createPlaySsrc(){ return SsrcUtil.getPlaySsrc(); @@ -24,16 +25,18 @@ public class VideoStreamSessionManager { return SsrcUtil.getPlayBackSsrc(); } - public void put(String ssrc,ClientTransaction transaction){ - sessionMap.put(ssrc, transaction); + public void put(String streamId,String ssrc,ClientTransaction transaction){ + sessionMap.put(streamId, transaction); + ssrcMap.put(streamId, ssrc); } - public ClientTransaction get(String ssrc){ - return sessionMap.get(ssrc); + public ClientTransaction get(String streamId){ + return sessionMap.get(streamId); } - public void remove(String ssrc) { - sessionMap.remove(ssrc); - SsrcUtil.releaseSsrc(ssrc); + public void remove(String streamId) { + sessionMap.remove(streamId); + SsrcUtil.releaseSsrc(ssrcMap.get(streamId)); + ssrcMap.remove(streamId); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index 6bab8090..6561763b 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -388,7 +388,7 @@ public class SIPCommander implements ISIPCommander { Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "FromInvt" + tm, null, ssrc); ClientTransaction transaction = transmitRequest(device, request, errorEvent); - streamSession.put(streamId, transaction); + streamSession.put(streamId,ssrc, transaction); @@ -488,7 +488,7 @@ public class SIPCommander implements ISIPCommander { Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "fromplybck" + tm, null); ClientTransaction transaction = transmitRequest(device, request, errorEvent); - streamSession.put(streamId, transaction); + streamSession.put(streamId, ssrc, transaction); } catch ( SipException | ParseException | InvalidArgumentException e) { e.printStackTrace(); diff --git a/web_src/.postcssrc.js b/web_src/.postcssrc.js index 406b4d24..f8737a12 100644 --- a/web_src/.postcssrc.js +++ b/web_src/.postcssrc.js @@ -7,7 +7,7 @@ module.exports = { // to edit target browsers: use "browserslist" field in package.json "autoprefixer": {}, 'postcss-pxtorem': { - rootValue: 24, + rootValue: 16, propList: ['font-size'] // 只转化font-size } }