Files
monibuca/plugin/gb28181/pkg/channel.go
2024-07-24 09:12:14 +08:00

47 lines
904 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package gb28181
import (
"log/slog"
"sync/atomic"
"time"
)
type ChannelStatus string
const (
ChannelOnStatus ChannelStatus = "ON"
ChannelOffStatus ChannelStatus = "OFF"
)
type Channel struct {
Device *Device // 所属设备
State atomic.Int32 // 通道状态,0:空闲,1:正在invite,2:正在播放/对讲
LiveSubSP string // 实时子码流通过rtsp
GpsTime time.Time // gps时间
Longitude string // 经度
Latitude string // 纬度
*slog.Logger
ChannelInfo
}
func (c *Channel) GetKey() string {
return c.DeviceID
}
type ChannelInfo struct {
DeviceID string // 通道ID
ParentID string
Name string
Manufacturer string
Model string
Owner string
CivilCode string
Address string
Port int
Parental int
SafetyWay int
RegisterWay int
Secrecy int
Status ChannelStatus
}