Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIPCAdapter ¶ added in v1.4.21
func NewIPCAdapter(ipcCore ipc.Core) recording.IPCProvider
func NewPlayAdapter ¶ added in v1.4.21
func NewPlayAdapter(smsCore sms.Core) recording.PlayProvider
func NewSMSAdapter ¶
func NewSMSAdapter(smsCore sms.Core) recording.SMSProvider
NewSMSAdapter 创建 SMS 适配器,返回 recording.SMSProvider 接口 Wire 通过此函数自动绑定 sms.Core -> recording.SMSProvider
Types ¶
type IPCAdapter ¶ added in v1.4.21
type IPCAdapter struct {
// contains filtered or unexported fields
}
IPCAdapter 桥接 ipc.Core → recording.IPCProvider 为录制同步提供所有在线通道列表
func (*IPCAdapter) ListOnlineChannels ¶ added in v1.4.21
func (a *IPCAdapter) ListOnlineChannels(ctx context.Context) ([]recording.ChannelInfo, error)
ListOnlineChannels 查询所有在线通道,包含 RecordMode 供同步逻辑分类
type PlayAdapter ¶ added in v1.4.21
type PlayAdapter struct {
// contains filtered or unexported fields
}
PlayAdapter 通过 ZLM getSnap 触发拉流,适配 recording.PlayProvider 所有协议统一走 RTSP 地址取快照 → ZLM 自动拉流 → on_publish 回调触发录制
func (*PlayAdapter) TriggerStream ¶ added in v1.4.21
func (a *PlayAdapter) TriggerStream(ctx context.Context, info recording.ChannelInfo) error
TriggerStream 通过取最新快照触发 ZLM 拉流 构造 RTSP 本地回环地址,调 ZLM getSnap(expire=1 强制刷新,timeout=30s) ZLM 收到 getSnap 请求后若流不存在会自动拉流 → 触发 on_publish webhook → 录制闭环
type SMSAdapter ¶
type SMSAdapter struct {
// contains filtered or unexported fields
}
SMSAdapter 实现 recording.SMSProvider 接口 将 sms.Core 的录制能力适配给 recording 领域使用
func (*SMSAdapter) ListRecordingStreams ¶ added in v1.4.21
func (a *SMSAdapter) ListRecordingStreams() (map[string]bool, error)
ListRecordingStreams 批量获取所有在线流的录制状态 调用 ZLM getMediaList 一次获取全部流,提取 isRecordingMP4 状态 返回 map key 格式为 "app/stream"
func (*SMSAdapter) StartRecord ¶
func (a *SMSAdapter) StartRecord(app, stream, customPath string, maxSecond int) error
StartRecord 启动录制
func (*SMSAdapter) StopRecord ¶
func (a *SMSAdapter) StopRecord(app, stream string) error
StopRecord 停止录制