国标级联推送推流 支持多wvp间自动选择与推送
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 当上级平台
|
||||
* @author lin
|
||||
*/
|
||||
public class MessageForPushChannel {
|
||||
/**
|
||||
@@ -45,6 +48,20 @@ public class MessageForPushChannel {
|
||||
*/
|
||||
private String mediaServerId;
|
||||
|
||||
public static MessageForPushChannel getInstance(int type, String app, String stream, String gbId,
|
||||
String platFormId, String platFormName, String serverId,
|
||||
String mediaServerId){
|
||||
MessageForPushChannel messageForPushChannel = new MessageForPushChannel();
|
||||
messageForPushChannel.setType(type);
|
||||
messageForPushChannel.setGbId(gbId);
|
||||
messageForPushChannel.setApp(app);
|
||||
messageForPushChannel.setStream(stream);
|
||||
messageForPushChannel.setMediaServerId(mediaServerId);
|
||||
messageForPushChannel.setPlatFormId(platFormId);
|
||||
messageForPushChannel.setPlatFormName(platFormName);
|
||||
return messageForPushChannel;
|
||||
}
|
||||
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
/**
|
||||
* redis消息:请求下级推送流信息
|
||||
* @author lin
|
||||
*/
|
||||
public class RequestPushStreamMsg {
|
||||
|
||||
|
||||
/**
|
||||
* 下级服务ID
|
||||
*/
|
||||
private String mediaServerId;
|
||||
|
||||
/**
|
||||
* 流ID
|
||||
*/
|
||||
private String app;
|
||||
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
private String stream;
|
||||
|
||||
/**
|
||||
* 目标IP
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 目标端口
|
||||
*/
|
||||
private int port;
|
||||
|
||||
/**
|
||||
* ssrc
|
||||
*/
|
||||
private String ssrc;
|
||||
|
||||
/**
|
||||
* 是否使用TCP方式
|
||||
*/
|
||||
private boolean tcp;
|
||||
|
||||
/**
|
||||
* 本地使用的端口
|
||||
*/
|
||||
private int srcPort;
|
||||
|
||||
/**
|
||||
* 发送时,rtp的pt(uint8_t),不传时默认为96
|
||||
*/
|
||||
private int pt;
|
||||
|
||||
/**
|
||||
* 发送时,rtp的负载类型。为true时,负载为ps;为false时,为es;
|
||||
*/
|
||||
private boolean ps;
|
||||
|
||||
/**
|
||||
* 是否只有音频
|
||||
*/
|
||||
private boolean onlyAudio;
|
||||
|
||||
|
||||
public static RequestPushStreamMsg getInstance(String mediaServerId, String app, String stream, String ip, int port, String ssrc,
|
||||
boolean tcp, int srcPort, int pt, boolean ps, boolean onlyAudio) {
|
||||
RequestPushStreamMsg requestPushStreamMsg = new RequestPushStreamMsg();
|
||||
requestPushStreamMsg.setMediaServerId(mediaServerId);
|
||||
requestPushStreamMsg.setApp(app);
|
||||
requestPushStreamMsg.setStream(stream);
|
||||
requestPushStreamMsg.setIp(ip);
|
||||
requestPushStreamMsg.setPort(port);
|
||||
requestPushStreamMsg.setSsrc(ssrc);
|
||||
requestPushStreamMsg.setTcp(tcp);
|
||||
requestPushStreamMsg.setSrcPort(srcPort);
|
||||
requestPushStreamMsg.setPt(pt);
|
||||
requestPushStreamMsg.setPs(ps);
|
||||
requestPushStreamMsg.setOnlyAudio(onlyAudio);
|
||||
return requestPushStreamMsg;
|
||||
}
|
||||
|
||||
public String getMediaServerId() {
|
||||
return mediaServerId;
|
||||
}
|
||||
|
||||
public void setMediaServerId(String mediaServerId) {
|
||||
this.mediaServerId = mediaServerId;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getSsrc() {
|
||||
return ssrc;
|
||||
}
|
||||
|
||||
public void setSsrc(String ssrc) {
|
||||
this.ssrc = ssrc;
|
||||
}
|
||||
|
||||
public boolean isTcp() {
|
||||
return tcp;
|
||||
}
|
||||
|
||||
public void setTcp(boolean tcp) {
|
||||
this.tcp = tcp;
|
||||
}
|
||||
|
||||
public int getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
|
||||
public void setSrcPort(int srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
|
||||
public int getPt() {
|
||||
return pt;
|
||||
}
|
||||
|
||||
public void setPt(int pt) {
|
||||
this.pt = pt;
|
||||
}
|
||||
|
||||
public boolean isPs() {
|
||||
return ps;
|
||||
}
|
||||
|
||||
public void setPs(boolean ps) {
|
||||
this.ps = ps;
|
||||
}
|
||||
|
||||
public boolean isOnlyAudio() {
|
||||
return onlyAudio;
|
||||
}
|
||||
|
||||
public void setOnlyAudio(boolean onlyAudio) {
|
||||
this.onlyAudio = onlyAudio;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
/**
|
||||
* redis消息:请求下级回复推送信息
|
||||
* @author lin
|
||||
*/
|
||||
public class RequestSendItemMsg {
|
||||
|
||||
/**
|
||||
* 下级服务ID
|
||||
*/
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 下级服务ID
|
||||
*/
|
||||
private String mediaServerId;
|
||||
|
||||
/**
|
||||
* 流ID
|
||||
*/
|
||||
private String app;
|
||||
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
private String stream;
|
||||
|
||||
/**
|
||||
* 目标IP
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 目标端口
|
||||
*/
|
||||
private int port;
|
||||
|
||||
/**
|
||||
* ssrc
|
||||
*/
|
||||
private String ssrc;
|
||||
|
||||
/**
|
||||
* 平台国标编号
|
||||
*/
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 平台名称
|
||||
*/
|
||||
private String platformName;
|
||||
|
||||
/**
|
||||
* 通道ID
|
||||
*/
|
||||
private String channelId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否使用TCP
|
||||
*/
|
||||
private Boolean isTcp;
|
||||
|
||||
|
||||
|
||||
|
||||
public static RequestSendItemMsg getInstance(String serverId, String mediaServerId, String app, String stream, String ip, int port,
|
||||
String ssrc, String platformId, String channelId, Boolean isTcp, String platformName) {
|
||||
RequestSendItemMsg requestSendItemMsg = new RequestSendItemMsg();
|
||||
requestSendItemMsg.setServerId(serverId);
|
||||
requestSendItemMsg.setMediaServerId(mediaServerId);
|
||||
requestSendItemMsg.setApp(app);
|
||||
requestSendItemMsg.setStream(stream);
|
||||
requestSendItemMsg.setIp(ip);
|
||||
requestSendItemMsg.setPort(port);
|
||||
requestSendItemMsg.setSsrc(ssrc);
|
||||
requestSendItemMsg.setPlatformId(platformId);
|
||||
requestSendItemMsg.setPlatformName(platformName);
|
||||
requestSendItemMsg.setChannelId(channelId);
|
||||
requestSendItemMsg.setTcp(isTcp);
|
||||
|
||||
return requestSendItemMsg;
|
||||
}
|
||||
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(String serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getMediaServerId() {
|
||||
return mediaServerId;
|
||||
}
|
||||
|
||||
public void setMediaServerId(String mediaServerId) {
|
||||
this.mediaServerId = mediaServerId;
|
||||
}
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getSsrc() {
|
||||
return ssrc;
|
||||
}
|
||||
|
||||
public void setSsrc(String ssrc) {
|
||||
this.ssrc = ssrc;
|
||||
}
|
||||
|
||||
public String getPlatformId() {
|
||||
return platformId;
|
||||
}
|
||||
|
||||
public void setPlatformId(String platformId) {
|
||||
this.platformId = platformId;
|
||||
}
|
||||
|
||||
public String getPlatformName() {
|
||||
return platformName;
|
||||
}
|
||||
|
||||
public void setPlatformName(String platformName) {
|
||||
this.platformName = platformName;
|
||||
}
|
||||
|
||||
public String getChannelId() {
|
||||
return channelId;
|
||||
}
|
||||
|
||||
public void setChannelId(String channelId) {
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public Boolean getTcp() {
|
||||
return isTcp;
|
||||
}
|
||||
|
||||
public void setTcp(Boolean tcp) {
|
||||
isTcp = tcp;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
|
||||
/**
|
||||
* redis消息:下级回复推送信息
|
||||
* @author lin
|
||||
*/
|
||||
public class ResponseSendItemMsg {
|
||||
|
||||
private SendRtpItem sendRtpItem;
|
||||
|
||||
private MediaServerItem mediaServerItem;
|
||||
|
||||
public SendRtpItem getSendRtpItem() {
|
||||
return sendRtpItem;
|
||||
}
|
||||
|
||||
public void setSendRtpItem(SendRtpItem sendRtpItem) {
|
||||
this.sendRtpItem = sendRtpItem;
|
||||
}
|
||||
|
||||
public MediaServerItem getMediaServerItem() {
|
||||
return mediaServerItem;
|
||||
}
|
||||
|
||||
public void setMediaServerItem(MediaServerItem mediaServerItem) {
|
||||
this.mediaServerItem = mediaServerItem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
public class WvpRedisMsg {
|
||||
|
||||
public static WvpRedisMsg getInstance(String fromId, String toId, String type, String cmd, String serial, String content){
|
||||
WvpRedisMsg wvpRedisMsg = new WvpRedisMsg();
|
||||
wvpRedisMsg.setFromId(fromId);
|
||||
wvpRedisMsg.setToId(toId);
|
||||
wvpRedisMsg.setType(type);
|
||||
wvpRedisMsg.setCmd(cmd);
|
||||
wvpRedisMsg.setSerial(serial);
|
||||
wvpRedisMsg.setContent(content);
|
||||
return wvpRedisMsg;
|
||||
}
|
||||
|
||||
private String fromId;
|
||||
|
||||
private String toId;
|
||||
/**
|
||||
* req 请求, res 回复
|
||||
*/
|
||||
private String type;
|
||||
private String cmd;
|
||||
|
||||
/**
|
||||
* 消息的ID
|
||||
*/
|
||||
private String serial;
|
||||
private Object content;
|
||||
|
||||
private final static String requestTag = "req";
|
||||
private final static String responseTag = "res";
|
||||
|
||||
public static WvpRedisMsg getRequestInstance(String fromId, String toId, String cmd, String serial, Object content) {
|
||||
WvpRedisMsg wvpRedisMsg = new WvpRedisMsg();
|
||||
wvpRedisMsg.setType(requestTag);
|
||||
wvpRedisMsg.setFromId(fromId);
|
||||
wvpRedisMsg.setToId(toId);
|
||||
wvpRedisMsg.setCmd(cmd);
|
||||
wvpRedisMsg.setSerial(serial);
|
||||
wvpRedisMsg.setContent(content);
|
||||
return wvpRedisMsg;
|
||||
}
|
||||
|
||||
public static WvpRedisMsg getResponseInstance() {
|
||||
WvpRedisMsg wvpRedisMsg = new WvpRedisMsg();
|
||||
wvpRedisMsg.setType(responseTag);
|
||||
return wvpRedisMsg;
|
||||
}
|
||||
|
||||
public static WvpRedisMsg getResponseInstance(String fromId, String toId, String cmd, String serial, Object content) {
|
||||
WvpRedisMsg wvpRedisMsg = new WvpRedisMsg();
|
||||
wvpRedisMsg.setType(responseTag);
|
||||
wvpRedisMsg.setFromId(fromId);
|
||||
wvpRedisMsg.setToId(toId);
|
||||
wvpRedisMsg.setCmd(cmd);
|
||||
wvpRedisMsg.setSerial(serial);
|
||||
wvpRedisMsg.setContent(content);
|
||||
return wvpRedisMsg;
|
||||
}
|
||||
|
||||
public static boolean isRequest(WvpRedisMsg wvpRedisMsg) {
|
||||
return requestTag.equals(wvpRedisMsg.getType());
|
||||
}
|
||||
|
||||
public String getSerial() {
|
||||
return serial;
|
||||
}
|
||||
|
||||
public void setSerial(String serial) {
|
||||
this.serial = serial;
|
||||
}
|
||||
|
||||
public String getFromId() {
|
||||
return fromId;
|
||||
}
|
||||
|
||||
public void setFromId(String fromId) {
|
||||
this.fromId = fromId;
|
||||
}
|
||||
|
||||
public String getToId() {
|
||||
return toId;
|
||||
}
|
||||
|
||||
public void setToId(String toId) {
|
||||
this.toId = toId;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
public Object getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(Object content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.genersoft.iot.vmp.service.bean;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
|
||||
public class WvpRedisMsgCmd {
|
||||
|
||||
public static final String GET_SEND_ITEM = "GetSendItem";
|
||||
public static final String REQUEST_PUSH_STREAM = "RequestPushStream";
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user