rtmpadapter

package
v1.4.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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 NewAdapter

func NewAdapter(ipcCore ipc.Core, conf *conf.Bootstrap) *Adapter

func (*Adapter) DeleteDevice

func (a *Adapter) DeleteDevice(ctx context.Context, device *ipc.Device) error

DeleteDevice implements ipc.Protocoler.

func (*Adapter) InitDevice

func (a *Adapter) InitDevice(ctx context.Context, device *ipc.Device) error

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

func (a *Adapter) OnStreamChanged(ctx context.Context, app, stream string) error

OnStreamChanged implements ipc.Protocoler. RTMP 推流断开时更新通道状态(IsOnline=false, IsPlaying=false)

func (*Adapter) OnStreamNotFound

func (a *Adapter) OnStreamNotFound(ctx context.Context, app string, stream string) error

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

func (a *Adapter) QueryCatalog(ctx context.Context, device *ipc.Device) error

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.

func (*Adapter) StopPlay

func (a *Adapter) StopPlay(ctx context.Context, device *ipc.Device, channel *ipc.Channel) error

StopPlay implements ipc.Protocoler.

func (*Adapter) ValidateDevice

func (a *Adapter) ValidateDevice(ctx context.Context, device *ipc.Device) error

ValidateDevice implements ipc.Protocoler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL