配置合并和覆盖

This commit is contained in:
dexter
2022-02-08 19:31:50 +08:00
parent 1fd7b14bd7
commit f9d0567f45
20 changed files with 530 additions and 350 deletions

View File

@@ -6,6 +6,7 @@ import (
"time"
. "github.com/Monibuca/engine/v4/common"
"github.com/Monibuca/engine/v4/config"
"github.com/Monibuca/engine/v4/track"
)
@@ -16,7 +17,7 @@ type VideoFrame AVFrame[NALUSlice]
type Subscriber struct {
context.Context `json:"-"`
cancel context.CancelFunc
Config SubscribeConfig
Config config.Subscribe
Stream *Stream `json:"-"`
ID string
TotalDrop int //总丢帧
@@ -39,7 +40,7 @@ func (s *Subscriber) Close() {
}
//Subscribe 开始订阅 将Subscriber与Stream关联
func (sub *Subscriber) Subscribe(streamPath string, config SubscribeConfig) bool {
func (sub *Subscriber) Subscribe(streamPath string, config config.Subscribe) bool {
Streams.Lock()
defer Streams.Unlock()
s, created := findOrCreateStream(streamPath, config.WaitTimeout.Duration())