Browse Source

修复ssrc释放失败的问题

pull/148/head
panlinlin 4 years ago
parent
commit
2d82d1b8ee
  1. 17
      src/main/java/com/genersoft/iot/vmp/gb28181/session/VideoStreamSessionManager.java
  2. 4
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  3. 2
      web_src/.postcssrc.js

17
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<String, ClientTransaction> sessionMap = new ConcurrentHashMap<>();
private ConcurrentHashMap<String, String> 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);
}
}

4
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();

2
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
}
}

Loading…
Cancel
Save