Commit ed035b74d95f4d18d110626c8335f4b189125db6
1 parent
6fcff056
添加关闭收流发流的接口
Showing
1 changed file
with
30 additions
and
10 deletions
src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
| @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.conf.SipConfig; | ||
| 4 | import com.genersoft.iot.vmp.conf.UserSetting; | 4 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 5 | import com.genersoft.iot.vmp.conf.VersionInfo; | 5 | import com.genersoft.iot.vmp.conf.VersionInfo; |
| 6 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 6 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 7 | +import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; | ||
| 7 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 8 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 8 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 9 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 9 | import com.genersoft.iot.vmp.service.*; | 10 | import com.genersoft.iot.vmp.service.*; |
| @@ -63,34 +64,53 @@ public class RtpController { | @@ -63,34 +64,53 @@ public class RtpController { | ||
| 63 | private IRedisCatchStorage redisCatchStorage; | 64 | private IRedisCatchStorage redisCatchStorage; |
| 64 | 65 | ||
| 65 | 66 | ||
| 66 | - @GetMapping(value = "/openRtpServer") | 67 | + @GetMapping(value = "/receive/open") |
| 67 | @ResponseBody | 68 | @ResponseBody |
| 68 | @Operation(summary = "开启收流和获取发流信息") | 69 | @Operation(summary = "开启收流和获取发流信息") |
| 69 | - @Parameter(name = "isSend", description = "是否发送,false时同时只开启收流", required = true) | ||
| 70 | - @Parameter(name = "callId", description = "整个过程的唯一标识", required = true) | ||
| 71 | - @Parameter(name = "ssrc", description = "来源流的SSRC", required = false) | ||
| 72 | - @Parameter(name = "hasAudio", description = "是否", required = false) | 70 | + @Parameter(name = "isSend", description = "是否发送,false时只开启收流, true同时返回推流信息", required = true) |
| 71 | + @Parameter(name = "callId", description = "整个过程的唯一标识,为了与后续接口关联", required = true) | ||
| 72 | + @Parameter(name = "ssrc", description = "来源流的SSRC,不传则不校验来源ssrc", required = false) | ||
| 73 | @Parameter(name = "stream", description = "形成的流的ID", required = true) | 73 | @Parameter(name = "stream", description = "形成的流的ID", required = true) |
| 74 | @Parameter(name = "tcpMode", description = "收流模式, 0为UDP, 1为TCP被动", required = true) | 74 | @Parameter(name = "tcpMode", description = "收流模式, 0为UDP, 1为TCP被动", required = true) |
| 75 | - public void openRtpServer(Boolean isSend, String ssrc, String callId, Boolean hasAudio, String stream, Integer tcpMode) { | 75 | + @Parameter(name = "callBack", description = "回调地址,如果收流超时会通道回调通知,回调为get请求,参数为callId", required = true) |
| 76 | + public SendRtpItem openRtpServer(Boolean isSend, String ssrc, String callId, String stream, Integer tcpMode, String callBack) { | ||
| 76 | MediaServerItem mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(null); | 77 | MediaServerItem mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(null); |
| 77 | if (mediaServerItem == null) { | 78 | if (mediaServerItem == null) { |
| 78 | throw new ControllerException(ErrorCode.ERROR100.getCode(),"没有可用的MediaServer"); | 79 | throw new ControllerException(ErrorCode.ERROR100.getCode(),"没有可用的MediaServer"); |
| 79 | } | 80 | } |
| 81 | + return null; | ||
| 80 | } | 82 | } |
| 81 | 83 | ||
| 82 | - @GetMapping(value = "/sendRTP") | 84 | + @GetMapping(value = "/receive/close") |
| 83 | @ResponseBody | 85 | @ResponseBody |
| 84 | - @Operation(summary = "发送流") | 86 | + @Operation(summary = "关闭收流") |
| 87 | + @Parameter(name = "stream", description = "流的ID", required = true) | ||
| 88 | + public void closeRtpServer(String stream) { | ||
| 89 | + | ||
| 90 | + } | ||
| 85 | 91 | ||
| 92 | + @GetMapping(value = "/send/start") | ||
| 93 | + @ResponseBody | ||
| 94 | + @Operation(summary = "发送流") | ||
| 86 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) | 95 | @Parameter(name = "ssrc", description = "发送流的SSRC", required = true) |
| 87 | @Parameter(name = "ip", description = "目标IP", required = true) | 96 | @Parameter(name = "ip", description = "目标IP", required = true) |
| 88 | @Parameter(name = "port", description = "目标端口", required = true) | 97 | @Parameter(name = "port", description = "目标端口", required = true) |
| 89 | @Parameter(name = "app", description = "待发送应用名", required = true) | 98 | @Parameter(name = "app", description = "待发送应用名", required = true) |
| 90 | @Parameter(name = "stream", description = "待发送流Id", required = true) | 99 | @Parameter(name = "stream", description = "待发送流Id", required = true) |
| 91 | - @Parameter(name = "callId", description = "整个过程的唯一标识", required = true) | 100 | + @Parameter(name = "callId", description = "整个过程的唯一标识,不传则使用随机端口发流", required = true) |
| 92 | @Parameter(name = "onlyAudio", description = "是否只有音频", required = true) | 101 | @Parameter(name = "onlyAudio", description = "是否只有音频", required = true) |
| 93 | - public void sendRTP(String ssrc, String ip, Integer port, String app, String stream, String callId, Boolean onlyAudio) { | 102 | + @Parameter(name = "streamType", description = "流类型,1为es流,2为ps流, 默认es流", required = false) |
| 103 | + public void sendRTP(String ssrc, String ip, Integer port, String app, String stream, String callId, Boolean onlyAudio, Integer streamType) { | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + @GetMapping(value = "/send/stop") | ||
| 110 | + @ResponseBody | ||
| 111 | + @Operation(summary = "关闭发送流") | ||
| 112 | + @Parameter(name = "callId", description = "整个过程的唯一标识,不传则使用随机端口发流", required = true) | ||
| 113 | + public void closeSendRTP(String callId) { | ||
| 94 | 114 | ||
| 95 | } | 115 | } |
| 96 | 116 |