diff --git a/pkg/sfu/buffer/buffer.go b/pkg/sfu/buffer/buffer.go index 8e79e0d31..0fd76a420 100644 --- a/pkg/sfu/buffer/buffer.go +++ b/pkg/sfu/buffer/buffer.go @@ -229,7 +229,7 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili for _, ext := range params.HeaderExtensions { switch ext.URI { case dd.ExtensionURI: - if IsSvcCodec(codec.MimeType) { + if IsSvcCodec(codec.MimeType) || strings.EqualFold(codec.MimeType, webrtc.MimeTypeVP8) { if b.ddExtID != 0 { b.logger.Warnw("multiple dependency descriptor extensions found", nil, "id", ext.ID, "previous", b.ddExtID) continue diff --git a/pkg/sfu/codecmunger/vp8.go b/pkg/sfu/codecmunger/vp8.go index 3c89d2e1a..696c355b1 100644 --- a/pkg/sfu/codecmunger/vp8.go +++ b/pkg/sfu/codecmunger/vp8.go @@ -226,7 +226,7 @@ func (v *VP8) UpdateAndGet(extPkt *buffer.ExtPacket, snOutOfOrder bool, snHasGap // which layer the missing packets belong to. A layer could have multiple packets. So, keep track // of pictures that are forwarded even though they will be filtered out based on temporal layer // requirements. That allows forwarding of the complete picture. - if vp8.T && vp8.TID > uint8(maxTemporalLayer) { + if extPkt.Temporal > maxTemporalLayer { v.exemptedPictureIds.Set(extPictureId, true) // trim cache if necessary for v.exemptedPictureIds.Len() > exemptedPictureIdsThreshold { @@ -235,7 +235,7 @@ func (v *VP8) UpdateAndGet(extPkt *buffer.ExtPacket, snOutOfOrder bool, snHasGap } } } else { - if vp8.T && vp8.TID > uint8(maxTemporalLayer) { + if extPkt.Temporal > maxTemporalLayer { // drop only if not exempted _, ok := v.exemptedPictureIds.Get(extPictureId) if !ok { diff --git a/pkg/sfu/testutils/data.go b/pkg/sfu/testutils/data.go index 49d5521a9..7f7c96872 100644 --- a/pkg/sfu/testutils/data.go +++ b/pkg/sfu/testutils/data.go @@ -85,6 +85,9 @@ func GetTestExtPacketVP8(params *TestExtPacketParams, vp8 *buffer.VP8) (*buffer. ep.KeyFrame = vp8.IsKeyFrame ep.Payload = *vp8 + if ep.DependencyDescriptor == nil { + ep.Temporal = int32(vp8.TID) + } return ep, nil } diff --git a/pkg/sfu/videolayerselector/temporallayerselector/vp8.go b/pkg/sfu/videolayerselector/temporallayerselector/vp8.go index 2d2660897..c0a86c4f2 100644 --- a/pkg/sfu/videolayerselector/temporallayerselector/vp8.go +++ b/pkg/sfu/videolayerselector/temporallayerselector/vp8.go @@ -37,13 +37,13 @@ func (v *VP8) Select(extPkt *buffer.ExtPacket, current int32, target int32) (thi } vp8, ok := extPkt.Payload.(buffer.VP8) - if !ok || !vp8.T { + if !ok { return } - tid := int32(vp8.TID) + tid := extPkt.Temporal if current < target { - if tid > current && tid <= target && vp8.S && vp8.Y { + if tid > current && tid <= target && vp8.S { this = tid next = tid }