xiangpei
2024-08-21 4a4692342a4ba22283d5e580d15b645f3be65da0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
package com.ycl.platform.wvp;
 
 
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.util.ObjectUtils;
 
@Schema(description = "流媒体服务信息")
public class MediaServer {
 
    @Schema(description = "ID")
    private String id;
 
    @Schema(description = "IP")
    private String ip;
 
    @Schema(description = "hook使用的IP(zlm访问WVP使用的IP)")
    private String hookIp = "127.0.0.1";
 
    @Schema(description = "SDP IP")
    private String sdpIp;
 
    @Schema(description = "流IP")
    private String streamIp;
 
    @Schema(description = "HTTP端口")
    private int httpPort;
 
    @Schema(description = "HTTPS端口")
    private int httpSSlPort;
 
    @Schema(description = "RTMP端口")
    private int rtmpPort;
 
    @Schema(description = "flv端口")
    private int flvPort;
 
    @Schema(description = "https-flv端口")
    private int flvSSLPort;
 
    @Schema(description = "ws-flv端口")
    private int wsFlvPort;
 
    @Schema(description = "wss-flv端口")
    private int wsFlvSSLPort;
 
    @Schema(description = "RTMPS端口")
    private int rtmpSSlPort;
 
    @Schema(description = "RTP收流端口(单端口模式有用)")
    private int rtpProxyPort;
 
    @Schema(description = "RTSP端口")
    private int rtspPort;
 
    @Schema(description = "RTSPS端口")
    private int rtspSSLPort;
 
    @Schema(description = "是否开启自动配置ZLM")
    private boolean autoConfig;
 
    @Schema(description = "ZLM鉴权参数")
    private String secret;
 
    @Schema(description = "keepalive hook触发间隔,单位秒")
    private Float hookAliveInterval;
 
    @Schema(description = "是否使用多端口模式")
    private boolean rtpEnable;
 
    @Schema(description = "状态")
    private boolean status;
 
    @Schema(description = "多端口RTP收流端口范围")
    private String rtpPortRange;
 
    @Schema(description = "RTP发流端口范围")
    private String sendRtpPortRange;
 
    @Schema(description = "assist服务端口")
    private int recordAssistPort;
 
    @Schema(description = "创建时间")
    private String createTime;
 
    @Schema(description = "更新时间")
    private String updateTime;
 
    @Schema(description = "上次心跳时间")
    private String lastKeepaliveTime;
 
    @Schema(description = "是否是默认ZLM")
    private boolean defaultServer;
 
    @Schema(description = "录像存储时长")
    private int recordDay;
 
    @Schema(description = "录像存储路径")
    private String recordPath;
    @Schema(description = "类型: zlm/abl")
    private String type;
 
    @Schema(description = "转码的前缀")
    private String transcodeSuffix;
 
    public MediaServer() {
    }
 
    public MediaServer(ZLMServerConfig zlmServerConfig, String sipIp) {
        id = zlmServerConfig.getGeneralMediaServerId();
        ip = zlmServerConfig.getIp();
        hookIp = ObjectUtils.isEmpty(zlmServerConfig.getHookIp())? sipIp: zlmServerConfig.getHookIp();
        sdpIp = ObjectUtils.isEmpty(zlmServerConfig.getSdpIp())? zlmServerConfig.getIp(): zlmServerConfig.getSdpIp();
        streamIp = ObjectUtils.isEmpty(zlmServerConfig.getStreamIp())? zlmServerConfig.getIp(): zlmServerConfig.getStreamIp();
        httpPort = zlmServerConfig.getHttpPort();
        flvPort = zlmServerConfig.getHttpPort();
        wsFlvPort = zlmServerConfig.getHttpPort();
        httpSSlPort = zlmServerConfig.getHttpSSLport();
        flvSSLPort = zlmServerConfig.getHttpSSLport();
        wsFlvSSLPort = zlmServerConfig.getHttpSSLport();
        rtmpPort = zlmServerConfig.getRtmpPort();
        rtmpSSlPort = zlmServerConfig.getRtmpSslPort();
        rtpProxyPort = zlmServerConfig.getRtpProxyPort();
        rtspPort = zlmServerConfig.getRtspPort();
        rtspSSLPort = zlmServerConfig.getRtspSSlport();
        autoConfig = true; // 默认值true;
        secret = zlmServerConfig.getApiSecret();
        hookAliveInterval = zlmServerConfig.getHookAliveInterval();
        rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口
        rtpPortRange = zlmServerConfig.getPortRange().replace("_",","); // 默认使用30000,30500作为级联时发送流的端口号
        recordAssistPort = 0; // 默认关闭
        transcodeSuffix = zlmServerConfig.getTranscodeSuffix();
 
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getIp() {
        return ip;
    }
 
    public void setIp(String ip) {
        this.ip = ip;
    }
 
    public String getHookIp() {
        return hookIp;
    }
 
    public void setHookIp(String hookIp) {
        this.hookIp = hookIp;
    }
 
    public String getSdpIp() {
        return sdpIp;
    }
 
    public void setSdpIp(String sdpIp) {
        this.sdpIp = sdpIp;
    }
 
    public String getStreamIp() {
        return streamIp;
    }
 
    public void setStreamIp(String streamIp) {
        this.streamIp = streamIp;
    }
 
    public int getHttpPort() {
        return httpPort;
    }
 
    public void setHttpPort(int httpPort) {
        this.httpPort = httpPort;
    }
 
    public int getHttpSSlPort() {
        return httpSSlPort;
    }
 
    public void setHttpSSlPort(int httpSSlPort) {
        this.httpSSlPort = httpSSlPort;
    }
 
    public int getRtmpPort() {
        return rtmpPort;
    }
 
    public void setRtmpPort(int rtmpPort) {
        this.rtmpPort = rtmpPort;
    }
 
    public int getRtmpSSlPort() {
        return rtmpSSlPort;
    }
 
    public void setRtmpSSlPort(int rtmpSSlPort) {
        this.rtmpSSlPort = rtmpSSlPort;
    }
 
    public int getRtpProxyPort() {
        return rtpProxyPort;
    }
 
    public void setRtpProxyPort(int rtpProxyPort) {
        this.rtpProxyPort = rtpProxyPort;
    }
 
    public int getRtspPort() {
        return rtspPort;
    }
 
    public void setRtspPort(int rtspPort) {
        this.rtspPort = rtspPort;
    }
 
    public int getRtspSSLPort() {
        return rtspSSLPort;
    }
 
    public void setRtspSSLPort(int rtspSSLPort) {
        this.rtspSSLPort = rtspSSLPort;
    }
 
    public boolean isAutoConfig() {
        return autoConfig;
    }
 
    public void setAutoConfig(boolean autoConfig) {
        this.autoConfig = autoConfig;
    }
 
    public String getSecret() {
        return secret;
    }
 
    public void setSecret(String secret) {
        this.secret = secret;
    }
 
    public boolean isRtpEnable() {
        return rtpEnable;
    }
 
    public void setRtpEnable(boolean rtpEnable) {
        this.rtpEnable = rtpEnable;
    }
 
    public String getRtpPortRange() {
        return rtpPortRange;
    }
 
    public void setRtpPortRange(String rtpPortRange) {
        this.rtpPortRange = rtpPortRange;
    }
 
    public int getRecordAssistPort() {
        return recordAssistPort;
    }
 
    public void setRecordAssistPort(int recordAssistPort) {
        this.recordAssistPort = recordAssistPort;
    }
 
    public boolean isDefaultServer() {
        return defaultServer;
    }
 
    public void setDefaultServer(boolean defaultServer) {
        this.defaultServer = defaultServer;
    }
 
    public String getCreateTime() {
        return createTime;
    }
 
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
 
    public String getUpdateTime() {
        return updateTime;
    }
 
    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }
 
    public boolean isStatus() {
        return status;
    }
 
    public void setStatus(boolean status) {
        this.status = status;
    }
 
    public String getLastKeepaliveTime() {
        return lastKeepaliveTime;
    }
 
    public void setLastKeepaliveTime(String lastKeepaliveTime) {
        this.lastKeepaliveTime = lastKeepaliveTime;
    }
 
    public Float getHookAliveInterval() {
        return hookAliveInterval;
    }
 
    public void setHookAliveInterval(Float hookAliveInterval) {
        this.hookAliveInterval = hookAliveInterval;
    }
 
    public String getSendRtpPortRange() {
        return sendRtpPortRange;
    }
 
    public void setSendRtpPortRange(String sendRtpPortRange) {
        this.sendRtpPortRange = sendRtpPortRange;
    }
 
    public int getRecordDay() {
        return recordDay;
    }
 
    public void setRecordDay(int recordDay) {
        this.recordDay = recordDay;
    }
 
    public String getRecordPath() {
        return recordPath;
    }
 
    public void setRecordPath(String recordPath) {
        this.recordPath = recordPath;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public int getFlvPort() {
        return flvPort;
    }
 
    public void setFlvPort(int flvPort) {
        this.flvPort = flvPort;
    }
 
    public int getFlvSSLPort() {
        return flvSSLPort;
    }
 
    public void setFlvSSLPort(int flvSSLPort) {
        this.flvSSLPort = flvSSLPort;
    }
 
    public int getWsFlvPort() {
        return wsFlvPort;
    }
 
    public void setWsFlvPort(int wsFlvPort) {
        this.wsFlvPort = wsFlvPort;
    }
 
    public int getWsFlvSSLPort() {
        return wsFlvSSLPort;
    }
 
    public void setWsFlvSSLPort(int wsFlvSSLPort) {
        this.wsFlvSSLPort = wsFlvSSLPort;
    }
 
    public String getTranscodeSuffix() {
        return transcodeSuffix;
    }
 
    public void setTranscodeSuffix(String transcodeSuffix) {
        this.transcodeSuffix = transcodeSuffix;
    }
}