临时提交
parent
246c01b1c8
commit
306c42b4b7
|
@ -0,0 +1,9 @@
|
|||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.utils.MessageElement;
|
||||
|
||||
public class CatalogEvent extends DeviceChannel{
|
||||
|
||||
@MessageElement("Event")
|
||||
private String event;
|
||||
}
|
|
@ -90,7 +90,7 @@ public class CommonGBChannel {
|
|||
private String gbBusinessGroupId;
|
||||
|
||||
@Schema(description = "国标-摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道")
|
||||
private String gbPtzType;
|
||||
private Integer gbPtzType;
|
||||
|
||||
@Schema(description = "国标-摄像机光电成像类型。1-可见光成像;2-热成像;3-雷达成像;4-X光成像;5-深度光场成像;9-其他。可多值,")
|
||||
private String gbPhotoelectricImagingTyp;
|
||||
|
|
|
@ -1,260 +1,275 @@
|
|||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.utils.MessageElement;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@Schema(description = "通道信息")
|
||||
public class DeviceChannel {
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeviceChannel extends CommonGBChannel {
|
||||
|
||||
|
||||
/**
|
||||
* 数据库自增ID
|
||||
*/
|
||||
@Schema(description = "数据库自增ID")
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 通道国标编号
|
||||
*/
|
||||
@Schema(description = "通道国标编号")
|
||||
private String channelId;
|
||||
|
||||
/**
|
||||
* 设备国标编号
|
||||
*/
|
||||
@Schema(description = "设备国标编号")
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "编码")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 通道名
|
||||
*/
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
@Schema(description = "生产厂商")
|
||||
private String manufacture;
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备厂商")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@Schema(description = "型号")
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备型号")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 设备归属
|
||||
*/
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备归属")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 行政区域
|
||||
*/
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "行政区域")
|
||||
private String civilCode;
|
||||
|
||||
/**
|
||||
* 警区
|
||||
*/
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "警区")
|
||||
private String block;
|
||||
|
||||
/**
|
||||
* 安装地址
|
||||
*/
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "安装地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否有子设备 1有, 0没有
|
||||
*/
|
||||
@Schema(description = "是否有子设备 1有, 0没有")
|
||||
private int parental;
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "是否有子设备")
|
||||
private Boolean parental;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
@Schema(description = "父级id")
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "父节点ID")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式
|
||||
*/
|
||||
@Schema(description = "信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式")
|
||||
private int safetyWay;
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "信令安全模式")
|
||||
private Integer safetyWay;
|
||||
|
||||
/**
|
||||
* 注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式
|
||||
*/
|
||||
@Schema(description = "注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式")
|
||||
private int registerWay;
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "注册方式")
|
||||
private Integer registerWay;
|
||||
|
||||
/**
|
||||
* 证书序列号
|
||||
*/
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "证书序列号")
|
||||
private String certNum;
|
||||
private Integer certNum;
|
||||
|
||||
/**
|
||||
* 证书有效标识 缺省为0;证书有效标识:0:无效1: 有效
|
||||
*/
|
||||
@Schema(description = "证书有效标识 缺省为0;证书有效标识:0:无效1: 有效")
|
||||
private int certifiable;
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "证书有效标识")
|
||||
private Integer certifiable;
|
||||
|
||||
/**
|
||||
* 证书无效原因码
|
||||
*/
|
||||
@Schema(description = "证书无效原因码")
|
||||
private int errCode;
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "无效原因码(有证书且证书无效的设备必选)")
|
||||
private Integer errCode;
|
||||
|
||||
/**
|
||||
* 证书终止有效期
|
||||
*/
|
||||
@Schema(description = "证书终止有效期")
|
||||
private String endTime;
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "证书终止有效期(有证书且证书无效的设备必选)")
|
||||
private Integer endTime;
|
||||
|
||||
/**
|
||||
* 保密属性 缺省为0; 0:不涉密, 1:涉密
|
||||
*/
|
||||
@Schema(description = "保密属性 缺省为0; 0:不涉密, 1:涉密")
|
||||
private String secrecy;
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机安全能力等级代码")
|
||||
private String securityLevelCode;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
@Schema(description = "IP地址")
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密")
|
||||
private Integer secrecy;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备/系统IPv4/IPv6地址")
|
||||
private String ipAddress;
|
||||
|
||||
/**
|
||||
* 端口号
|
||||
*/
|
||||
@Schema(description = "端口号")
|
||||
private int port;
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备/系统端口")
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备口令")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 云台类型
|
||||
*/
|
||||
@Schema(description = "云台类型")
|
||||
private int ptzType;
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备状态")
|
||||
private Boolean status;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "经度 WGS-84坐标系")
|
||||
private Double longitude;
|
||||
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = ",纬度 WGS-84坐标系")
|
||||
private Double latitude;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "虚拟组织所属的业务分组ID")
|
||||
private String businessGroupId;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机结构类型,标识摄像机类型: 1-球机; 2-半球; 3-固定枪机; 4-遥控枪机;5-遥控半球;6-多目设备的全景/拼接通道;7-多目设备的分割通道")
|
||||
private Integer ptzType;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机光电成像类型。1-可见光成像;2-热成像;3-雷达成像;4-X光成像;5-深度光场成像;9-其他。可多值,")
|
||||
private String photoelectricImagingTyp;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机采集部位类型")
|
||||
private String capturePositionType;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机安装位置室外、室内属性。1-室外、2-室内。")
|
||||
private Integer roomType;
|
||||
|
||||
// 2016
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "用途属性")
|
||||
private Integer useType;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机补光属性。1-无补光;2-红外补光;3-白光补光;4-激光补光;9-其他")
|
||||
private Integer supplyLightType;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机监视方位(光轴方向)属性。1-东(西向东)、2-西(东向西)、3-南(北向南)、4-北(南向北)、" +
|
||||
"5-东南(西北到东南)、6-东北(西南到东北)、7-西南(东北到西南)、8-西北(东南到西北)")
|
||||
private Integer directionType;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机支持的分辨率,可多值")
|
||||
private String resolution;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机支持的码流编号列表,用于实时点播时指定码流编号(可选)")
|
||||
private String streamNumberList;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "下载倍速(可选),可多值")
|
||||
private String downloadSpeed;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "空域编码能力,取值0-不支持;1-1级增强(1个增强层);2-2级增强(2个增强层);3-3级增强(3个增强层)")
|
||||
private Integer svcSpaceSupportMod;
|
||||
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "时域编码能力,取值0-不支持;1-1级增强;2-2级增强;3-3级增强(可选)")
|
||||
private Integer svcTimeSupportMode;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = " SSVC增强层与基本层比例能力 ")
|
||||
private String ssvcRatioSupportList;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "移动采集设备类型(仅移动采集设备适用,必选);1-移动机器人载摄像机;2-执法记录仪;3-移动单兵设备;" +
|
||||
"4-车载视频记录设备;5-无人机载摄像机;9-其他")
|
||||
private Integer mobileDeviceType;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机水平视场角(可选),取值范围大于0度小于等于360度")
|
||||
private Double horizontalFieldAngle;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机竖直视场角(可选),取值范围大于0度小于等于360度 ")
|
||||
private Double verticalFieldAngle;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机可视距离(可选),单位:米")
|
||||
private Double maxViewDistance;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "基层组织编码(必选,非基层建设时为“000000”)")
|
||||
private String grassrootsCode;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "监控点位类型(当为摄像机时必选),1-一类视频监控点;2-二类视频监控点;3-三类视频监控点;9-其他点位。")
|
||||
private Integer poType;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "点位俗称")
|
||||
private String poCommonName;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "设备MAC地址(可选),用“XX-XX-XX-XX-XX-XX”格式表达")
|
||||
private String mac;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机卡口功能类型,01-人脸卡口;02-人员卡口;03-机动车卡口;04-非机动车卡口;05-物品卡口;99-其他")
|
||||
private String functionType;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机视频编码格式")
|
||||
private String encodeType;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机安装使用时间")
|
||||
private String installTime;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机所属管理单位名称")
|
||||
private String managementUnit;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "摄像机所属管理单位联系人的联系方式(电话号码,可多值,用英文半角“/”分割)")
|
||||
private String contactInfo;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "录像保存天数(可选)")
|
||||
private Integer recordSaveDays;
|
||||
|
||||
// 2022
|
||||
@MessageElement("DeviceID")
|
||||
@Schema(description = "国民经济行业分类代码(可选)")
|
||||
private String industrialClassification;
|
||||
|
||||
|
||||
/**
|
||||
* 云台类型描述字符串
|
||||
*/
|
||||
@Schema(description = "云台类型描述字符串")
|
||||
private String ptzTypeText;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 在线/离线
|
||||
* 1在线,0离线
|
||||
* 默认在线
|
||||
* 信令:
|
||||
* <Status>ON</Status>
|
||||
* <Status>OFF</Status>
|
||||
* 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF
|
||||
*/
|
||||
@Schema(description = "在线/离线, 1在线,0离线")
|
||||
private boolean status;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description = "经度")
|
||||
private double longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description = "纬度")
|
||||
private double latitude;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description = "自定义经度")
|
||||
private double customLongitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description = "自定义纬度")
|
||||
private double customLatitude;
|
||||
|
||||
/**
|
||||
* 经度 GCJ02
|
||||
*/
|
||||
@Schema(description = "GCJ02坐标系经度")
|
||||
private double longitudeGcj02;
|
||||
|
||||
/**
|
||||
* 纬度 GCJ02
|
||||
*/
|
||||
@Schema(description = "GCJ02坐标系纬度")
|
||||
private double latitudeGcj02;
|
||||
|
||||
/**
|
||||
* 经度 WGS84
|
||||
*/
|
||||
@Schema(description = "WGS84坐标系经度")
|
||||
private double longitudeWgs84;
|
||||
|
||||
/**
|
||||
* 纬度 WGS84
|
||||
*/
|
||||
@Schema(description = "WGS84坐标系纬度")
|
||||
private double latitudeWgs84;
|
||||
|
||||
/**
|
||||
* 子设备数
|
||||
*/
|
||||
@Schema(description = "子设备数")
|
||||
private int subCount;
|
||||
|
||||
/**
|
||||
* 流唯一编号,存在表示正在直播
|
||||
*/
|
||||
@Schema(description = "流唯一编号,存在表示正在直播")
|
||||
private String streamId;
|
||||
|
||||
/**
|
||||
* 是否含有音频
|
||||
*/
|
||||
@Schema(description = "是否含有音频")
|
||||
private Boolean hasAudio;
|
||||
|
||||
/**
|
||||
* 标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
|
||||
*/
|
||||
@Schema(description = "标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划")
|
||||
private int channelType;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
@Schema(description = "业务分组")
|
||||
private String businessGroupId;
|
||||
|
||||
/**
|
||||
* GPS的更新时间
|
||||
*/
|
||||
@Schema(description = "GPS的更新时间")
|
||||
private String gpsTime;
|
||||
|
||||
|
@ -262,22 +277,6 @@ public class DeviceChannel {
|
|||
"用于选择码流时组成码流标识。默认为null,不设置。可选值: stream/streamnumber/streamprofile/streamMode")
|
||||
private String streamIdentification;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public void setPtzType(int ptzType) {
|
||||
this.ptzType = ptzType;
|
||||
switch (ptzType) {
|
||||
|
@ -296,322 +295,15 @@ public class DeviceChannel {
|
|||
case 4:
|
||||
this.ptzTypeText = "遥控枪机";
|
||||
break;
|
||||
case 5:
|
||||
this.ptzTypeText = "遥控半球";
|
||||
break;
|
||||
case 6:
|
||||
this.ptzTypeText = "多目设备的全景/拼接通道";
|
||||
break;
|
||||
case 7:
|
||||
this.ptzTypeText = "多目设备的分割通道";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public String getChannelId() {
|
||||
return channelId;
|
||||
}
|
||||
|
||||
public void setChannelId(String channelId) {
|
||||
this.channelId = channelId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getManufacture() {
|
||||
return manufacture;
|
||||
}
|
||||
|
||||
public void setManufacture(String manufacture) {
|
||||
this.manufacture = manufacture;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public String getCivilCode() {
|
||||
return civilCode;
|
||||
}
|
||||
|
||||
public void setCivilCode(String civilCode) {
|
||||
this.civilCode = civilCode;
|
||||
}
|
||||
|
||||
public String getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
public void setBlock(String block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public int getParental() {
|
||||
return parental;
|
||||
}
|
||||
|
||||
public void setParental(int parental) {
|
||||
this.parental = parental;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public int getSafetyWay() {
|
||||
return safetyWay;
|
||||
}
|
||||
|
||||
public void setSafetyWay(int safetyWay) {
|
||||
this.safetyWay = safetyWay;
|
||||
}
|
||||
|
||||
public int getRegisterWay() {
|
||||
return registerWay;
|
||||
}
|
||||
|
||||
public void setRegisterWay(int registerWay) {
|
||||
this.registerWay = registerWay;
|
||||
}
|
||||
|
||||
public String getCertNum() {
|
||||
return certNum;
|
||||
}
|
||||
|
||||
public void setCertNum(String certNum) {
|
||||
this.certNum = certNum;
|
||||
}
|
||||
|
||||
public int getCertifiable() {
|
||||
return certifiable;
|
||||
}
|
||||
|
||||
public void setCertifiable(int certifiable) {
|
||||
this.certifiable = certifiable;
|
||||
}
|
||||
|
||||
public int getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
|
||||
public void setErrCode(int errCode) {
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getSecrecy() {
|
||||
return secrecy;
|
||||
}
|
||||
|
||||
public void setSecrecy(String secrecy) {
|
||||
this.secrecy = secrecy;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public int getPtzType() {
|
||||
return ptzType;
|
||||
}
|
||||
|
||||
public String getPtzTypeText() {
|
||||
return ptzTypeText;
|
||||
}
|
||||
|
||||
public void setPtzTypeText(String ptzTypeText) {
|
||||
this.ptzTypeText = ptzTypeText;
|
||||
}
|
||||
|
||||
public boolean isStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitudeGcj02() {
|
||||
return longitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLongitudeGcj02(double longitudeGcj02) {
|
||||
this.longitudeGcj02 = longitudeGcj02;
|
||||
}
|
||||
|
||||
public double getLatitudeGcj02() {
|
||||
return latitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLatitudeGcj02(double latitudeGcj02) {
|
||||
this.latitudeGcj02 = latitudeGcj02;
|
||||
}
|
||||
|
||||
public double getLongitudeWgs84() {
|
||||
return longitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLongitudeWgs84(double longitudeWgs84) {
|
||||
this.longitudeWgs84 = longitudeWgs84;
|
||||
}
|
||||
|
||||
public double getLatitudeWgs84() {
|
||||
return latitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLatitudeWgs84(double latitudeWgs84) {
|
||||
this.latitudeWgs84 = latitudeWgs84;
|
||||
}
|
||||
|
||||
public int getSubCount() {
|
||||
return subCount;
|
||||
}
|
||||
|
||||
public void setSubCount(int subCount) {
|
||||
this.subCount = subCount;
|
||||
}
|
||||
|
||||
public Boolean getHasAudio() {
|
||||
return hasAudio;
|
||||
}
|
||||
|
||||
public void setHasAudio(Boolean hasAudio) {
|
||||
this.hasAudio = hasAudio;
|
||||
}
|
||||
|
||||
public String getStreamId() {
|
||||
return streamId;
|
||||
}
|
||||
|
||||
public void setStreamId(String streamId) {
|
||||
this.streamId = streamId;
|
||||
}
|
||||
|
||||
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 int getChannelType() {
|
||||
return channelType;
|
||||
}
|
||||
|
||||
public void setChannelType(int channelType) {
|
||||
this.channelType = channelType;
|
||||
}
|
||||
|
||||
public String getBusinessGroupId() {
|
||||
return businessGroupId;
|
||||
}
|
||||
|
||||
public void setBusinessGroupId(String businessGroupId) {
|
||||
this.businessGroupId = businessGroupId;
|
||||
}
|
||||
|
||||
public String getGpsTime() {
|
||||
return gpsTime;
|
||||
}
|
||||
|
||||
public void setGpsTime(String gpsTime) {
|
||||
this.gpsTime = gpsTime;
|
||||
}
|
||||
|
||||
public String getStreamIdentification() {
|
||||
return streamIdentification;
|
||||
}
|
||||
|
||||
public void setStreamIdentification(String streamIdentification) {
|
||||
this.streamIdentification = streamIdentification;
|
||||
}
|
||||
|
||||
public double getCustomLongitude() {
|
||||
return customLongitude;
|
||||
}
|
||||
|
||||
public void setCustomLongitude(double customLongitude) {
|
||||
this.customLongitude = customLongitude;
|
||||
}
|
||||
|
||||
public double getCustomLatitude() {
|
||||
return customLatitude;
|
||||
}
|
||||
|
||||
public void setCustomLatitude(double customLatitude) {
|
||||
this.customLatitude = customLatitude;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.genersoft.iot.vmp.media.event.hook.Hook;
|
|||
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.IPlayService;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
|
@ -197,8 +197,8 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||
PlatformCatalog catalog = storager.getCatalog(requesterId, channelId);
|
||||
|
||||
MediaServer mediaServerItem = null;
|
||||
StreamPushItem streamPushItem = null;
|
||||
StreamProxyItem proxyByAppAndStream = null;
|
||||
StreamPush streamPushItem = null;
|
||||
StreamProxy proxyByAppAndStream = null;
|
||||
// 不是通道可能是直播流
|
||||
if (channel != null && gbStream == null) {
|
||||
// 通道存在,发100,TRYING
|
||||
|
@ -593,7 +593,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||
sendRtpItem.setPlayType(InviteStreamType.PUSH);
|
||||
if (streamPushItem != null) {
|
||||
// 从redis查询是否正在接收这个推流
|
||||
StreamPushItem pushListItem = redisCatchStorage.getPushListItem(gbStream.getApp(), gbStream.getStream());
|
||||
StreamPush pushListItem = redisCatchStorage.getPushListItem(gbStream.getApp(), gbStream.getStream());
|
||||
if (pushListItem != null) {
|
||||
sendRtpItem.setServerId(pushListItem.getServerId());
|
||||
sendRtpItem.setMediaServerId(pushListItem.getMediaServerId());
|
||||
|
|
|
@ -122,6 +122,8 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
|||
event = eventElement.getText().toUpperCase();
|
||||
}
|
||||
DeviceChannel channel = XmlUtil.channelContentHandler(itemDevice, device, event);
|
||||
|
||||
|
||||
if (channel == null) {
|
||||
logger.info("[收到目录订阅]:但是解析失败 {}", new String(evt.getRequest().getRawContent()));
|
||||
continue;
|
||||
|
@ -130,7 +132,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
|||
channel.setParentId(null);
|
||||
}
|
||||
channel.setDeviceId(device.getDeviceId());
|
||||
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getChannelId());
|
||||
logger.info("[收到目录订阅]:{}/{}", device.getDeviceId(), channel.getDeviceId());
|
||||
switch (event) {
|
||||
case CatalogEvent.ON:
|
||||
// 上线
|
||||
|
|
|
@ -241,6 +241,7 @@ public class XmlUtil {
|
|||
}
|
||||
|
||||
public static DeviceChannel channelContentHandler(Element itemDevice, Device device, String event){
|
||||
loadElement(itemDevice, DeviceChannel.class)
|
||||
DeviceChannel deviceChannel = new DeviceChannel();
|
||||
deviceChannel.setDeviceId(device.getDeviceId());
|
||||
Element channdelIdElement = itemDevice.element("DeviceID");
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "拉流代理的信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StreamProxy extends CommonGBChannel {
|
||||
|
||||
/**
|
||||
* 数据库自增ID
|
||||
*/
|
||||
@Schema(description = "数据库自增ID")
|
||||
private int id;
|
||||
|
||||
@Schema(description = "类型,取值,default: 流媒体直接拉流(默认),ffmpeg: ffmpeg实现拉流")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
private String app;
|
||||
|
||||
@Schema(description = "流ID")
|
||||
private String stream;
|
||||
|
||||
@Schema(description = "流媒体服务ID")
|
||||
private String mediaServerId;
|
||||
|
||||
@Schema(description = "拉流地址")
|
||||
private String srcUrl;
|
||||
|
||||
|
||||
@Schema(description = "超时时间")
|
||||
private int timeout;
|
||||
|
||||
@Schema(description = "ffmpeg模板KEY")
|
||||
private String ffmpegCmdKey;
|
||||
|
||||
@Schema(description = "rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播")
|
||||
private String rtspType;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private boolean enable;
|
||||
|
||||
@Schema(description = "是否启用音频")
|
||||
private boolean enableAudio;
|
||||
|
||||
@Schema(description = "是否启用MP4")
|
||||
private boolean enableMp4;
|
||||
|
||||
@Schema(description = "是否 无人观看时删除")
|
||||
private boolean enableRemoveNoneReader;
|
||||
|
||||
@Schema(description = "是否 无人观看时自动停用")
|
||||
private boolean enableDisableNoneReader;
|
||||
|
||||
@Schema(description = "拉流代理时zlm返回的key,用于停止拉流代理")
|
||||
private String streamKey;
|
||||
}
|
|
@ -1,180 +0,0 @@
|
|||
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @author lin
|
||||
*/
|
||||
@Schema(description = "拉流代理的信息")
|
||||
public class StreamProxyItem extends GbStream {
|
||||
|
||||
@Schema(description = "类型")
|
||||
private String type;
|
||||
@Schema(description = "应用名")
|
||||
private String app;
|
||||
@Schema(description = "流ID")
|
||||
private String stream;
|
||||
@Schema(description = "流媒体服务ID")
|
||||
private String mediaServerId;
|
||||
@Schema(description = "拉流地址")
|
||||
private String url;
|
||||
@Schema(description = "拉流地址")
|
||||
private String srcUrl;
|
||||
@Schema(description = "目标地址")
|
||||
private String dstUrl;
|
||||
@Schema(description = "超时时间")
|
||||
private int timeoutMs;
|
||||
@Schema(description = "ffmpeg模板KEY")
|
||||
private String ffmpegCmdKey;
|
||||
@Schema(description = "rtsp拉流时,拉流方式,0:tcp,1:udp,2:组播")
|
||||
private String rtpType;
|
||||
@Schema(description = "是否启用")
|
||||
private boolean enable;
|
||||
@Schema(description = "是否启用音频")
|
||||
private boolean enableAudio;
|
||||
@Schema(description = "是否启用MP4")
|
||||
private boolean enableMp4;
|
||||
@Schema(description = "是否 无人观看时删除")
|
||||
private boolean enableRemoveNoneReader;
|
||||
|
||||
@Schema(description = "是否 无人观看时自动停用")
|
||||
private boolean enableDisableNoneReader;
|
||||
|
||||
@Schema(description = "拉流代理时zlm返回的key,用于停止拉流代理")
|
||||
private String streamKey;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMediaServerId() {
|
||||
return mediaServerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMediaServerId(String mediaServerId) {
|
||||
this.mediaServerId = mediaServerId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getSrcUrl() {
|
||||
return srcUrl;
|
||||
}
|
||||
|
||||
public void setSrcUrl(String src_url) {
|
||||
this.srcUrl = src_url;
|
||||
}
|
||||
|
||||
public String getDstUrl() {
|
||||
return dstUrl;
|
||||
}
|
||||
|
||||
public void setDstUrl(String dst_url) {
|
||||
this.dstUrl = dst_url;
|
||||
}
|
||||
|
||||
public int getTimeoutMs() {
|
||||
return timeoutMs;
|
||||
}
|
||||
|
||||
public void setTimeoutMs(int timeout_ms) {
|
||||
this.timeoutMs = timeout_ms;
|
||||
}
|
||||
|
||||
public String getFfmpegCmdKey() {
|
||||
return ffmpegCmdKey;
|
||||
}
|
||||
|
||||
public void setFfmpegCmdKey(String ffmpeg_cmd_key) {
|
||||
this.ffmpegCmdKey = ffmpeg_cmd_key;
|
||||
}
|
||||
|
||||
public String getRtpType() {
|
||||
return rtpType;
|
||||
}
|
||||
|
||||
public void setRtpType(String rtp_type) {
|
||||
this.rtpType = rtp_type;
|
||||
}
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public boolean isEnableMp4() {
|
||||
return enableMp4;
|
||||
}
|
||||
|
||||
public void setEnableMp4(boolean enable_mp4) {
|
||||
this.enableMp4 = enable_mp4;
|
||||
}
|
||||
|
||||
public boolean isEnableRemoveNoneReader() {
|
||||
return enableRemoveNoneReader;
|
||||
}
|
||||
|
||||
public void setEnableRemoveNoneReader(boolean enable_remove_none_reader) {
|
||||
this.enableRemoveNoneReader = enable_remove_none_reader;
|
||||
}
|
||||
|
||||
public boolean isEnableDisableNoneReader() {
|
||||
return enableDisableNoneReader;
|
||||
}
|
||||
|
||||
public void setEnableDisableNoneReader(boolean enable_disable_none_reader) {
|
||||
this.enableDisableNoneReader = enable_disable_none_reader;
|
||||
}
|
||||
|
||||
public boolean isEnableAudio() {
|
||||
return enableAudio;
|
||||
}
|
||||
|
||||
public void setEnableAudio(boolean enable_audio) {
|
||||
this.enableAudio = enable_audio;
|
||||
}
|
||||
|
||||
public String getStreamKey() {
|
||||
return streamKey;
|
||||
}
|
||||
|
||||
public void setStreamKey(String streamKey) {
|
||||
this.streamKey = streamKey;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
@Schema(description = "推流信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class StreamPush extends CommonGBChannel implements Comparable<StreamPush>{
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(description = "id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
@Schema(description = "应用名")
|
||||
private String app;
|
||||
|
||||
/**
|
||||
* 流id
|
||||
*/
|
||||
@Schema(description = "流id")
|
||||
private String stream;
|
||||
|
||||
/**
|
||||
* 使用的流媒体ID
|
||||
*/
|
||||
@Schema(description = "使用的流媒体ID")
|
||||
private String mediaServerId;
|
||||
|
||||
/**
|
||||
* 使用的服务ID
|
||||
*/
|
||||
@Schema(description = "使用的服务ID")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 推流时间
|
||||
*/
|
||||
@Schema(description = "推流时间")
|
||||
private String pushTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 是否正在推流
|
||||
*/
|
||||
@Schema(description = "是否正在推流")
|
||||
private boolean pushIng;
|
||||
|
||||
/**
|
||||
* 是否自己平台的推流
|
||||
*/
|
||||
@Schema(description = "是否自己平台的推流")
|
||||
private boolean self;
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull StreamPush streamPushItem) {
|
||||
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)
|
||||
- DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(streamPushItem.getCreateTime())).intValue();
|
||||
}
|
||||
|
||||
public StreamPush getInstance(StreamInfo streamInfo) {
|
||||
StreamPush streamPushItem = new StreamPush();
|
||||
streamPushItem.setApp(streamInfo.getApp());
|
||||
streamPushItem.setMediaServerId(streamInfo.getMediaServerId());
|
||||
streamPushItem.setStream(streamInfo.getStream());
|
||||
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||
streamPushItem.setServerId(streamInfo.getMediaServerId());
|
||||
return streamPushItem;
|
||||
|
||||
}
|
||||
|
||||
public static StreamPush getInstance(MediaArrivalEvent event, String serverId){
|
||||
StreamPush streamPushItem = new StreamPush();
|
||||
streamPushItem.setApp(event.getApp());
|
||||
streamPushItem.setMediaServerId(event.getMediaServer().getId());
|
||||
streamPushItem.setStream(event.getStream());
|
||||
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||
streamPushItem.setServerId(serverId);
|
||||
return streamPushItem;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,432 +0,0 @@
|
|||
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "推流信息")
|
||||
public class StreamPushItem extends GbStream implements Comparable<StreamPushItem>{
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(description = "id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 应用名
|
||||
*/
|
||||
@Schema(description = "应用名")
|
||||
private String app;
|
||||
|
||||
/**
|
||||
* 流id
|
||||
*/
|
||||
@Schema(description = "流id")
|
||||
private String stream;
|
||||
|
||||
/**
|
||||
* 观看总人数,包括hls/rtsp/rtmp/http-flv/ws-flv
|
||||
*/
|
||||
@Schema(description = "观看总人数")
|
||||
private Integer totalReaderCount;
|
||||
|
||||
/**
|
||||
* 协议 包括hls/rtsp/rtmp/http-flv/ws-flv
|
||||
*/
|
||||
@Schema(description = "协议 包括hls/rtsp/rtmp/http-flv/ws-flv")
|
||||
private List<MediaSchema> schemas;
|
||||
|
||||
/**
|
||||
* 产生源类型,
|
||||
* unknown = 0,
|
||||
* rtmp_push=1,
|
||||
* rtsp_push=2,
|
||||
* rtp_push=3,
|
||||
* pull=4,
|
||||
* ffmpeg_pull=5,
|
||||
* mp4_vod=6,
|
||||
* device_chn=7
|
||||
*/
|
||||
@Schema(description = "产生源类型")
|
||||
private int originType;
|
||||
|
||||
/**
|
||||
* 客户端和服务器网络信息,可能为null类型
|
||||
*/
|
||||
@Schema(description = "客户端和服务器网络信息,可能为null类型")
|
||||
private OnStreamChangedHookParam.OriginSock originSock;
|
||||
|
||||
/**
|
||||
* 产生源类型的字符串描述
|
||||
*/
|
||||
@Schema(description = "产生源类型的字符串描述")
|
||||
private String originTypeStr;
|
||||
|
||||
/**
|
||||
* 产生源的url
|
||||
*/
|
||||
@Schema(description = "产生源的url")
|
||||
private String originUrl;
|
||||
|
||||
/**
|
||||
* 存活时间,单位秒
|
||||
*/
|
||||
@Schema(description = "存活时间,单位秒")
|
||||
private Long aliveSecond;
|
||||
|
||||
/**
|
||||
* 音视频轨道
|
||||
*/
|
||||
@Schema(description = "音视频轨道")
|
||||
private List<OnStreamChangedHookParam.MediaTrack> tracks;
|
||||
|
||||
/**
|
||||
* 音视频轨道
|
||||
*/
|
||||
@Schema(description = "音视频轨道")
|
||||
private String vhost;
|
||||
|
||||
/**
|
||||
* 使用的流媒体ID
|
||||
*/
|
||||
@Schema(description = "使用的流媒体ID")
|
||||
private String mediaServerId;
|
||||
|
||||
/**
|
||||
* 使用的服务ID
|
||||
*/
|
||||
@Schema(description = "使用的服务ID")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 推流时间
|
||||
*/
|
||||
@Schema(description = "推流时间")
|
||||
private String pushTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 是否正在推流
|
||||
*/
|
||||
@Schema(description = "是否正在推流")
|
||||
private boolean pushIng;
|
||||
|
||||
/**
|
||||
* 是否自己平台的推流
|
||||
*/
|
||||
@Schema(description = "是否自己平台的推流")
|
||||
private boolean self;
|
||||
|
||||
|
||||
|
||||
public String getVhost() {
|
||||
return vhost;
|
||||
}
|
||||
|
||||
public void setVhost(String vhost) {
|
||||
this.vhost = vhost;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull StreamPushItem streamPushItem) {
|
||||
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(super.createTime)
|
||||
- DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(streamPushItem.getCreateTime())).intValue();
|
||||
}
|
||||
|
||||
public StreamPushItem getInstance(StreamInfo streamInfo) {
|
||||
StreamPushItem streamPushItem = new StreamPushItem();
|
||||
streamPushItem.setApp(streamInfo.getApp());
|
||||
streamPushItem.setMediaServerId(streamInfo.getMediaServerId());
|
||||
streamPushItem.setStream(streamInfo.getStream());
|
||||
streamPushItem.setAliveSecond(streamInfo.getMediaInfo().getAliveSecond());
|
||||
// streamPushItem.setOriginSock(streamInfo.getMediaInfo().getOriginSock());
|
||||
streamPushItem.setTotalReaderCount(streamInfo.getMediaInfo().getReaderCount());
|
||||
streamPushItem.setOriginType(streamInfo.getOriginType());
|
||||
// streamPushItem.setOriginTypeStr(streamInfo.getMediaInfo().getOriginTypeStr());
|
||||
// streamPushItem.setOriginUrl(streamInfo.getMediaInfo().getOriginUrl());
|
||||
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||
streamPushItem.setAliveSecond(streamInfo.getMediaInfo().getAliveSecond());
|
||||
streamPushItem.setStatus(true);
|
||||
streamPushItem.setStreamType("push");
|
||||
// streamPushItem.setVhost(streamInfo.getVhost());
|
||||
streamPushItem.setServerId(streamInfo.getMediaServerId());
|
||||
return streamPushItem;
|
||||
|
||||
}
|
||||
|
||||
public static StreamPushItem getInstance(MediaArrivalEvent event, String serverId){
|
||||
StreamPushItem streamPushItem = new StreamPushItem();
|
||||
streamPushItem.setApp(event.getApp());
|
||||
streamPushItem.setMediaServerId(event.getMediaServer().getId());
|
||||
streamPushItem.setStream(event.getStream());
|
||||
streamPushItem.setAliveSecond(event.getMediaInfo().getAliveSecond());
|
||||
// streamPushItem.setOriginSock(streamInfo.getMediaInfo().getOriginSock());
|
||||
streamPushItem.setTotalReaderCount(event.getMediaInfo().getReaderCount());
|
||||
streamPushItem.setOriginType(event.getMediaInfo().getOriginType());
|
||||
// streamPushItem.setOriginTypeStr(streamInfo.getMediaInfo().getOriginTypeStr());
|
||||
// streamPushItem.setOriginUrl(streamInfo.getMediaInfo().getOriginUrl());
|
||||
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||
streamPushItem.setAliveSecond(event.getMediaInfo().getAliveSecond());
|
||||
streamPushItem.setStatus(true);
|
||||
streamPushItem.setStreamType("push");
|
||||
// streamPushItem.setVhost(streamInfo.getVhost());
|
||||
streamPushItem.setServerId(serverId);
|
||||
return streamPushItem;
|
||||
}
|
||||
|
||||
public static class MediaSchema {
|
||||
private String schema;
|
||||
private Long bytesSpeed;
|
||||
|
||||
public String getSchema() {
|
||||
return schema;
|
||||
}
|
||||
|
||||
public void setSchema(String schema) {
|
||||
this.schema = schema;
|
||||
}
|
||||
|
||||
public Long getBytesSpeed() {
|
||||
return bytesSpeed;
|
||||
}
|
||||
|
||||
public void setBytesSpeed(Long bytesSpeed) {
|
||||
this.bytesSpeed = bytesSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApp(String app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStream() {
|
||||
return stream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStream(String stream) {
|
||||
this.stream = stream;
|
||||
}
|
||||
|
||||
public Integer getTotalReaderCount() {
|
||||
return totalReaderCount;
|
||||
}
|
||||
|
||||
public void setTotalReaderCount(Integer totalReaderCount) {
|
||||
this.totalReaderCount = totalReaderCount;
|
||||
}
|
||||
|
||||
public List<MediaSchema> getSchemas() {
|
||||
return schemas;
|
||||
}
|
||||
|
||||
public void setSchemas(List<MediaSchema> schemas) {
|
||||
this.schemas = schemas;
|
||||
}
|
||||
|
||||
public int getOriginType() {
|
||||
return originType;
|
||||
}
|
||||
|
||||
public void setOriginType(int originType) {
|
||||
this.originType = originType;
|
||||
}
|
||||
|
||||
public OnStreamChangedHookParam.OriginSock getOriginSock() {
|
||||
return originSock;
|
||||
}
|
||||
|
||||
public void setOriginSock(OnStreamChangedHookParam.OriginSock originSock) {
|
||||
this.originSock = originSock;
|
||||
}
|
||||
|
||||
|
||||
public String getOriginTypeStr() {
|
||||
return originTypeStr;
|
||||
}
|
||||
|
||||
public void setOriginTypeStr(String originTypeStr) {
|
||||
this.originTypeStr = originTypeStr;
|
||||
}
|
||||
|
||||
public String getOriginUrl() {
|
||||
return originUrl;
|
||||
}
|
||||
|
||||
public void setOriginUrl(String originUrl) {
|
||||
this.originUrl = originUrl;
|
||||
}
|
||||
|
||||
public Long getAliveSecond() {
|
||||
return aliveSecond;
|
||||
}
|
||||
|
||||
public void setAliveSecond(Long aliveSecond) {
|
||||
this.aliveSecond = aliveSecond;
|
||||
}
|
||||
|
||||
public List<OnStreamChangedHookParam.MediaTrack> getTracks() {
|
||||
return tracks;
|
||||
}
|
||||
|
||||
public void setTracks(List<OnStreamChangedHookParam.MediaTrack> tracks) {
|
||||
this.tracks = tracks;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMediaServerId() {
|
||||
return mediaServerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMediaServerId(String mediaServerId) {
|
||||
this.mediaServerId = mediaServerId;
|
||||
}
|
||||
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(String serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
|
||||
public String getPushTime() {
|
||||
return pushTime;
|
||||
}
|
||||
|
||||
public void setPushTime(String pushTime) {
|
||||
this.pushTime = pushTime;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public boolean isPushIng() {
|
||||
return pushIng;
|
||||
}
|
||||
|
||||
public void setPushIng(boolean pushIng) {
|
||||
this.pushIng = pushIng;
|
||||
}
|
||||
|
||||
public boolean isSelf() {
|
||||
return self;
|
||||
}
|
||||
|
||||
public void setSelf(boolean self) {
|
||||
this.self = self;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Integer getGbStreamId() {
|
||||
// return super.getGbStreamId();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setGbStreamId(Integer gbStreamId) {
|
||||
// super.setGbStreamId(gbStreamId);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public String getGbId() {
|
||||
// return super.getGbId();
|
||||
// }
|
||||
//
|
||||
// public void setGbId(String gbId) {
|
||||
// super.setGbId(gbId);
|
||||
// }
|
||||
//
|
||||
// public String getName() {
|
||||
// return super.getName();
|
||||
// }
|
||||
//
|
||||
// public void setName(String name) {
|
||||
// super.setName(name);
|
||||
// }
|
||||
//
|
||||
// public double getLongitude() {
|
||||
// return super.getLongitude();
|
||||
// }
|
||||
//
|
||||
// public void setLongitude(double longitude) {
|
||||
// super.setLongitude(longitude);
|
||||
// }
|
||||
//
|
||||
// public double getLatitude() {
|
||||
// return super.getLatitude();
|
||||
// }
|
||||
//
|
||||
// public void setLatitude(double latitude) {
|
||||
// super.setLatitude(latitude);
|
||||
// }
|
||||
//
|
||||
// public String getStreamType() {
|
||||
// return super.getStreamType();
|
||||
// }
|
||||
//
|
||||
// public void setStreamType(String streamType) {
|
||||
// super.setStreamType(streamType);
|
||||
// }
|
||||
//
|
||||
// public boolean isStatus() {
|
||||
// return super.isStatus();
|
||||
// }
|
||||
//
|
||||
// public void setStatus(boolean status) {
|
||||
// super.setStatus(status);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -53,7 +53,7 @@ public interface IGbStreamService {
|
|||
* @param streamPushItemForUpdate
|
||||
* @return
|
||||
*/
|
||||
int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate);
|
||||
int updateGbIdOrName(List<StreamPush> streamPushItemForUpdate);
|
||||
|
||||
DeviceChannel getDeviceChannelListByStreamWithStatus(GbStream gbStream, String catalogId, ParentPlatform platform);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service;
|
|||
import com.genersoft.iot.vmp.common.GeneralCallback;
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
@ -16,7 +16,7 @@ public interface IStreamProxyService {
|
|||
* 保存视频代理
|
||||
* @param param
|
||||
*/
|
||||
void save(StreamProxyItem param, GeneralCallback<StreamInfo> callback);
|
||||
void save(StreamProxy param, GeneralCallback<StreamInfo> callback);
|
||||
|
||||
/**
|
||||
* 添加视频代理到zlm
|
||||
|
@ -24,7 +24,7 @@ public interface IStreamProxyService {
|
|||
* @param param
|
||||
* @return
|
||||
*/
|
||||
WVPResult<String> addStreamProxyToZlm(StreamProxyItem param);
|
||||
WVPResult<String> addStreamProxyToZlm(StreamProxy param);
|
||||
|
||||
/**
|
||||
* 从zlm移除视频代理
|
||||
|
@ -32,7 +32,7 @@ public interface IStreamProxyService {
|
|||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Boolean removeStreamProxyFromZlm(StreamProxyItem param);
|
||||
Boolean removeStreamProxyFromZlm(StreamProxy param);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
@ -40,7 +40,7 @@ public interface IStreamProxyService {
|
|||
* @param count
|
||||
* @return
|
||||
*/
|
||||
PageInfo<StreamProxyItem> getAll(Integer page, Integer count);
|
||||
PageInfo<StreamProxy> getAll(Integer page, Integer count);
|
||||
|
||||
/**
|
||||
* 删除视频代理
|
||||
|
@ -86,7 +86,7 @@ public interface IStreamProxyService {
|
|||
* 根据app与stream获取streamProxy
|
||||
* @return
|
||||
*/
|
||||
StreamProxyItem getStreamProxyByAppAndStream(String app, String streamId);
|
||||
StreamProxy getStreamProxyByAppAndStream(String app, String streamId);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -108,7 +108,7 @@ public interface IStreamProxyService {
|
|||
/**
|
||||
* 更新代理流
|
||||
*/
|
||||
boolean updateStreamProxy(StreamProxyItem streamProxyItem);
|
||||
boolean updateStreamProxy(StreamProxy streamProxyItem);
|
||||
|
||||
/**
|
||||
* 获取统计信息
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.genersoft.iot.vmp.service;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
|
||||
import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||
|
@ -32,13 +32,13 @@ public interface IStreamPushService {
|
|||
/**
|
||||
* 获取
|
||||
*/
|
||||
PageInfo<StreamPushItem> getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId);
|
||||
PageInfo<StreamPush> getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId);
|
||||
|
||||
List<StreamPushItem> getPushList(String mediaSererId);
|
||||
List<StreamPush> getPushList(String mediaSererId);
|
||||
|
||||
StreamPushItem transform(OnStreamChangedHookParam item);
|
||||
StreamPush transform(OnStreamChangedHookParam item);
|
||||
|
||||
StreamPushItem getPush(String app, String streamId);
|
||||
StreamPush getPush(String app, String streamId);
|
||||
|
||||
/**
|
||||
* 停止一路推流
|
||||
|
@ -68,7 +68,7 @@ public interface IStreamPushService {
|
|||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
void batchAdd(List<StreamPushItem> streamPushExcelDtoList);
|
||||
void batchAdd(List<StreamPush> streamPushExcelDtoList);
|
||||
|
||||
/**
|
||||
* 中止多个推流
|
||||
|
@ -78,7 +78,7 @@ public interface IStreamPushService {
|
|||
/**
|
||||
* 导入时批量增加
|
||||
*/
|
||||
void batchAddForUpload(List<StreamPushItem> streamPushItems, Map<String, List<String[]>> streamPushItemsForAll);
|
||||
void batchAddForUpload(List<StreamPush> streamPushItems, Map<String, List<String[]>> streamPushItemsForAll);
|
||||
|
||||
/**
|
||||
* 全部离线
|
||||
|
@ -98,7 +98,7 @@ public interface IStreamPushService {
|
|||
/**
|
||||
* 增加推流
|
||||
*/
|
||||
boolean add(StreamPushItem stream);
|
||||
boolean add(StreamPush stream);
|
||||
|
||||
/**
|
||||
* 获取全部的app+Streanm 用于判断推流列表是新增还是修改
|
||||
|
@ -112,7 +112,7 @@ public interface IStreamPushService {
|
|||
*/
|
||||
ResourceBaseInfo getOverview();
|
||||
|
||||
Map<String, StreamPushItem> getAllAppAndStreamMap();
|
||||
Map<String, StreamPush> getAllAppAndStreamMap();
|
||||
|
||||
|
||||
void updatePush(OnStreamChangedHookParam param);
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.service.impl;
|
|||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.service.IDeviceAlarmService;
|
||||
import com.genersoft.iot.vmp.storager.dao.DeviceAlarmMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
import com.genersoft.iot.vmp.storager.dao.GbStreamMapper;
|
||||
import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper;
|
||||
|
@ -194,7 +194,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate) {
|
||||
public int updateGbIdOrName(List<StreamPush> streamPushItemForUpdate) {
|
||||
return gbStreamMapper.updateGbIdOrName(streamPushItemForUpdate);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
|||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.service.*;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
|
@ -91,7 +91,7 @@ public class MediaServiceImpl implements IMediaService {
|
|||
public ResultForOnPublish authenticatePublish(MediaServer mediaServer, String app, String stream, String params) {
|
||||
// 推流鉴权的处理
|
||||
if (!"rtp".equals(app)) {
|
||||
StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||
StreamProxy streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||
if (streamProxyItem != null) {
|
||||
ResultForOnPublish result = new ResultForOnPublish();
|
||||
result.setEnable_audio(streamProxyItem.isEnableAudio());
|
||||
|
@ -277,7 +277,7 @@ public class MediaServiceImpl implements IMediaService {
|
|||
} else {
|
||||
// 非国标流 推流/拉流代理
|
||||
// 拉流代理
|
||||
StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||
StreamProxy streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||
if (streamProxyItem != null) {
|
||||
if (streamProxyItem.isEnableRemoveNoneReader()) {
|
||||
// 无人观看自动移除
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.genersoft.iot.vmp.common.StreamInfo;
|
|||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
|
@ -18,7 +17,7 @@ import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
|||
import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent;
|
||||
import com.genersoft.iot.vmp.media.event.media.MediaNotFoundEvent;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
|
@ -131,7 +130,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
return;
|
||||
}
|
||||
// 拉流代理
|
||||
StreamProxyItem streamProxyByAppAndStream = getStreamProxyByAppAndStream(event.getApp(), event.getStream());
|
||||
StreamProxy streamProxyByAppAndStream = getStreamProxyByAppAndStream(event.getApp(), event.getStream());
|
||||
if (streamProxyByAppAndStream != null && streamProxyByAppAndStream.isEnableDisableNoneReader()) {
|
||||
start(event.getApp(), event.getStream());
|
||||
}
|
||||
|
@ -139,7 +138,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
|
||||
|
||||
@Override
|
||||
public void save(StreamProxyItem param, GeneralCallback<StreamInfo> callback) {
|
||||
public void save(StreamProxy param, GeneralCallback<StreamInfo> callback) {
|
||||
MediaServer mediaServer;
|
||||
if (ObjectUtils.isEmpty(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
|
||||
mediaServer = mediaServerService.getMediaServerForMinimumLoad(null);
|
||||
|
@ -266,7 +265,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
* @param streamProxyItem
|
||||
* @return
|
||||
*/
|
||||
private boolean addStreamProxy(StreamProxyItem streamProxyItem) {
|
||||
private boolean addStreamProxy(StreamProxy streamProxyItem) {
|
||||
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
|
||||
boolean result = false;
|
||||
streamProxyItem.setStreamType("proxy");
|
||||
|
@ -304,7 +303,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean updateStreamProxy(StreamProxyItem streamProxyItem) {
|
||||
public boolean updateStreamProxy(StreamProxy streamProxyItem) {
|
||||
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
|
||||
boolean result = false;
|
||||
streamProxyItem.setStreamType("proxy");
|
||||
|
@ -333,7 +332,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public WVPResult<String> addStreamProxyToZlm(StreamProxyItem param) {
|
||||
public WVPResult<String> addStreamProxyToZlm(StreamProxy param) {
|
||||
WVPResult<String> result = null;
|
||||
MediaServer mediaServer = null;
|
||||
if (param.getMediaServerId() == null) {
|
||||
|
@ -373,7 +372,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeStreamProxyFromZlm(StreamProxyItem param) {
|
||||
public Boolean removeStreamProxyFromZlm(StreamProxy param) {
|
||||
if (param ==null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -395,13 +394,13 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<StreamProxyItem> getAll(Integer page, Integer count) {
|
||||
public PageInfo<StreamProxy> getAll(Integer page, Integer count) {
|
||||
return videoManagerStorager.queryStreamProxyList(page, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(String app, String stream) {
|
||||
StreamProxyItem streamProxyItem = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
StreamProxy streamProxyItem = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
if (streamProxyItem != null) {
|
||||
gbStreamService.sendCatalogMsg(streamProxyItem, CatalogEvent.DEL);
|
||||
|
||||
|
@ -423,7 +422,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
@Override
|
||||
public boolean start(String app, String stream) {
|
||||
boolean result = false;
|
||||
StreamProxyItem streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
StreamProxy streamProxy = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
if (streamProxy != null && !streamProxy.isEnable() ) {
|
||||
WVPResult<String> wvpResult = addStreamProxyToZlm(streamProxy);
|
||||
if (wvpResult == null) {
|
||||
|
@ -446,7 +445,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
@Override
|
||||
public boolean stop(String app, String stream) {
|
||||
boolean result = false;
|
||||
StreamProxyItem streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
StreamProxy streamProxyDto = videoManagerStorager.queryStreamProxy(app, stream);
|
||||
if (streamProxyDto != null && streamProxyDto.isEnable()) {
|
||||
Boolean removed = removeStreamProxyFromZlm(streamProxyDto);
|
||||
if (removed != null && removed) {
|
||||
|
@ -464,14 +463,14 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
|
||||
|
||||
@Override
|
||||
public StreamProxyItem getStreamProxyByAppAndStream(String app, String streamId) {
|
||||
public StreamProxy getStreamProxyByAppAndStream(String app, String streamId) {
|
||||
return videoManagerStorager.getStreamProxyByAppAndStream(app, streamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void zlmServerOnline(String mediaServerId) {
|
||||
// 移除开启了无人观看自动移除的流
|
||||
List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
|
||||
List<StreamProxy> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
|
||||
if (streamProxyItemList.size() > 0) {
|
||||
gbStreamMapper.batchDel(streamProxyItemList);
|
||||
}
|
||||
|
@ -481,9 +480,9 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
syncPullStream(mediaServerId);
|
||||
|
||||
// 恢复流代理, 只查找这个这个流媒体
|
||||
List<StreamProxyItem> streamProxyListForEnable = storager.getStreamProxyListForEnableInMediaServer(
|
||||
List<StreamProxy> streamProxyListForEnable = storager.getStreamProxyListForEnableInMediaServer(
|
||||
mediaServerId, true);
|
||||
for (StreamProxyItem streamProxyDto : streamProxyListForEnable) {
|
||||
for (StreamProxy streamProxyDto : streamProxyListForEnable) {
|
||||
logger.info("恢复流代理," + streamProxyDto.getApp() + "/" + streamProxyDto.getStream());
|
||||
WVPResult<String> wvpResult = addStreamProxyToZlm(streamProxyDto);
|
||||
if (wvpResult == null) {
|
||||
|
@ -499,7 +498,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
@Override
|
||||
public void zlmServerOffline(String mediaServerId) {
|
||||
// 移除开启了无人观看自动移除的流
|
||||
List<StreamProxyItem> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
|
||||
List<StreamProxy> streamProxyItemList = streamProxyMapper.selectAutoRemoveItemByMediaServerId(mediaServerId);
|
||||
if (streamProxyItemList.size() > 0) {
|
||||
gbStreamMapper.batchDel(streamProxyItemList);
|
||||
}
|
||||
|
@ -533,7 +532,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
@Override
|
||||
public int updateStatus(boolean status, String app, String stream) {
|
||||
// 状态变化时推送到国标上级
|
||||
StreamProxyItem streamProxyItem = streamProxyMapper.selectOne(app, stream);
|
||||
StreamProxy streamProxyItem = streamProxyMapper.selectOne(app, stream);
|
||||
if (streamProxyItem == null) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -592,13 +591,13 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
|||
|
||||
Map<String, MediaServer> serverItemMap = all.stream().collect(Collectors.toMap(MediaServer::getId, Function.identity(), (m1, m2) -> m1));
|
||||
|
||||
List<StreamProxyItem> list = videoManagerStorager.getStreamProxyListForEnable(true);
|
||||
List<StreamProxy> list = videoManagerStorager.getStreamProxyListForEnable(true);
|
||||
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return;
|
||||
}
|
||||
|
||||
for (StreamProxyItem streamProxyItem : list) {
|
||||
for (StreamProxy streamProxyItem : list) {
|
||||
|
||||
MediaServer mediaServerItem = serverItemMap.get(streamProxyItem.getMediaServerId());
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent;
|
|||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.hook.OriginType;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
|
@ -113,12 +113,12 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
streamAuthorityInfo.setOriginType(mediaInfo.getOriginType());
|
||||
}
|
||||
redisCatchStorage.updateStreamAuthorityInfo(event.getApp(), event.getStream(), streamAuthorityInfo);
|
||||
StreamPushItem transform = StreamPushItem.getInstance(event, userSetting.getServerId());
|
||||
StreamPush transform = StreamPush.getInstance(event, userSetting.getServerId());
|
||||
transform.setPushIng(true);
|
||||
transform.setUpdateTime(DateUtil.getNow());
|
||||
transform.setPushTime(DateUtil.getNow());
|
||||
transform.setSelf(true);
|
||||
StreamPushItem pushInDb = getPush(event.getApp(), event.getStream());
|
||||
StreamPush pushInDb = getPush(event.getApp(), event.getStream());
|
||||
if (pushInDb == null) {
|
||||
transform.setCreateTime(DateUtil.getNow());
|
||||
streamPushMapper.add(transform);
|
||||
|
@ -188,18 +188,18 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
|
||||
private List<StreamPushItem> handleJSON(List<StreamInfo> streamInfoList) {
|
||||
private List<StreamPush> handleJSON(List<StreamInfo> streamInfoList) {
|
||||
if (streamInfoList == null || streamInfoList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Map<String, StreamPushItem> result = new HashMap<>();
|
||||
Map<String, StreamPush> result = new HashMap<>();
|
||||
for (StreamInfo streamInfo : streamInfoList) {
|
||||
// 不保存国标推理以及拉流代理的流
|
||||
if (streamInfo.getOriginType() == OriginType.RTSP_PUSH.ordinal()
|
||||
|| streamInfo.getOriginType() == OriginType.RTMP_PUSH.ordinal()
|
||||
|| streamInfo.getOriginType() == OriginType.RTC_PUSH.ordinal() ) {
|
||||
String key = streamInfo.getApp() + "_" + streamInfo.getStream();
|
||||
StreamPushItem streamPushItem = result.get(key);
|
||||
StreamPush streamPushItem = result.get(key);
|
||||
if (streamPushItem == null) {
|
||||
streamPushItem = streamPushItem.getInstance(streamInfo);
|
||||
result.put(key, streamPushItem);
|
||||
|
@ -210,35 +210,26 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public StreamPushItem transform(OnStreamChangedHookParam item) {
|
||||
StreamPushItem streamPushItem = new StreamPushItem();
|
||||
public StreamPush transform(OnStreamChangedHookParam item) {
|
||||
StreamPush streamPushItem = new StreamPush();
|
||||
streamPushItem.setApp(item.getApp());
|
||||
streamPushItem.setMediaServerId(item.getMediaServerId());
|
||||
streamPushItem.setStream(item.getStream());
|
||||
streamPushItem.setAliveSecond(item.getAliveSecond());
|
||||
streamPushItem.setOriginSock(item.getOriginSock());
|
||||
streamPushItem.setTotalReaderCount(item.getTotalReaderCount());
|
||||
streamPushItem.setOriginType(item.getOriginType());
|
||||
streamPushItem.setOriginTypeStr(item.getOriginTypeStr());
|
||||
streamPushItem.setOriginUrl(item.getOriginUrl());
|
||||
streamPushItem.setCreateTime(DateUtil.getNow());
|
||||
streamPushItem.setAliveSecond(item.getAliveSecond());
|
||||
streamPushItem.setStatus(true);
|
||||
streamPushItem.setStreamType("push");
|
||||
streamPushItem.setVhost(item.getVhost());
|
||||
streamPushItem.setServerId(item.getSeverId());
|
||||
return streamPushItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<StreamPushItem> getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId) {
|
||||
public PageInfo<StreamPush> getPushList(Integer page, Integer count, String query, Boolean pushing, String mediaServerId) {
|
||||
PageHelper.startPage(page, count);
|
||||
List<StreamPushItem> all = streamPushMapper.selectAllForList(query, pushing, mediaServerId);
|
||||
List<StreamPush> all = streamPushMapper.selectAllForList(query, pushing, mediaServerId);
|
||||
return new PageInfo<>(all);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StreamPushItem> getPushList(String mediaServerId) {
|
||||
public List<StreamPush> getPushList(String mediaServerId) {
|
||||
return streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId);
|
||||
}
|
||||
|
||||
|
@ -269,14 +260,14 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
|
||||
|
||||
@Override
|
||||
public StreamPushItem getPush(String app, String streamId) {
|
||||
public StreamPush getPush(String app, String streamId) {
|
||||
return streamPushMapper.selectOne(app, streamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stop(String app, String stream) {
|
||||
logger.info("[推流 ] 停止流: {}/{}", app, stream);
|
||||
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, stream);
|
||||
StreamPush streamPushItem = streamPushMapper.selectOne(app, stream);
|
||||
if (streamPushItem != null) {
|
||||
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);
|
||||
}
|
||||
|
@ -299,13 +290,13 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
return;
|
||||
}
|
||||
// 数据库记录
|
||||
List<StreamPushItem> pushList = getPushList(mediaServerId);
|
||||
Map<String, StreamPushItem> pushItemMap = new HashMap<>();
|
||||
List<StreamPush> pushList = getPushList(mediaServerId);
|
||||
Map<String, StreamPush> pushItemMap = new HashMap<>();
|
||||
// redis记录
|
||||
List<MediaInfo> mediaInfoList = redisCatchStorage.getStreams(mediaServerId, "PUSH");
|
||||
Map<String, MediaInfo> streamInfoPushItemMap = new HashMap<>();
|
||||
if (pushList.size() > 0) {
|
||||
for (StreamPushItem streamPushItem : pushList) {
|
||||
for (StreamPush streamPushItem : pushList) {
|
||||
if (ObjectUtils.isEmpty(streamPushItem.getGbId())) {
|
||||
pushItemMap.put(streamPushItem.getApp() + streamPushItem.getStream(), streamPushItem);
|
||||
}
|
||||
|
@ -326,15 +317,15 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
if (mediaList == null) {
|
||||
return;
|
||||
}
|
||||
List<StreamPushItem> streamPushItems = handleJSON(mediaList);
|
||||
List<StreamPush> streamPushItems = handleJSON(mediaList);
|
||||
if (streamPushItems != null) {
|
||||
for (StreamPushItem streamPushItem : streamPushItems) {
|
||||
for (StreamPush streamPushItem : streamPushItems) {
|
||||
pushItemMap.remove(streamPushItem.getApp() + streamPushItem.getStream());
|
||||
streamInfoPushItemMap.remove(streamPushItem.getApp() + streamPushItem.getStream());
|
||||
streamAuthorityInfoInfoMap.remove(streamPushItem.getApp() + streamPushItem.getStream());
|
||||
}
|
||||
}
|
||||
List<StreamPushItem> offlinePushItems = new ArrayList<>(pushItemMap.values());
|
||||
List<StreamPush> offlinePushItems = new ArrayList<>(pushItemMap.values());
|
||||
if (offlinePushItems.size() > 0) {
|
||||
String type = "PUSH";
|
||||
int runLimit = 300;
|
||||
|
@ -344,7 +335,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
if (i + runLimit > offlinePushItems.size()) {
|
||||
toIndex = offlinePushItems.size();
|
||||
}
|
||||
List<StreamPushItem> streamPushItemsSub = offlinePushItems.subList(i, toIndex);
|
||||
List<StreamPush> streamPushItemsSub = offlinePushItems.subList(i, toIndex);
|
||||
streamPushMapper.delAll(streamPushItemsSub);
|
||||
}
|
||||
}else {
|
||||
|
@ -381,7 +372,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
|
||||
@Override
|
||||
public void zlmServerOffline(String mediaServerId) {
|
||||
List<StreamPushItem> streamPushItems = streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId);
|
||||
List<StreamPush> streamPushItems = streamPushMapper.selectAllByMediaServerIdWithOutGbID(mediaServerId);
|
||||
// 移除没有GBId的推流
|
||||
streamPushMapper.deleteWithoutGBId(mediaServerId);
|
||||
gbStreamMapper.deleteWithoutGBId("push", mediaServerId);
|
||||
|
@ -417,9 +408,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
|
||||
@Override
|
||||
public boolean saveToRandomGB() {
|
||||
List<StreamPushItem> streamPushItems = streamPushMapper.selectAll();
|
||||
List<StreamPush> streamPushItems = streamPushMapper.selectAll();
|
||||
long gbId = 100001;
|
||||
for (StreamPushItem streamPushItem : streamPushItems) {
|
||||
for (StreamPush streamPushItem : streamPushItems) {
|
||||
streamPushItem.setStreamType("push");
|
||||
streamPushItem.setStatus(true);
|
||||
streamPushItem.setGbId("34020000004111" + gbId);
|
||||
|
@ -443,17 +434,17 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void batchAdd(List<StreamPushItem> streamPushItems) {
|
||||
public void batchAdd(List<StreamPush> streamPushItems) {
|
||||
streamPushMapper.addAll(streamPushItems);
|
||||
gbStreamMapper.batchAdd(streamPushItems);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void batchAddForUpload(List<StreamPushItem> streamPushItems, Map<String, List<String[]>> streamPushItemsForAll ) {
|
||||
public void batchAddForUpload(List<StreamPush> streamPushItems, Map<String, List<String[]>> streamPushItemsForAll ) {
|
||||
// 存储数据到stream_push表
|
||||
streamPushMapper.addAll(streamPushItems);
|
||||
List<StreamPushItem> streamPushItemForGbStream = streamPushItems.stream()
|
||||
List<StreamPush> streamPushItemForGbStream = streamPushItems.stream()
|
||||
.filter(streamPushItem-> streamPushItem.getGbId() != null)
|
||||
.collect(Collectors.toList());
|
||||
// 存储数据到gb_stream表, id会返回到streamPushItemForGbStream里
|
||||
|
@ -461,7 +452,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
gbStreamMapper.batchAdd(streamPushItemForGbStream);
|
||||
}
|
||||
// 去除没有ID也就是没有存储到数据库的数据
|
||||
List<StreamPushItem> streamPushItemsForPlatform = streamPushItemForGbStream.stream()
|
||||
List<StreamPush> streamPushItemsForPlatform = streamPushItemForGbStream.stream()
|
||||
.filter(streamPushItem-> streamPushItem.getGbStreamId() != null)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
@ -489,14 +480,14 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
platformInfoMap.put(platform.getServerGBId(), catalogMap);
|
||||
}
|
||||
List<StreamPushItem> streamPushItemListFroPlatform = new ArrayList<>();
|
||||
List<StreamPush> streamPushItemListFroPlatform = new ArrayList<>();
|
||||
Map<String, List<GbStream>> platformForEvent = new HashMap<>();
|
||||
// 遍历存储结果,查找app+Stream->platformId+catalogId的对应关系,然后执行批量写入
|
||||
for (StreamPushItem streamPushItem : streamPushItemsForPlatform) {
|
||||
for (StreamPush streamPushItem : streamPushItemsForPlatform) {
|
||||
List<String[]> platFormInfoList = streamPushItemsForAll.get(streamPushItem.getApp() + streamPushItem.getStream());
|
||||
if (platFormInfoList != null && platFormInfoList.size() > 0) {
|
||||
for (String[] platFormInfoArray : platFormInfoList) {
|
||||
StreamPushItem streamPushItemForPlatform = new StreamPushItem();
|
||||
StreamPush streamPushItemForPlatform = new StreamPush();
|
||||
streamPushItemForPlatform.setGbStreamId(streamPushItem.getGbStreamId());
|
||||
if (platFormInfoArray.length > 0) {
|
||||
// 数组 platFormInfoArray 0 为平台ID。 1为目录ID
|
||||
|
@ -589,7 +580,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean add(StreamPushItem stream) {
|
||||
public boolean add(StreamPush stream) {
|
||||
stream.setUpdateTime(DateUtil.getNow());
|
||||
stream.setCreateTime(DateUtil.getNow());
|
||||
stream.setServerId(userSetting.getServerId());
|
||||
|
@ -630,14 +621,14 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, StreamPushItem> getAllAppAndStreamMap() {
|
||||
public Map<String, StreamPush> getAllAppAndStreamMap() {
|
||||
return streamPushMapper.getAllAppAndStreamMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePush(OnStreamChangedHookParam param) {
|
||||
StreamPushItem transform = transform(param);
|
||||
StreamPushItem pushInDb = getPush(param.getApp(), param.getStream());
|
||||
StreamPush transform = transform(param);
|
||||
StreamPush pushInDb = getPush(param.getApp(), param.getStream());
|
||||
transform.setPushIng(param.isRegist());
|
||||
transform.setUpdateTime(DateUtil.getNow());
|
||||
transform.setPushTime(DateUtil.getNow());
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.genersoft.iot.vmp.service.impl;
|
|||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto;
|
||||
|
@ -32,12 +32,12 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
|
|||
/**
|
||||
* 用于存储不加过滤的所有数据
|
||||
*/
|
||||
private final List<StreamPushItem> streamPushItems = new ArrayList<>();
|
||||
private final List<StreamPush> streamPushItems = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 用于存储更具APP+Stream过滤后的数据,可以直接存入stream_push表与gb_stream表
|
||||
*/
|
||||
private final Map<String,StreamPushItem> streamPushItemForSave = new HashMap<>();
|
||||
private final Map<String, StreamPush> streamPushItemForSave = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 用于存储按照APP+Stream为KEY, 平台ID+目录Id 为value的数据,用于存储到gb_stream表后获取app+Stream对应的平台与目录信息,然后存入关联表
|
||||
|
@ -126,7 +126,7 @@ public class StreamPushUploadFileHandler extends AnalysisEventListener<StreamPus
|
|||
streamPushStreamSet.add(streamPushExcelDto.getApp()+streamPushExcelDto.getStream() + streamPushExcelDto.getPlatformId());
|
||||
}
|
||||
|
||||
StreamPushItem streamPushItem = new StreamPushItem();
|
||||
StreamPush streamPushItem = new StreamPush();
|
||||
streamPushItem.setApp(streamPushExcelDto.getApp());
|
||||
streamPushItem.setStream(streamPushExcelDto.getStream());
|
||||
streamPushItem.setGbId(streamPushExcelDto.getGbId());
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.genersoft.iot.vmp.service.redisMsg;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.IGbStreamService;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
|
@ -57,17 +57,17 @@ public class RedisPushStreamStatusListMsgListener implements MessageListener {
|
|||
while (!taskQueue.isEmpty()) {
|
||||
Message msg = taskQueue.poll();
|
||||
try {
|
||||
List<StreamPushItem> streamPushItems = JSON.parseArray(new String(msg.getBody()), StreamPushItem.class);
|
||||
List<StreamPush> streamPushItems = JSON.parseArray(new String(msg.getBody()), StreamPush.class);
|
||||
//查询全部的app+stream 用于判断是添加还是修改
|
||||
Map<String, StreamPushItem> allAppAndStream = streamPushService.getAllAppAndStreamMap();
|
||||
Map<String, StreamPush> allAppAndStream = streamPushService.getAllAppAndStreamMap();
|
||||
Map<String, GbStream> allGBId = gbStreamService.getAllGBId();
|
||||
|
||||
/**
|
||||
* 用于存储更具APP+Stream过滤后的数据,可以直接存入stream_push表与gb_stream表
|
||||
*/
|
||||
List<StreamPushItem> streamPushItemForSave = new ArrayList<>();
|
||||
List<StreamPushItem> streamPushItemForUpdate = new ArrayList<>();
|
||||
for (StreamPushItem streamPushItem : streamPushItems) {
|
||||
List<StreamPush> streamPushItemForSave = new ArrayList<>();
|
||||
List<StreamPush> streamPushItemForUpdate = new ArrayList<>();
|
||||
for (StreamPush streamPushItem : streamPushItems) {
|
||||
String app = streamPushItem.getApp();
|
||||
String stream = streamPushItem.getStream();
|
||||
boolean contains = allAppAndStream.containsKey(app + stream);
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.genersoft.iot.vmp.media.bean.MediaInfo;
|
|||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||
import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo;
|
||||
|
@ -216,7 +216,7 @@ public interface IRedisCatchStorage {
|
|||
|
||||
void addPushListItem(String app, String stream, MediaArrivalEvent param);
|
||||
|
||||
StreamPushItem getPushListItem(String app, String stream);
|
||||
StreamPush getPushListItem(String app, String stream);
|
||||
|
||||
void removePushListItem(String app, String stream, String mediaServerId);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.genersoft.iot.vmp.storager;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||
|
@ -233,7 +233,7 @@ public interface IVideoManagerStorage {
|
|||
* @param enable
|
||||
* @return
|
||||
*/
|
||||
public List<StreamProxyItem> getStreamProxyListForEnable(boolean enable);
|
||||
public List<StreamProxy> getStreamProxyListForEnable(boolean enable);
|
||||
|
||||
/**
|
||||
* 按照是app和stream获取代理流
|
||||
|
@ -241,7 +241,7 @@ public interface IVideoManagerStorage {
|
|||
* @param stream
|
||||
* @return
|
||||
*/
|
||||
public StreamProxyItem queryStreamProxy(String app, String stream);
|
||||
public StreamProxy queryStreamProxy(String app, String stream);
|
||||
|
||||
/**
|
||||
* 获取代理流
|
||||
|
@ -249,7 +249,7 @@ public interface IVideoManagerStorage {
|
|||
* @param count
|
||||
* @return
|
||||
*/
|
||||
PageInfo<StreamProxyItem> queryStreamProxyList(Integer page, Integer count);
|
||||
PageInfo<StreamProxy> queryStreamProxyList(Integer page, Integer count);
|
||||
|
||||
/**
|
||||
* 根据国标ID获取平台关联的直播流
|
||||
|
@ -294,7 +294,7 @@ public interface IVideoManagerStorage {
|
|||
* @param enable 启用/不启用
|
||||
* @return
|
||||
*/
|
||||
List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable);
|
||||
List<StreamProxy> getStreamProxyListForEnableInMediaServer(String id, boolean enable);
|
||||
|
||||
/**
|
||||
* 根据通道ID获取其所在设备
|
||||
|
@ -321,7 +321,7 @@ public interface IVideoManagerStorage {
|
|||
* @param streamId
|
||||
* @return
|
||||
*/
|
||||
StreamProxyItem getStreamProxyByAppAndStream(String app, String streamId);
|
||||
StreamProxy getStreamProxyByAppAndStream(String app, String streamId);
|
||||
|
||||
/**
|
||||
* catlog查询结束后完全重写通道信息
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.genersoft.iot.vmp.storager.dao;
|
|||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -108,7 +108,7 @@ public interface GbStreamMapper {
|
|||
"(app=#{item.app} and stream=#{item.stream}) " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
void batchDel(List<StreamProxyItem> streamProxyItemList);
|
||||
void batchDel(List<StreamProxy> streamProxyItemList);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE FROM wvp_gb_stream where " +
|
||||
|
@ -130,7 +130,7 @@ public interface GbStreamMapper {
|
|||
"</foreach> " +
|
||||
"</script>")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "gbStreamId", keyColumn = "gb_stream_id")
|
||||
void batchAdd(@Param("subList") List<StreamPushItem> subList);
|
||||
void batchAdd(@Param("subList") List<StreamPush> subList);
|
||||
|
||||
@Update({"<script>" +
|
||||
"<foreach collection='gpsMsgInfos' item='item' separator=';'>" +
|
||||
|
@ -148,7 +148,7 @@ public interface GbStreamMapper {
|
|||
"(app=#{item.app} and stream=#{item.stream}) " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
List<GbStream> selectAllForAppAndStream(List<StreamPushItem> streamPushItems);
|
||||
List<GbStream> selectAllForAppAndStream(List<StreamPush> streamPushItems);
|
||||
|
||||
@Update("UPDATE wvp_gb_stream " +
|
||||
"SET media_server_id=#{mediaServerId}" +
|
||||
|
@ -163,7 +163,7 @@ public interface GbStreamMapper {
|
|||
" WHERE app=#{item.app} and stream=#{item.stream}"+
|
||||
"</foreach>"+
|
||||
"</script>")
|
||||
int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate);
|
||||
int updateGbIdOrName(List<StreamPush> streamPushItemForUpdate);
|
||||
|
||||
@Select("SELECT status FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
|
||||
Boolean selectStatusForProxy(@Param("app") String app, @Param("stream") String stream);
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
@ -29,7 +29,7 @@ public interface PlatformGbStreamMapper {
|
|||
"(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})" +
|
||||
"</foreach> " +
|
||||
"</script>")
|
||||
int batchAdd(List<StreamPushItem> streamPushItems);
|
||||
int batchAdd(List<StreamPush> streamPushItems);
|
||||
|
||||
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})")
|
||||
int delByAppAndStream(@Param("app") String app, @Param("stream") String stream);
|
||||
|
@ -51,7 +51,7 @@ public interface PlatformGbStreamMapper {
|
|||
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
|
||||
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
|
||||
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
|
||||
StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
|
||||
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
|
||||
|
||||
@Select("<script> " +
|
||||
"select gs.* " +
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
@ -16,7 +16,7 @@ public interface StreamProxyMapper {
|
|||
"(#{type}, #{name}, #{app}, #{stream}, #{mediaServerId}, #{url}, #{srcUrl}, #{dstUrl}, " +
|
||||
"#{timeoutMs}, #{ffmpegCmdKey}, #{rtpType}, #{enableAudio}, #{enableMp4}, #{enable}, #{status}, #{streamKey}, " +
|
||||
"#{enableRemoveNoneReader}, #{enableDisableNoneReader}, #{createTime} )")
|
||||
int add(StreamProxyItem streamProxyDto);
|
||||
int add(StreamProxy streamProxyDto);
|
||||
|
||||
@Update("UPDATE wvp_stream_proxy " +
|
||||
"SET type=#{type}, " +
|
||||
|
@ -38,29 +38,29 @@ public interface StreamProxyMapper {
|
|||
"enable_disable_none_reader=#{enableDisableNoneReader}, " +
|
||||
"enable_mp4=#{enableMp4} " +
|
||||
"WHERE app=#{app} AND stream=#{stream}")
|
||||
int update(StreamProxyItem streamProxyDto);
|
||||
int update(StreamProxy streamProxyDto);
|
||||
|
||||
@Delete("DELETE FROM wvp_stream_proxy WHERE app=#{app} AND stream=#{stream}")
|
||||
int del(String app, String stream);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream order by st.create_time desc")
|
||||
List<StreamProxyItem> selectAll();
|
||||
List<StreamProxy> selectAll();
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude, 'proxy' as streamType FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable=#{enable} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectForEnable(boolean enable);
|
||||
List<StreamProxy> selectForEnable(boolean enable);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc")
|
||||
StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
StreamProxy selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
|
||||
"LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
|
||||
"WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectForEnableInMediaServer( @Param("id") String id, @Param("enable") boolean enable);
|
||||
List<StreamProxy> selectForEnableInMediaServer(@Param("id") String id, @Param("enable") boolean enable);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
|
||||
"LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
|
||||
"WHERE st.media_server_id= #{id} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectInMediaServer(String id);
|
||||
List<StreamProxy> selectInMediaServer(String id);
|
||||
|
||||
@Update("UPDATE wvp_stream_proxy " +
|
||||
"SET status=#{status} " +
|
||||
|
@ -76,7 +76,7 @@ public interface StreamProxyMapper {
|
|||
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||
List<StreamProxy> selectAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||
|
||||
@Select("select count(1) as total, sum(status) as online from wvp_stream_proxy")
|
||||
ResourceBaseInfo getOverview();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
@ -18,7 +18,7 @@ public interface StreamPushMapper {
|
|||
"(#{app}, #{stream}, #{totalReaderCount}, #{originType}, #{originTypeStr}, " +
|
||||
"#{pushTime}, #{aliveSecond}, #{mediaServerId} , #{serverId} , #{updateTime} , #{createTime}, " +
|
||||
"#{pushIng}, #{self} )")
|
||||
int add(StreamPushItem streamPushItem);
|
||||
int add(StreamPush streamPushItem);
|
||||
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
|
@ -35,7 +35,7 @@ public interface StreamPushMapper {
|
|||
"<if test=\"self != null\">, self=#{self}</if>" +
|
||||
"WHERE app=#{app} AND stream=#{stream}"+
|
||||
" </script>"})
|
||||
int update(StreamPushItem streamPushItem);
|
||||
int update(StreamPush streamPushItem);
|
||||
|
||||
@Delete("DELETE FROM wvp_stream_push WHERE app=#{app} AND stream=#{stream}")
|
||||
int del(String app, String stream);
|
||||
|
@ -46,7 +46,7 @@ public interface StreamPushMapper {
|
|||
"(sp.app=#{item.app} and sp.stream=#{item.stream} and gs.gb_id is null) " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
int delAllWithoutGBId(List<StreamPushItem> streamPushItems);
|
||||
int delAllWithoutGBId(List<StreamPush> streamPushItems);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE FROM wvp_stream_push where " +
|
||||
|
@ -54,7 +54,7 @@ public interface StreamPushMapper {
|
|||
"(app=#{item.app} and stream=#{item.stream}) " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
int delAll(List<StreamPushItem> streamPushItems);
|
||||
int delAll(List<StreamPush> streamPushItems);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE FROM wvp_stream_push where " +
|
||||
|
@ -81,13 +81,13 @@ public interface StreamPushMapper {
|
|||
" <if test='mediaServerId != null' > AND st.media_server_id=#{mediaServerId} </if>" +
|
||||
"order by st.create_time desc" +
|
||||
" </script>"})
|
||||
List<StreamPushItem> selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
|
||||
List<StreamPush> selectAllForList(@Param("query") String query, @Param("pushing") Boolean pushing, @Param("mediaServerId") String mediaServerId);
|
||||
|
||||
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream order by st.create_time desc")
|
||||
List<StreamPushItem> selectAll();
|
||||
List<StreamPush> selectAll();
|
||||
|
||||
@Select("SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream WHERE st.app=#{app} AND st.stream=#{stream}")
|
||||
StreamPushItem selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
StreamPush selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
@Insert("<script>" +
|
||||
"Insert INTO wvp_stream_push (app, stream, total_reader_count, origin_type, origin_type_str, " +
|
||||
|
@ -99,7 +99,7 @@ public interface StreamPushMapper {
|
|||
" </foreach>" +
|
||||
"</script>")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int addAll(List<StreamPushItem> streamPushItems);
|
||||
int addAll(List<StreamPush> streamPushItems);
|
||||
|
||||
@Delete("DELETE FROM wvp_stream_push")
|
||||
void clear();
|
||||
|
@ -116,10 +116,10 @@ public interface StreamPushMapper {
|
|||
void deleteWithoutGBId(String mediaServerId);
|
||||
|
||||
@Select("SELECT * FROM wvp_stream_push WHERE media_server_id=#{mediaServerId}")
|
||||
List<StreamPushItem> selectAllByMediaServerId(String mediaServerId);
|
||||
List<StreamPush> selectAllByMediaServerId(String mediaServerId);
|
||||
|
||||
@Select("SELECT sp.* FROM wvp_stream_push sp left join wvp_gb_stream gs on gs.app = sp.app and gs.stream= sp.stream WHERE sp.media_server_id=#{mediaServerId} and gs.gb_id is null")
|
||||
List<StreamPushItem> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||
List<StreamPush> selectAllByMediaServerIdWithOutGbID(String mediaServerId);
|
||||
|
||||
@Update("UPDATE wvp_stream_push " +
|
||||
"SET status=#{status} " +
|
||||
|
@ -195,13 +195,13 @@ public interface StreamPushMapper {
|
|||
"(#{item.app}, #{item.stream}) " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
List<StreamPushItem> getListIn(List<StreamPushItem> streamPushItems);
|
||||
List<StreamPush> getListIn(List<StreamPush> streamPushItems);
|
||||
|
||||
@MapKey("vhost")
|
||||
@Select("SELECT CONCAT(wsp.app, wsp.stream) as vhost, wsp.app, wsp.stream, wgs.gb_id, wgs.name " +
|
||||
" from wvp_stream_push wsp " +
|
||||
" left join wvp_gb_stream wgs on wgs.app = wsp.app and wgs.stream = wsp.stream")
|
||||
Map<String, StreamPushItem> getAllAppAndStreamMap();
|
||||
Map<String, StreamPush> getAllAppAndStreamMap();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.genersoft.iot.vmp.media.bean.MediaServer;
|
|||
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
|
@ -698,20 +698,20 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
|||
@Override
|
||||
public void addPushListItem(String app, String stream, MediaArrivalEvent event) {
|
||||
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
|
||||
StreamPushItem streamPushItem = StreamPushItem.getInstance(event, userSetting.getServerId());
|
||||
StreamPush streamPushItem = StreamPush.getInstance(event, userSetting.getServerId());
|
||||
redisTemplate.opsForValue().set(key, streamPushItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamPushItem getPushListItem(String app, String stream) {
|
||||
public StreamPush getPushListItem(String app, String stream) {
|
||||
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
|
||||
return (StreamPushItem)redisTemplate.opsForValue().get(key);
|
||||
return (StreamPush)redisTemplate.opsForValue().get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removePushListItem(String app, String stream, String mediaServerId) {
|
||||
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
|
||||
StreamPushItem param = (StreamPushItem)redisTemplate.opsForValue().get(key);
|
||||
StreamPush param = (StreamPush)redisTemplate.opsForValue().get(key);
|
||||
if (param != null && param.getMediaServerId().equalsIgnoreCase(mediaServerId)) {
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.genersoft.iot.vmp.conf.UserSetting;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
|
@ -699,7 +699,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StreamProxyItem> getStreamProxyListForEnable(boolean enable) {
|
||||
public List<StreamProxy> getStreamProxyListForEnable(boolean enable) {
|
||||
return streamProxyMapper.selectForEnable(enable);
|
||||
}
|
||||
|
||||
|
@ -710,9 +710,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<StreamProxyItem> queryStreamProxyList(Integer page, Integer count) {
|
||||
public PageInfo<StreamProxy> queryStreamProxyList(Integer page, Integer count) {
|
||||
PageHelper.startPage(page, count);
|
||||
List<StreamProxyItem> all = streamProxyMapper.selectAll();
|
||||
List<StreamProxy> all = streamProxyMapper.selectAll();
|
||||
return new PageInfo<>(all);
|
||||
}
|
||||
|
||||
|
@ -744,7 +744,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public StreamProxyItem queryStreamProxy(String app, String stream){
|
||||
public StreamProxy queryStreamProxy(String app, String stream){
|
||||
return streamProxyMapper.selectOne(app, stream);
|
||||
}
|
||||
|
||||
|
@ -783,7 +783,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<StreamProxyItem> getStreamProxyListForEnableInMediaServer(String id, boolean enable) {
|
||||
public List<StreamProxy> getStreamProxyListForEnableInMediaServer(String id, boolean enable) {
|
||||
return streamProxyMapper.selectForEnableInMediaServer(id, enable);
|
||||
}
|
||||
|
||||
|
@ -799,7 +799,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
|||
}
|
||||
|
||||
@Override
|
||||
public StreamProxyItem getStreamProxyByAppAndStream(String app, String streamId) {
|
||||
public StreamProxy getStreamProxyByAppAndStream(String app, String streamId) {
|
||||
return streamProxyMapper.selectOne(app, streamId);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
|||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import com.genersoft.iot.vmp.media.bean.MediaServer;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||
|
@ -62,10 +62,10 @@ public class StreamProxyController {
|
|||
@Parameter(name = "online", description = "是否在线")
|
||||
@GetMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public PageInfo<StreamProxyItem> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean online ){
|
||||
public PageInfo<StreamProxy> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean online ){
|
||||
|
||||
return streamProxyService.getAll(page, count);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class StreamProxyController {
|
|||
@Parameter(name = "stream", description = "流Id")
|
||||
@GetMapping(value = "/one")
|
||||
@ResponseBody
|
||||
public StreamProxyItem one(String app, String stream){
|
||||
public StreamProxy one(String app, String stream){
|
||||
|
||||
return streamProxyService.getStreamProxyByAppAndStream(app, stream);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class StreamProxyController {
|
|||
})
|
||||
@PostMapping(value = "/save")
|
||||
@ResponseBody
|
||||
public DeferredResult<Object> save(@RequestBody StreamProxyItem param){
|
||||
public DeferredResult<Object> save(@RequestBody StreamProxy param){
|
||||
logger.info("添加代理: " + JSONObject.toJSONString(param));
|
||||
if (ObjectUtils.isEmpty(param.getMediaServerId())) {
|
||||
param.setMediaServerId("auto");
|
||||
|
@ -99,7 +99,7 @@ public class StreamProxyController {
|
|||
if (ObjectUtils.isEmpty(param.getGbId())) {
|
||||
param.setGbId(null);
|
||||
}
|
||||
StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(param.getApp(), param.getStream());
|
||||
StreamProxy streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(param.getApp(), param.getStream());
|
||||
if (streamProxyItem != null) {
|
||||
streamProxyService.del(param.getApp(), param.getStream());
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
|
|||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IMediaService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
|
@ -72,11 +72,11 @@ public class StreamPushController {
|
|||
@Parameter(name = "query", description = "查询内容")
|
||||
@Parameter(name = "pushing", description = "是否正在推流")
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID")
|
||||
public PageInfo<StreamPushItem> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean pushing,
|
||||
@RequestParam(required = false)String mediaServerId ){
|
||||
public PageInfo<StreamPush> list(@RequestParam(required = false)Integer page,
|
||||
@RequestParam(required = false)Integer count,
|
||||
@RequestParam(required = false)String query,
|
||||
@RequestParam(required = false)Boolean pushing,
|
||||
@RequestParam(required = false)String mediaServerId ){
|
||||
|
||||
if (ObjectUtils.isEmpty(query)) {
|
||||
query = null;
|
||||
|
@ -84,7 +84,7 @@ public class StreamPushController {
|
|||
if (ObjectUtils.isEmpty(mediaServerId)) {
|
||||
mediaServerId = null;
|
||||
}
|
||||
PageInfo<StreamPushItem> pushList = streamPushService.getPushList(page, count, query, pushing, mediaServerId);
|
||||
PageInfo<StreamPush> pushList = streamPushService.getPushList(page, count, query, pushing, mediaServerId);
|
||||
return pushList;
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ public class StreamPushController {
|
|||
if (userInfo!= null) {
|
||||
authority = true;
|
||||
}
|
||||
StreamPushItem push = streamPushService.getPush(app, stream);
|
||||
StreamPush push = streamPushService.getPush(app, stream);
|
||||
if (push != null && !push.isSelf()) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "来自其他平台的推流信息");
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ public class StreamPushController {
|
|||
@PostMapping(value = "/add")
|
||||
@ResponseBody
|
||||
@Operation(summary = "添加推流信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public void add(@RequestBody StreamPushItem stream){
|
||||
public void add(@RequestBody StreamPush stream){
|
||||
if (ObjectUtils.isEmpty(stream.getGbId())) {
|
||||
throw new ControllerException(ErrorCode.ERROR400.getCode(), "国标ID不可为空");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue