临时提交

This commit is contained in:
648540858
2024-06-20 22:29:50 +08:00
parent 246c01b1c8
commit 306c42b4b7
30 changed files with 583 additions and 1331 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
/**
* 型号
*/
@Schema(description = "型号")
@MessageElement("DeviceID")
@Schema(description = "设备厂商")
private String manufacturer;
@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;
/**
* 父级id
*/
@Schema(description = "父级id")
@MessageElement("DeviceID")
@Schema(description = "是否有子设备")
private Boolean parental;
@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;
/**
* 注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式
*/
@Schema(description = "注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式")
private int registerWay;
/**
* 证书序列号
*/
// 2016
@MessageElement("DeviceID")
@Schema(description = "信令安全模式")
private Integer safetyWay;
@MessageElement("DeviceID")
@Schema(description = "注册方式")
private Integer registerWay;
// 2016
@MessageElement("DeviceID")
@Schema(description = "证书序列号")
private String certNum;
/**
* 证书有效标识 缺省为0;证书有效标识:0:无效1: 有效
*/
@Schema(description = "证书有效标识 缺省为0;证书有效标识:0:无效1: 有效")
private int certifiable;
/**
* 证书无效原因码
*/
@Schema(description = "证书无效原因码")
private int errCode;
/**
* 证书终止有效期
*/
@Schema(description = "证书终止有效期")
private String endTime;
/**
* 保密属性 缺省为0; 0:不涉密, 1:涉密
*/
@Schema(description = "保密属性 缺省为0; 0:不涉密, 1:涉密")
private String secrecy;
/**
* IP地址
*/
@Schema(description = "IP地址")
private Integer certNum;
// 2016
@MessageElement("DeviceID")
@Schema(description = "证书有效标识")
private Integer certifiable;
// 2016
@MessageElement("DeviceID")
@Schema(description = "无效原因码(有证书且证书无效的设备必选)")
private Integer errCode;
// 2016
@MessageElement("DeviceID")
@Schema(description = "证书终止有效期(有证书且证书无效的设备必选)")
private Integer endTime;
// 2022
@MessageElement("DeviceID")
@Schema(description = "摄像机安全能力等级代码")
private String securityLevelCode;
@MessageElement("DeviceID")
@Schema(description = "保密属性(必选)缺省为0;0-不涉密,1-涉密")
private Integer secrecy;
@MessageElement("DeviceID")
@Schema(description = "设备/系统IPv4/IPv6地址")
private String ipAddress;
/**
* 端口号
*/
@Schema(description = "端口号")
private int port;
/**
* 密码
*/
@Schema(description = "密码")
@MessageElement("DeviceID")
@Schema(description = "设备/系统端口")
private Integer port;
@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;
}
}

View File

@@ -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) {
// 通道存在发100TRYING
@@ -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());

View File

@@ -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:
// 上线

View File

@@ -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");