From 9c3967d67aa148138515e45ac49cc449f4ee1fcf Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 29 一月 2024 20:03:55 +0800
Subject: [PATCH] Merge pull request #1288 from pedoc/wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
index d115544..5677008 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
@@ -396,7 +396,16 @@
// 闈炰弗鏍兼ā寮忕鍙d笉缁熶竴, 澧炲姞鍏煎鎬э紝淇敼涓轰竴涓笉涓�0鐨勭鍙�
localPort = new Random().nextInt(65535) + 1;
}
- content.append("m=video " + localPort + " RTP/AVP 96\r\n");
+ if (sendRtpItem.isTcp()) {
+ content.append("m=video " + localPort + " TCP/RTP/AVP 96\r\n");
+ if (!sendRtpItem.isTcpActive()) {
+ content.append("a=setup:active\r\n");
+ } else {
+ content.append("a=setup:passive\r\n");
+ }
+ }else {
+ content.append("m=video " + localPort + " RTP/AVP 96\r\n");
+ }
content.append("a=sendonly\r\n");
content.append("a=rtpmap:96 PS/90000\r\n");
content.append("y=" + sendRtpItem.getSsrc() + "\r\n");
@@ -512,7 +521,10 @@
}
});
} else {
-
+ sendRtpItem.setPlayType(InviteStreamType.PLAY);
+ String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
+ sendRtpItem.setStreamId(streamId);
+ redisCatchStorage.updateSendRTPSever(sendRtpItem);
SSRCInfo ssrcInfo = playService.play(mediaServerItem, device.getDeviceId(), channelId, ssrc, ((code, msg, data) -> {
if (code == InviteErrorCode.SUCCESS.getCode()) {
hookEvent.run(code, msg, data);
@@ -524,9 +536,6 @@
errorEvent.run(code, msg, data);
}
}));
- sendRtpItem.setPlayType(InviteStreamType.PLAY);
- String streamId = String.format("%s_%s", device.getDeviceId(), channelId);
- sendRtpItem.setStreamId(streamId);
sendRtpItem.setSsrc(ssrcInfo.getSsrc());
redisCatchStorage.updateSendRTPSever(sendRtpItem);
--
Gitblit v1.8.0