重构Track写入架构,增加sub配置项可配置指定track订阅的参数名

修复首次写入AbsTime的值
This commit is contained in:
dexter
2023-01-18 18:08:59 +08:00
parent 881fe5abd9
commit b0dcecdebc
16 changed files with 396 additions and 431 deletions

View File

@@ -40,13 +40,16 @@ func (c *Publish) GetPublishConfig() *Publish {
}
type Subscribe struct {
SubAudio bool
SubVideo bool
SubAudioTracks []string // 指定订阅的频轨道
SubVideoTracks []string // 指定订阅的频轨道
LiveMode bool // 实时模式:追赶发布者进度,在播放首屏后等待发布者的下一个关键帧,然后调到该帧。
IFrameOnly bool // 只要关键帧
WaitTimeout int // 等待流超时
SubAudio bool
SubVideo bool
SubVideoArgName string // 指定订阅的频轨道参数名
SubAudioArgName string // 指定订阅的频轨道参数名
SubDataArgName string // 指定订阅的数据轨道参数名
SubAudioTracks []string // 指定订阅的音频轨道
SubVideoTracks []string // 指定订阅的视频轨道
LiveMode bool // 实时模式:追赶发布者进度,在播放首屏后等待发布者的下一个关键帧,然后调到该帧。
IFrameOnly bool // 只要关键帧
WaitTimeout int // 等待流超时
}
func (c *Subscribe) GetSubscribeConfig() *Subscribe {
@@ -117,8 +120,19 @@ type Engine struct {
}
var Global = &Engine{
Publish: Publish{true, true, false, 10, 0, 0},
Subscribe: Subscribe{true, true, nil, nil, true, false, 10},
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,