| | |
| | | import com.genersoft.iot.vmp.common.StreamInfo;
|
| | | import com.genersoft.iot.vmp.conf.MediaServerConfig;
|
| | | import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
| | | import com.genersoft.iot.vmp.media.zlm.ZLMUtils;
|
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.beans.factory.annotation.Qualifier;
|
| | |
| | | @Autowired
|
| | | @Qualifier(value="udpSipProvider")
|
| | | private SipProvider udpSipProvider;
|
| | |
|
| | | @Autowired
|
| | | private ZLMUtils zlmUtils;
|
| | |
|
| | | @Value("${media.rtp.enable}")
|
| | | private boolean rtpEnable;
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | |
| | | String ssrc = streamSession.createPlaySsrc();
|
| | | String transport = device.getTransport();
|
| | | MediaServerConfig mediaInfo = storager.getMediaInfo();
|
| | | String mediaPort = null;
|
| | | // 使用动态udp端口
|
| | | if (rtpEnable) {
|
| | | mediaPort = zlmUtils.getNewRTPPort(ssrc) + "";
|
| | | }else {
|
| | | mediaPort = mediaInfo.getRtpProxyPort();
|
| | | }
|
| | | //
|
| | | StringBuffer content = new StringBuffer(200);
|
| | | content.append("v=0\r\n");
|
| | |
| | | content.append("c=IN IP4 "+mediaInfo.getLocalIP()+"\r\n");
|
| | | content.append("t=0 0\r\n");
|
| | | if("TCP".equals(transport)) {
|
| | | content.append("m=video "+mediaInfo.getRtpProxyPort()+" TCP/RTP/AVP 96 98 97\r\n");
|
| | | content.append("m=video "+ mediaPort +" TCP/RTP/AVP 96 98 97\r\n");
|
| | | }
|
| | | if("UDP".equals(transport)) {
|
| | | content.append("m=video "+mediaInfo.getRtpProxyPort()+" RTP/AVP 96 98 97\r\n");
|
| | | content.append("m=video "+ mediaPort +" RTP/AVP 96 98 97\r\n");
|
| | | }
|
| | | content.append("a=recvonly\r\n");
|
| | | content.append("a=rtpmap:96 PS/90000\r\n");
|
| | |
| | | return clientTransaction;
|
| | | }
|
| | |
|
| | |
|
| | | }
|