Documentation ¶
Index ¶
- Variables
- type Config
- func (config Config) Assign(source Config)
- func (config Config) CreateElem(eleType reflect.Type) reflect.Value
- func (config Config) Get(key string) any
- func (config Config) GetChild(key string) Config
- func (config Config) Has(key string) (ok bool)
- func (config Config) HasChild(key string) (ok bool)
- func (config Config) Merge(source Config)
- func (config *Config) Set(key string, value any)
- func (config Config) Unmarshal(s any)
- type Console
- type Engine
- type HTTP
- type HTTPConfig
- type HTTPPlugin
- type Middleware
- type Plugin
- type Publish
- type PublishConfig
- type Pull
- type PullConfig
- type Push
- type PushConfig
- type Subscribe
- type SubscribeConfig
- type TCP
- type TCPPlugin
Constants ¶
This section is empty.
Variables ¶
View Source
var Global = &Engine{ Publish: Publish{true, true, false, 10, 0, 0}, Subscribe: Subscribe{ SubAudio: true, SubVideo: true, SubVideoArgName: "vts", SubAudioArgName: "ats", SubDataArgName: "dts", SubAudioTracks: nil, SubVideoTracks: nil, LiveMode: true, IFrameOnly: false, WaitTimeout: 10, }, HTTP: HTTP{ListenAddr: ":8080", CORS: true, mux: http.DefaultServeMux}, RTPReorder: true, EnableAVCC: true, EnableRTP: true, EnableSubEvent: true, EnableAuth: true, Console: Console{ "console.monibuca.com:4242", "", "", "", }, LogLevel: "info", RTPReorderBufferLen: 50, SpeedLimit: 500, EventBusSize: 10, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
func Struct2Config ¶
func (Config) CreateElem ¶ added in v4.7.0
CreateElem 创建Map或者Slice中的元素
type Engine ¶
type Engine struct { Publish Subscribe HTTP RTPReorder bool EnableAVCC bool //启用AVCC格式,rtmp协议使用 EnableRTP bool //启用RTP格式,rtsp、gb18181等协议使用 EnableSubEvent bool //启用订阅事件,禁用可以提高性能 EnableAuth bool //启用鉴权 Console LogLevel string RTPReorderBufferLen int //RTP重排序缓冲长度 SpeedLimit int //速度限制最大等待时间 EventBusSize int //事件总线大小 }
func (*Engine) ReceiveRequest ¶ added in v4.7.1
type HTTP ¶
type HTTP struct { ListenAddr string ListenAddrTLS string CertFile string KeyFile string CORS bool //是否自动添加CORS头 UserName string Password string ReadTimeout float64 WriteTimeout float64 IdleTimeout float64 // contains filtered or unexported fields }
func (*HTTP) AddMiddleware ¶ added in v4.9.4
func (config *HTTP) AddMiddleware(middleware Middleware)
func (*HTTP) GetHTTPConfig ¶
type HTTPConfig ¶
type HTTPPlugin ¶
type Plugin ¶
type Plugin interface { // 可能的入参类型:FirstConfig 第一次初始化配置,Config 后续配置更新,SE系列(StateEvent)流状态变化事件 OnEvent(any) }
type Publish ¶
type Publish struct { PubAudio bool PubVideo bool KickExist bool // 是否踢掉已经存在的发布者 PublishTimeout int // 发布无数据超时 WaitCloseTimeout int // 延迟自动关闭(等待重连) DelayCloseTimeout int // 延迟自动关闭(无订阅时) }
func (*Publish) GetPublishConfig ¶
type PublishConfig ¶
type PublishConfig interface {
GetPublishConfig() *Publish
}
type Pull ¶
type Pull struct { RePull int // 断开后自动重拉,0 表示不自动重拉,-1 表示无限重拉,高于0 的数代表最大重拉次数 PullOnStart map[string]string // 启动时拉流的列表 PullOnSub map[string]string // 订阅时自动拉流的列表 }
func (*Pull) AddPullOnStart ¶ added in v4.9.5
func (*Pull) AddPullOnSub ¶ added in v4.9.5
func (*Pull) GetPullConfig ¶
type PullConfig ¶
type PullConfig interface {
GetPullConfig() *Pull
}
type Push ¶
type Push struct { RePush int // 断开后自动重推,0 表示不自动重推,-1 表示无限重推,高于0 的数代表最大重推次数 PushList map[string]string // 自动推流列表 }
func (*Push) GetPushConfig ¶
type PushConfig ¶
type PushConfig interface {
GetPushConfig() *Push
}
type Subscribe ¶
type Subscribe struct { SubAudio bool SubVideo bool SubVideoArgName string // 指定订阅的视频轨道参数名 SubAudioArgName string // 指定订阅的音频轨道参数名 SubDataArgName string // 指定订阅的数据轨道参数名 SubAudioTracks []string // 指定订阅的音频轨道 SubVideoTracks []string // 指定订阅的视频轨道 LiveMode bool // 实时模式:追赶发布者进度,在播放首屏后等待发布者的下一个关键帧,然后调到该帧。 IFrameOnly bool // 只要关键帧 WaitTimeout int // 等待流超时 }
func (*Subscribe) GetSubscribeConfig ¶
type SubscribeConfig ¶
type SubscribeConfig interface {
GetSubscribeConfig() *Subscribe
}
Click to show internal directories.
Click to hide internal directories.