From f62bf7b2c6239f2c67f5d9019f8302c8d441f870 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 29 六月 2023 09:52:05 +0800
Subject: [PATCH] Merge branch '2.6.8' into wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 117 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
new file mode 100644
index 0000000..c8c1625
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
@@ -0,0 +1,117 @@
+package com.genersoft.iot.vmp.vmanager.rtp;
+
+import com.genersoft.iot.vmp.conf.SipConfig;
+import com.genersoft.iot.vmp.conf.UserSetting;
+import com.genersoft.iot.vmp.conf.VersionInfo;
+import com.genersoft.iot.vmp.conf.exception.ControllerException;
+import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
+import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe;
+import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
+import com.genersoft.iot.vmp.service.*;
+import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
+import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@SuppressWarnings("rawtypes")
+@Tag(name = "绗笁鏂规湇鍔″鎺�")
+
+@RestController
+@RequestMapping("/api/rtp")
+public class RtpController {
+
+    @Autowired
+    private ZlmHttpHookSubscribe zlmHttpHookSubscribe;
+
+    @Autowired
+    private IMediaServerService mediaServerService;
+
+    @Autowired
+    private VersionInfo versionInfo;
+
+    @Autowired
+    private SipConfig sipConfig;
+
+    @Autowired
+    private UserSetting userSetting;
+
+    @Autowired
+    private IDeviceService deviceService;
+
+    @Autowired
+    private IDeviceChannelService channelService;
+
+    @Autowired
+    private IStreamPushService pushService;
+
+
+    @Autowired
+    private IStreamProxyService proxyService;
+
+
+    @Value("${server.port}")
+    private int serverPort;
+
+
+    @Autowired
+    private IRedisCatchStorage redisCatchStorage;
+
+
+    @GetMapping(value = "/receive/open")
+    @ResponseBody
+    @Operation(summary = "寮�鍚敹娴佸拰鑾峰彇鍙戞祦淇℃伅")
+    @Parameter(name = "isSend", description = "鏄惁鍙戦�侊紝false鏃跺彧寮�鍚敹娴侊紝 true鍚屾椂杩斿洖鎺ㄦ祦淇℃伅", required = true)
+    @Parameter(name = "callId", description = "鏁翠釜杩囩▼鐨勫敮涓�鏍囪瘑锛屼负浜嗕笌鍚庣画鎺ュ彛鍏宠仈", required = true)
+    @Parameter(name = "ssrc", description = "鏉ユ簮娴佺殑SSRC锛屼笉浼犲垯涓嶆牎楠屾潵婧恠src", required = false)
+    @Parameter(name = "stream", description = "褰㈡垚鐨勬祦鐨処D", required = true)
+    @Parameter(name = "tcpMode", description = "鏀舵祦妯″紡锛� 0涓篣DP锛� 1涓篢CP琚姩", required = true)
+    @Parameter(name = "callBack", description = "鍥炶皟鍦板潃锛屽鏋滄敹娴佽秴鏃朵細閫氶亾鍥炶皟閫氱煡锛屽洖璋冧负get璇锋眰锛屽弬鏁颁负callId", required = true)
+    public SendRtpItem openRtpServer(Boolean isSend, String ssrc, String callId, String stream, Integer tcpMode, String callBack) {
+        MediaServerItem mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(null);
+        if (mediaServerItem == null) {
+            throw new ControllerException(ErrorCode.ERROR100.getCode(),"娌℃湁鍙敤鐨凪ediaServer");
+        }
+        return null;
+    }
+
+    @GetMapping(value = "/receive/close")
+    @ResponseBody
+    @Operation(summary = "鍏抽棴鏀舵祦")
+    @Parameter(name = "stream", description = "娴佺殑ID", required = true)
+    public void closeRtpServer(String stream) {
+
+    }
+
+    @GetMapping(value = "/send/start")
+    @ResponseBody
+    @Operation(summary = "鍙戦�佹祦")
+    @Parameter(name = "ssrc", description = "鍙戦�佹祦鐨凷SRC", required = true)
+    @Parameter(name = "ip", description = "鐩爣IP", required = true)
+    @Parameter(name = "port", description = "鐩爣绔彛", required = true)
+    @Parameter(name = "app", description = "寰呭彂閫佸簲鐢ㄥ悕", required = true)
+    @Parameter(name = "stream", description = "寰呭彂閫佹祦Id", required = true)
+    @Parameter(name = "callId", description = "鏁翠釜杩囩▼鐨勫敮涓�鏍囪瘑锛屼笉浼犲垯浣跨敤闅忔満绔彛鍙戞祦", required = true)
+    @Parameter(name = "onlyAudio", description = "鏄惁鍙湁闊抽", required = true)
+    @Parameter(name = "streamType", description = "娴佺被鍨嬶紝1涓篹s娴侊紝2涓簆s娴侊紝 榛樿es娴�", required = false)
+    public void sendRTP(String ssrc, String ip, Integer port, String app, String stream, String callId, Boolean onlyAudio, Integer streamType) {
+
+    }
+
+
+
+    @GetMapping(value = "/send/stop")
+    @ResponseBody
+    @Operation(summary = "鍏抽棴鍙戦�佹祦")
+    @Parameter(name = "callId", description = "鏁翠釜杩囩▼鐨勫敮涓�鏍囪瘑锛屼笉浼犲垯浣跨敤闅忔満绔彛鍙戞祦", required = true)
+    public void closeSendRTP(String callId) {
+
+    }
+
+}

--
Gitblit v1.8.0