Commit a5d9afeb60af041c6610e5ddab6127b81e4d5084
Committed by
GitHub
Merge pull request #753 from lovemen/wvp-28181-2.0
解决上级平台点播proxy代理流时未携带SSRC信息,gbStream采用默认0000000000作为SSRC无法播放问题。以及上级平台点…
Showing
1 changed file
with
17 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| ... | ... | @@ -5,6 +5,7 @@ import com.genersoft.iot.vmp.conf.DynamicTask; |
| 5 | 5 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 6 | 6 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 7 | 7 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 8 | +import com.genersoft.iot.vmp.gb28181.session.SsrcConfig; | |
| 8 | 9 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 9 | 10 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 10 | 11 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| ... | ... | @@ -492,6 +493,15 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 492 | 493 | } |
| 493 | 494 | } |
| 494 | 495 | } else if (gbStream != null) { |
| 496 | + if(ssrc.equals(ssrcDefault)) | |
| 497 | + { | |
| 498 | + SsrcConfig ssrcConfig = mediaServerItem.getSsrcConfig(); | |
| 499 | + if(ssrcConfig != null) | |
| 500 | + { | |
| 501 | + ssrc = ssrcConfig.getPlaySsrc(); | |
| 502 | + ssrcConfig.releaseSsrc(ssrc); | |
| 503 | + } | |
| 504 | + } | |
| 495 | 505 | if("push".equals(gbStream.getStreamType())) { |
| 496 | 506 | if (streamPushItem != null && streamPushItem.isPushIng()) { |
| 497 | 507 | // 推流状态 |
| ... | ... | @@ -818,7 +828,13 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 818 | 828 | content.append("s=Play\r\n"); |
| 819 | 829 | content.append("c=IN IP4 " + mediaServerItem.getSdpIp() + "\r\n"); |
| 820 | 830 | content.append("t=0 0\r\n"); |
| 821 | - content.append("m=video " + sendRtpItem.getLocalPort() + " RTP/AVP 96\r\n"); | |
| 831 | + // 非严格模式端口不统一, 增加兼容性,修改为一个不为0的端口 | |
| 832 | + int localPort = sendRtpItem.getLocalPort(); | |
| 833 | + if(localPort == 0) | |
| 834 | + { | |
| 835 | + localPort = new Random().nextInt(65535) + 1; | |
| 836 | + } | |
| 837 | + content.append("m=video " + localPort + " RTP/AVP 96\r\n"); | |
| 822 | 838 | content.append("a=sendonly\r\n"); |
| 823 | 839 | content.append("a=rtpmap:96 PS/90000\r\n"); |
| 824 | 840 | if (sendRtpItem.isTcp()) { | ... | ... |