[1078] 增加抓图

This commit is contained in:
lin
2025-07-11 20:15:45 +08:00
parent b7a2b6816b
commit 8c3e9320fa
13 changed files with 181 additions and 244 deletions

View File

@@ -2,7 +2,9 @@ package com.genersoft.iot.vmp.jt1078.bean;
import io.netty.buffer.ByteBuf;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "多媒体事件信息")
public class JTMediaEventInfo {
@@ -21,6 +23,10 @@ public class JTMediaEventInfo {
@Schema(description = "通道 ID")
private int channelId;
@Schema(description = "媒体数据")
private byte[] mediaData;
public static JTMediaEventInfo decode(ByteBuf buf) {
JTMediaEventInfo jtMediaEventInfo = new JTMediaEventInfo();
jtMediaEventInfo.setId(buf.readUnsignedInt());
@@ -28,49 +34,14 @@ public class JTMediaEventInfo {
jtMediaEventInfo.setCode(buf.readUnsignedByte());
jtMediaEventInfo.setEventCode(buf.readUnsignedByte());
jtMediaEventInfo.setChannelId(buf.readUnsignedByte());
byte[] bytes = new byte[buf.readableBytes()];
buf.readBytes(bytes);
jtMediaEventInfo.setMediaData(bytes);
return jtMediaEventInfo;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public int getEventCode() {
return eventCode;
}
public void setEventCode(int eventCode) {
this.eventCode = eventCode;
}
public int getChannelId() {
return channelId;
}
public void setChannelId(int channelId) {
this.channelId = channelId;
}
@Override
public String toString() {
return "JTMediaEventInfo{" +
@@ -79,6 +50,7 @@ public class JTMediaEventInfo {
", code=" + code +
", eventCode=" + eventCode +
", channelId=" + channelId +
", fileSize=" + mediaData.length +
'}';
}
}