mirror of
https://github.com/livekit/livekit.git
synced 2026-05-25 09:54:41 +00:00
Add dependency descriptor stream tracker for svc codecs (#1788)
* Add dependency descriptor stream tracker for svc codecs * Solve comments
This commit is contained in:
@@ -94,9 +94,8 @@ type Buffer struct {
|
||||
logger logger.Logger
|
||||
|
||||
// dependency descriptor
|
||||
ddExt uint8
|
||||
ddParser *DependencyDescriptorParser
|
||||
maxLayerChangedCB func(int32, int32)
|
||||
ddExt uint8
|
||||
ddParser *DependencyDescriptorParser
|
||||
|
||||
paused bool
|
||||
frameRateCalculator [DefaultMaxLayerSpatial + 1]FrameRateCalculator
|
||||
@@ -175,9 +174,6 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili
|
||||
b.frameRateCalculator[i] = frc.GetFrameRateCalculatorForSpatial(int32(i))
|
||||
}
|
||||
b.ddParser = NewDependencyDescriptorParser(b.ddExt, b.logger, func(spatial, temporal int32) {
|
||||
if b.maxLayerChangedCB != nil {
|
||||
b.maxLayerChangedCB(spatial, temporal)
|
||||
}
|
||||
frc.SetMaxLayer(spatial, temporal)
|
||||
})
|
||||
|
||||
@@ -779,12 +775,6 @@ func (b *Buffer) GetAudioLevel() (float64, bool) {
|
||||
return b.audioLevel.GetLevel()
|
||||
}
|
||||
|
||||
// DD-TODO : now we rely on stream tracker for layer change, dependency still
|
||||
// work for that too. Do we keep it unchanged or use both methods?
|
||||
func (b *Buffer) OnMaxLayerChanged(fn func(int32, int32)) {
|
||||
b.maxLayerChangedCB = fn
|
||||
}
|
||||
|
||||
func (b *Buffer) OnFpsChanged(f func()) {
|
||||
b.Lock()
|
||||
b.onFpsChanged = f
|
||||
|
||||
Reference in New Issue
Block a user