去掉unknowTrack

This commit is contained in:
dexter
2022-05-20 14:17:05 +08:00
parent 48b0fc9768
commit dbf0e0b070
12 changed files with 160 additions and 162 deletions

View File

@@ -10,37 +10,6 @@ import (
"m7s.live/engine/v4/util"
)
// Base 基础Track类
type Base struct {
Name string
Stream IStream `json:"-"`
ts time.Time
bytes int
frames int
BPS int
FPS int
}
func (bt *Base) ComputeBPS(bytes int) {
bt.bytes += bytes
bt.frames++
if elapse := time.Since(bt.ts).Seconds(); elapse > 1 {
bt.BPS = bt.bytes / int(elapse)
bt.FPS = bt.frames / int(elapse)
bt.bytes = 0
bt.frames = 0
bt.ts = time.Now()
}
}
func (bt *Base) GetName() string {
return bt.Name
}
func (bt *Base) Flush(bf *BaseFrame) {
bt.ComputeBPS(bf.BytesIn)
bf.Timestamp = time.Now()
}
type 流速控制 struct {
起始时间戳 uint32
起始时间 time.Time