From f4e5e0396245f249153f76382772d943acc1192a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 21 六月 2023 15:53:26 +0800
Subject: [PATCH] 修复表名错误 #904
---
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java | 35 +++++++++++++++++++++++++++++++++--
1 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
index 8311745..5bda636 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
@@ -3,6 +3,7 @@
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
+import java.util.Objects;
@Schema(description = "娴佷俊鎭�")
public class StreamInfo implements Serializable, Cloneable{
@@ -168,7 +169,7 @@
}
public void setRtmp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
- String file = String.format("%s/%s/%s", app, stream, callIdParam);
+ String file = String.format("%s/%s%s", app, stream, callIdParam);
if (port > 0) {
this.rtmp = new StreamURL("rtmp", host, port, file);
}
@@ -178,7 +179,7 @@
}
public void setRtsp(String host, int port, int sslPort, String app, String stream, String callIdParam) {
- String file = String.format("%s/%s/%s", app, stream, callIdParam);
+ String file = String.format("%s/%s%s", app, stream, callIdParam);
if (port > 0) {
this.rtsp = new StreamURL("rtsp", host, port, file);
}
@@ -237,6 +238,9 @@
}
public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) {
+ if (callIdParam != null) {
+ callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&");
+ }
String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam);
if (port > 0) {
this.rtc = new StreamURL("http", host, port, file);
@@ -524,4 +528,31 @@
}
return instance;
}
+
+
+ /*=========================璁惧涓诲瓙鐮佹祦閫昏緫START====================*/
+ @Schema(description = "鏄惁涓哄瓙鐮佹祦(true-鏄紝false-涓荤爜娴�)")
+ private boolean subStream;
+
+ public boolean isSubStream() {
+ return subStream;
+ }
+
+ public void setSubStream(boolean subStream) {
+ this.subStream = subStream;
+ }
+
+ public static String getPlayStream(String deviceId,String channelId,boolean isSubStream){
+ String streamId;
+ if(isSubStream){
+ streamId = String.format("%s_%s_%s","sub",deviceId, channelId);
+ }else {
+ streamId = String.format("%s_%s_%s","main", deviceId, channelId);
+ }
+ return streamId;
+ }
+
+ /*=========================璁惧涓诲瓙鐮佹祦閫昏緫END====================*/
+
+
}
--
Gitblit v1.8.0