feat: add insert sei

feat: add engine init done event
refactor: remove ring_lock
fix: retry connect to console
fix: h265 sps parse error
fix: concurrent publish

desc:
- 增加插入SEI帧的功能
- 增加engine初始化完成事件
- 删除ring_lock,DataTrack和MediaTrack共用一个ring
- 修复console无限重连导致远程服务器崩溃问题
- 修复h265 sps解析错误问题
- 修复并发发布导致的问题
This commit is contained in:
langhuihui
2023-06-15 20:04:14 +08:00
parent 1769ba1549
commit b87416b78e
24 changed files with 416 additions and 287 deletions

5
io.go
View File

@@ -165,9 +165,6 @@ func (io *IO) receive(streamPath string, specific IIO) error {
io.Context, io.CancelFunc = context.WithCancel(Engine)
}
s, create := findOrCreateStream(u.Path, wt)
if s == nil {
return ErrBadStreamName
}
io.Stream = s
io.Spesific = specific
io.StartTime = time.Now()
@@ -182,6 +179,8 @@ func (io *IO) receive(streamPath string, specific IIO) error {
conf := v.GetPublisher().Config
io.Type = strings.TrimSuffix(io.Type, "Publisher")
io.Info("publish")
s.pubLocker.Lock()
defer s.pubLocker.Unlock()
oldPublisher := s.Publisher
if oldPublisher != nil && !oldPublisher.IsClosed() {
// 根据配置是否剔出原来的发布者