From e3597d780d4a2899ed948ece04d8e65749fc4c70 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Thu, 18 Jul 2024 14:49:04 +0800 Subject: [PATCH] Update pion to handle different extensions in two media section (#2878) Also remove the code to disable DD extension for vp8/h264, it cause DD can't be processed if the first video track is non-svc codec. --- go.mod | 2 +- go.sum | 4 ++-- pkg/rtc/participant_sdp.go | 13 ------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index aeb66c6a0..7af9f3998 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/pion/sdp/v3 v3.0.9 github.com/pion/transport/v2 v2.2.5 github.com/pion/turn/v2 v2.1.6 - github.com/pion/webrtc/v3 v3.2.46 + github.com/pion/webrtc/v3 v3.2.47 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.19.1 github.com/redis/go-redis/v9 v9.5.4 diff --git a/go.sum b/go.sum index d1dbab068..64e5e45f0 100644 --- a/go.sum +++ b/go.sum @@ -272,8 +272,8 @@ github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37 github.com/pion/turn/v2 v2.1.3/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= github.com/pion/turn/v2 v2.1.6 h1:Xr2niVsiPTB0FPtt+yAWKFUkU1eotQbGgpTIld4x1Gc= github.com/pion/turn/v2 v2.1.6/go.mod h1:huEpByKKHix2/b9kmTAM3YoX6MKP+/D//0ClgUYR2fY= -github.com/pion/webrtc/v3 v3.2.46 h1:0KmTC2GaeHe9ork3fGy0MFoStAqbGs8mwGufRCIT9a4= -github.com/pion/webrtc/v3 v3.2.46/go.mod h1:g7pwdiN9Gj2zZZlSTW5XC7OzrgHS9QzRM0y+O2jtjVg= +github.com/pion/webrtc/v3 v3.2.47 h1:2DrJ7YnxiZVcmVA+HRyyACCSYvVW8E1YpOvF/EXeRYI= +github.com/pion/webrtc/v3 v3.2.47/go.mod h1:g7pwdiN9Gj2zZZlSTW5XC7OzrgHS9QzRM0y+O2jtjVg= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/pkg/rtc/participant_sdp.go b/pkg/rtc/participant_sdp.go index d3fae1577..0ee4b60ae 100644 --- a/pkg/rtc/participant_sdp.go +++ b/pkg/rtc/participant_sdp.go @@ -22,7 +22,6 @@ import ( "github.com/pion/sdp/v3" "github.com/pion/webrtc/v3" - dd "github.com/livekit/livekit-server/pkg/sfu/rtpextension/dependencydescriptor" "github.com/livekit/protocol/livekit" lksdp "github.com/livekit/protocol/sdp" ) @@ -152,18 +151,6 @@ func (p *ParticipantImpl) setCodecPreferencesVideoForPublisher(offer webrtc.Sess p.pendingTracksLock.RUnlock() mime = strings.ToUpper(mime) - // remove dd extension if av1/vp9 not preferred - if !strings.Contains(strings.ToLower(mime), "av1") && !strings.Contains(strings.ToLower(mime), "vp9") { - for i, attr := range unmatchVideo.Attributes { - if strings.Contains(attr.Value, dd.ExtensionURI) { - unmatchVideo.Attributes[i] = unmatchVideo.Attributes[len(unmatchVideo.Attributes)-1] - unmatchVideo.Attributes[len(unmatchVideo.Attributes)-1] = sdp.Attribute{} - unmatchVideo.Attributes = unmatchVideo.Attributes[:len(unmatchVideo.Attributes)-1] - break - } - } - } - if mime != "" { codecs, err := codecsFromMediaDescription(unmatchVideo) if err != nil {