Return max spatial layer from selectors. (#1743)

* Return max spatial layer from selectors.

With differing requirements of SVC and allowing overshoot in Simulcast,
selectors are best placed to indicate what is the max spatial layer when
they indicate a switch to max spatial layer.

* fix test

* prevent race
This commit is contained in:
Raja Subramanian
2023-05-26 12:49:31 +05:30
committed by GitHub
parent fc8375f150
commit 1c920812d3
8 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -624,7 +624,7 @@ func (d *DownTrack) WriteRTP(extPkt *buffer.ExtPacket, layer int32) error {
d.bytesSent.Add(uint32(hdr.MarshalSize() + len(payload)))
if tp.isSwitchingToMaxSpatial && d.onMaxSubscribedLayerChanged != nil && d.kind == webrtc.RTPCodecTypeVideo {
d.onMaxSubscribedLayerChanged(d, d.forwarder.MaxLayer().Spatial)
d.onMaxSubscribedLayerChanged(d, tp.maxSpatialLayer)
}
if extPkt.KeyFrame {