mirror of
https://github.com/livekit/livekit.git
synced 2026-04-14 04:25:44 +00:00
* Don't update dependency info if unordered packet received * Trace all active svc chains for downtrack * Try to keep lower decode target decodable * remove comments * Test case * clean code * solve comments
57 lines
1.2 KiB
Go
57 lines
1.2 KiB
Go
package streamtracker
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/livekit/livekit-server/pkg/sfu/buffer"
|
|
)
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
type StreamStatusChange int32
|
|
|
|
func (s StreamStatusChange) String() string {
|
|
switch s {
|
|
case StreamStatusChangeNone:
|
|
return "none"
|
|
case StreamStatusChangeStopped:
|
|
return "stopped"
|
|
case StreamStatusChangeActive:
|
|
return "active"
|
|
default:
|
|
return fmt.Sprintf("unknown: %d", int(s))
|
|
}
|
|
}
|
|
|
|
const (
|
|
StreamStatusChangeNone StreamStatusChange = iota
|
|
StreamStatusChangeStopped
|
|
StreamStatusChangeActive
|
|
)
|
|
|
|
// ------------------------------------------------------------
|
|
|
|
type StreamTrackerImpl interface {
|
|
Start()
|
|
Stop()
|
|
Reset()
|
|
|
|
GetCheckInterval() time.Duration
|
|
|
|
Observe(hasMarker bool, ts uint32) StreamStatusChange
|
|
CheckStatus() StreamStatusChange
|
|
}
|
|
|
|
type StreamTrackerWorker interface {
|
|
Start()
|
|
Stop()
|
|
Reset()
|
|
OnStatusChanged(f func(status StreamStatus))
|
|
OnBitrateAvailable(f func())
|
|
Status() StreamStatus
|
|
BitrateTemporalCumulative() []int64
|
|
SetPaused(paused bool)
|
|
Observe(temporalLayer int32, pktSize int, payloadSize int, hasMarker bool, ts uint32, dd *buffer.ExtDependencyDescriptor)
|
|
}
|