Add vp9 svc support by Dependency Descriptor (#1586)

* Add VP9 SVC support

* Fix preferred fps does not work

* Fix forwarder test
This commit is contained in:
cnderrauber
2023-04-06 21:51:33 +08:00
committed by GitHub
parent 2b16589b79
commit fb301e6e75
6 changed files with 44 additions and 18 deletions
+5 -5
View File
@@ -273,8 +273,8 @@ func (f *Forwarder) DetermineCodec(codec webrtc.RTPCodecCapability) {
case "video/vp8":
f.isTemporalSupported = true
f.vp8Munger = NewVP8Munger(f.logger)
case "video/av1":
// TODO : we only enable dd layer selector for av1 now, at future we can
case "video/av1", "video/vp9":
// TODO : we only enable dd layer selector for av1 and vp9 now, at future we can
// enable it for vp8 too
f.ddLayerSelector = NewDDVideoLayerSelector(f.logger)
}
@@ -515,7 +515,7 @@ func (f *Forwarder) AllocateOptimal(availableLayers []int32, brs Bitrates, allow
}
alloc.TargetLayers = buffer.VideoLayer{
Spatial: int32(math.Min(float64(f.maxPublishedLayer), float64(maxSpatial))),
Temporal: buffer.DefaultMaxLayerTemporal,
Temporal: f.maxLayers.Temporal,
}
}
@@ -570,14 +570,14 @@ func (f *Forwarder) AllocateOptimal(availableLayers []int32, brs Bitrates, allow
alloc.TargetLayers.Spatial = l
}
}
alloc.TargetLayers.Temporal = buffer.DefaultMaxLayerTemporal
alloc.TargetLayers.Temporal = f.maxLayers.Temporal
alloc.RequestLayerSpatial = alloc.TargetLayers.Spatial
} else {
requestLayerSpatial := int32(math.Min(float64(f.maxLayers.Spatial), float64(f.maxPublishedLayer)))
if f.currentLayers.IsValid() && requestLayerSpatial == f.requestLayerSpatial && f.currentLayers.Spatial == f.requestLayerSpatial {
// current is locked to desired, stay there
alloc.TargetLayers = f.currentLayers
alloc.TargetLayers = buffer.VideoLayer{Spatial: f.requestLayerSpatial, Temporal: f.maxLayers.Temporal}
alloc.RequestLayerSpatial = f.requestLayerSpatial
} else {
// opportunistically latch on to anything