Documentation
¶
Index ¶
- type Adapter
- func (a *Adapter) DeleteDevice(ctx context.Context, device *ipc.Device) error
- func (a *Adapter) InitDevice(ctx context.Context, device *ipc.Device) error
- func (a *Adapter) OnPublish(ctx context.Context, app, stream string, params map[string]string) (bool, error)
- func (a *Adapter) OnStreamChanged(ctx context.Context, app, stream string) error
- func (a *Adapter) OnStreamNotFound(ctx context.Context, app string, stream string) error
- func (a *Adapter) PTZControl(ctx context.Context, device *ipc.Device, channel *ipc.Channel, ...) error
- func (a *Adapter) QueryCatalog(ctx context.Context, device *ipc.Device) error
- func (a *Adapter) StartPlay(ctx context.Context, device *ipc.Device, channel *ipc.Channel) (*ipc.PlayResponse, error)
- func (a *Adapter) StopPlay(ctx context.Context, device *ipc.Device, channel *ipc.Channel) error
- func (a *Adapter) ValidateDevice(ctx context.Context, device *ipc.Device) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter RTMP 协议适配器 处理 RTMP 推流的鉴权、状态管理等逻辑
func (*Adapter) DeleteDevice ¶
DeleteDevice implements ipc.Protocoler.
func (*Adapter) InitDevice ¶
InitDevice implements ipc.Protocoler.
func (*Adapter) OnPublish ¶
func (a *Adapter) OnPublish(ctx context.Context, app, stream string, params map[string]string) (bool, error)
OnPublish 处理 RTMP 推流鉴权 验证推流参数中的 sign 字段是否与配置的 RTMPSecret MD5 一致
func (*Adapter) OnStreamChanged ¶
OnStreamChanged implements ipc.Protocoler. RTMP 推流断开时更新通道状态(IsOnline=false, IsPlaying=false)
func (*Adapter) OnStreamNotFound ¶
OnStreamNotFound implements ipc.Protocoler. RTMP 推流不需要处理流不存在事件(推流方需要主动推流)
func (*Adapter) PTZControl ¶
func (a *Adapter) PTZControl(ctx context.Context, device *ipc.Device, channel *ipc.Channel, cmd ipc.PTZCommand) error
PTZControl implements ipc.Protocoler. RTMP 协议不支持云台控制
func (*Adapter) QueryCatalog ¶
QueryCatalog implements ipc.Protocoler.
func (*Adapter) StartPlay ¶
func (a *Adapter) StartPlay(ctx context.Context, device *ipc.Device, channel *ipc.Channel) (*ipc.PlayResponse, error)
StartPlay implements ipc.Protocoler.
Click to show internal directories.
Click to hide internal directories.