From 6b03568c5dd128a3d71c02fb1a3a76a4344a4920 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 21 十一月 2022 17:07:54 +0800 Subject: [PATCH] 优化rtcp判断 --- src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 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 46b0e00..3514b56 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java @@ -5,7 +5,7 @@ import java.io.Serializable; @Schema(description = "娴佷俊鎭�") -public class StreamInfo implements Serializable { +public class StreamInfo implements Serializable, Cloneable{ @Schema(description = "搴旂敤鍚�") private String app; @@ -223,8 +223,8 @@ } } - public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) { - String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam); + public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam, boolean isPlay) { + String file = String.format("index/api/webrtc?app=%s&stream=%s&type=%s%s", app, stream, callIdParam, isPlay?"play":"push"); this.rtc = new StreamURL("http", host, port, file); if (sslPort != 0) { this.rtcs = new StreamURL("https", host, sslPort, file); @@ -463,4 +463,15 @@ public void setTransactionInfo(TransactionInfo transactionInfo) { this.transactionInfo = transactionInfo; } + + @Override + public StreamInfo clone() { + StreamInfo instance = null; + try{ + instance = (StreamInfo)super.clone(); + }catch(CloneNotSupportedException e) { + e.printStackTrace(); + } + return instance; + } } -- Gitblit v1.8.0