From eea2a8326c3ed68ae192fa66c44e2f668696f6f1 Mon Sep 17 00:00:00 2001 From: Graham King Date: Fri, 15 Jan 2021 13:57:11 -0800 Subject: [PATCH] SFU: Register the ssrc-audio-level RTP extension (#373) All major browser negotiate this. Adding it to ion-sfu means it will get passed on to ion-avp, which can then do active speaker detection. I noticed TransportCCURI was video only, and this one is audio only, so I split the registration into two loops. Updates pion/sdp dependency to 3.0.4 --- go.mod | 2 +- go.sum | 2 ++ pkg/sfu/mediaengine.go | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 93d334761..ca0838b16 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/pion/ion-log v1.0.0 github.com/pion/rtcp v1.2.6 github.com/pion/rtp v1.6.2 - github.com/pion/sdp/v3 v3.0.3 + github.com/pion/sdp/v3 v3.0.4 github.com/pion/transport v0.12.2 github.com/pion/turn/v2 v2.0.5 github.com/pion/webrtc/v3 v3.0.3 diff --git a/go.sum b/go.sum index 2b60aab2d..5aa313ed2 100644 --- a/go.sum +++ b/go.sum @@ -309,6 +309,8 @@ github.com/pion/sctp v1.7.11 h1:UCnj7MsobLKLuP/Hh+JMiI/6W5Bs/VF45lWKgHFjSIE= github.com/pion/sctp v1.7.11/go.mod h1:EhpTUQu1/lcK3xI+eriS6/96fWetHGCvBi9MSsnaBN0= github.com/pion/sdp/v3 v3.0.3 h1:gJK9hk+JFD2NGIM1nXmqNCq1DkVaIZ9dlA3u3otnkaw= github.com/pion/sdp/v3 v3.0.3/go.mod h1:bNiSknmJE0HYBprTHXKPQ3+JjacTv5uap92ueJZKsRk= +github.com/pion/sdp/v3 v3.0.4 h1:2Kf+dgrzJflNCSw3TV5v2VLeI0s/qkzy2r5jlR0wzf8= +github.com/pion/sdp/v3 v3.0.4/go.mod h1:bNiSknmJE0HYBprTHXKPQ3+JjacTv5uap92ueJZKsRk= github.com/pion/srtp/v2 v2.0.1 h1:kgfh65ob3EcnFYA4kUBvU/menCp9u7qaJLXwWgpobzs= github.com/pion/srtp/v2 v2.0.1/go.mod h1:c8NWHhhkFf/drmHTAblkdu8++lsISEBBdAuiyxgqIsE= github.com/pion/stun v0.3.5 h1:uLUCBCkQby4S1cf6CGuR9QrVOKcvUwFeemaC865QHDg= diff --git a/pkg/sfu/mediaengine.go b/pkg/sfu/mediaengine.go index 556927fd8..161302ac8 100644 --- a/pkg/sfu/mediaengine.go +++ b/pkg/sfu/mediaengine.go @@ -69,9 +69,12 @@ func getPublisherMediaEngine() (*webrtc.MediaEngine, error) { if err := me.RegisterHeaderExtension(webrtc.RTPHeaderExtensionCapability{URI: extension}, webrtc.RTPCodecTypeVideo); err != nil { return nil, err } - if extension == sdp.TransportCCURI { - continue - } + } + for _, extension := range []string{ + sdp.SDESMidURI, + sdp.SDESRTPStreamIDURI, + sdp.AudioLevelURI, + } { if err := me.RegisterHeaderExtension(webrtc.RTPHeaderExtensionCapability{URI: extension}, webrtc.RTPCodecTypeAudio); err != nil { return nil, err }