修复ssrc释放失败的问题
parent
e864becace
commit
2d82d1b8ee
|
@ -15,6 +15,7 @@ import org.springframework.stereotype.Component;
|
||||||
public class VideoStreamSessionManager {
|
public class VideoStreamSessionManager {
|
||||||
|
|
||||||
private ConcurrentHashMap<String, ClientTransaction> sessionMap = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<String, ClientTransaction> sessionMap = new ConcurrentHashMap<>();
|
||||||
|
private ConcurrentHashMap<String, String> ssrcMap = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public String createPlaySsrc(){
|
public String createPlaySsrc(){
|
||||||
return SsrcUtil.getPlaySsrc();
|
return SsrcUtil.getPlaySsrc();
|
||||||
|
@ -24,16 +25,18 @@ public class VideoStreamSessionManager {
|
||||||
return SsrcUtil.getPlayBackSsrc();
|
return SsrcUtil.getPlayBackSsrc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String ssrc,ClientTransaction transaction){
|
public void put(String streamId,String ssrc,ClientTransaction transaction){
|
||||||
sessionMap.put(ssrc, transaction);
|
sessionMap.put(streamId, transaction);
|
||||||
|
ssrcMap.put(streamId, ssrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientTransaction get(String ssrc){
|
public ClientTransaction get(String streamId){
|
||||||
return sessionMap.get(ssrc);
|
return sessionMap.get(streamId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(String ssrc) {
|
public void remove(String streamId) {
|
||||||
sessionMap.remove(ssrc);
|
sessionMap.remove(streamId);
|
||||||
SsrcUtil.releaseSsrc(ssrc);
|
SsrcUtil.releaseSsrc(ssrcMap.get(streamId));
|
||||||
|
ssrcMap.remove(streamId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,7 +388,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "FromInvt" + tm, null, ssrc);
|
Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "FromInvt" + tm, null, ssrc);
|
||||||
|
|
||||||
ClientTransaction transaction = transmitRequest(device, request, errorEvent);
|
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);
|
Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "fromplybck" + tm, null);
|
||||||
|
|
||||||
ClientTransaction transaction = transmitRequest(device, request, errorEvent);
|
ClientTransaction transaction = transmitRequest(device, request, errorEvent);
|
||||||
streamSession.put(streamId, transaction);
|
streamSession.put(streamId, ssrc, transaction);
|
||||||
|
|
||||||
} catch ( SipException | ParseException | InvalidArgumentException e) {
|
} catch ( SipException | ParseException | InvalidArgumentException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -7,7 +7,7 @@ module.exports = {
|
||||||
// to edit target browsers: use "browserslist" field in package.json
|
// to edit target browsers: use "browserslist" field in package.json
|
||||||
"autoprefixer": {},
|
"autoprefixer": {},
|
||||||
'postcss-pxtorem': {
|
'postcss-pxtorem': {
|
||||||
rootValue: 24,
|
rootValue: 16,
|
||||||
propList: ['font-size'] // 只转化font-size
|
propList: ['font-size'] // 只转化font-size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue