From d02fb4ed8e80f0e7997f61ca1a34ef7c5311445b Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Wed, 12 Nov 2025 18:09:53 +0100 Subject: [PATCH] move constant (#5190) --- internal/protocols/webrtc/from_stream.go | 9 +++++++++ internal/protocols/webrtc/outgoing_track.go | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/protocols/webrtc/from_stream.go b/internal/protocols/webrtc/from_stream.go index f950f9e5..dbd125ad 100644 --- a/internal/protocols/webrtc/from_stream.go +++ b/internal/protocols/webrtc/from_stream.go @@ -27,6 +27,15 @@ const ( webrtcPayloadMaxSize = 1188 // 1200 - 12 (RTP header) ) +var multichannelOpusSDP = map[int]string{ + 3: "channel_mapping=0,2,1;num_streams=2;coupled_streams=1", + 4: "channel_mapping=0,1,2,3;num_streams=2;coupled_streams=2", + 5: "channel_mapping=0,4,1,2,3;num_streams=3;coupled_streams=2", + 6: "channel_mapping=0,4,1,2,3,5;num_streams=4;coupled_streams=2", + 7: "channel_mapping=0,4,1,2,3,5,6;num_streams=4;coupled_streams=4", + 8: "channel_mapping=0,6,1,4,5,2,3,7;num_streams=5;coupled_streams=4", +} + var errNoSupportedCodecsFrom = errors.New( "the stream doesn't contain any supported codec, which are currently " + "AV1, VP9, VP8, H265, H264, Opus, G722, G711, LPCM") diff --git a/internal/protocols/webrtc/outgoing_track.go b/internal/protocols/webrtc/outgoing_track.go index b1b63120..075280ff 100644 --- a/internal/protocols/webrtc/outgoing_track.go +++ b/internal/protocols/webrtc/outgoing_track.go @@ -11,15 +11,6 @@ import ( "github.com/pion/webrtc/v4" ) -var multichannelOpusSDP = map[int]string{ - 3: "channel_mapping=0,2,1;num_streams=2;coupled_streams=1", - 4: "channel_mapping=0,1,2,3;num_streams=2;coupled_streams=2", - 5: "channel_mapping=0,4,1,2,3;num_streams=3;coupled_streams=2", - 6: "channel_mapping=0,4,1,2,3,5;num_streams=4;coupled_streams=2", - 7: "channel_mapping=0,4,1,2,3,5,6;num_streams=4;coupled_streams=4", - 8: "channel_mapping=0,6,1,4,5,2,3,7;num_streams=5;coupled_streams=4", -} - // OutgoingTrack is a WebRTC outgoing track type OutgoingTrack struct { Caps webrtc.RTPCodecCapability