mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-07 01:22:51 +08:00
去掉unknowTrack
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user