From 12bd870d01c61c224c112b2b8bca6baf394eb08d Mon Sep 17 00:00:00 2001 From: "al.bash" Date: Tue, 8 Jul 2025 13:24:24 +0300 Subject: [PATCH 1/2] Add negotiated codec parameters to StreamInfo --- streaminfo.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/streaminfo.go b/streaminfo.go index d622312f..23d8a683 100644 --- a/streaminfo.go +++ b/streaminfo.go @@ -25,6 +25,7 @@ type StreamInfo struct { Channels uint16 SDPFmtpLine string RTCPFeedback []RTCPFeedback + Codecs []RTPCodecParameters } // RTCPFeedback signals the connection to use additional RTCP packet types. @@ -39,3 +40,17 @@ type RTCPFeedback struct { // For example, type="nack" parameter="pli" will send Picture Loss Indicator packets. Parameter string } + +// RTPCodecParameters is a sequence containing the media codecs that an RtpSender +// will choose from, as well as entries for RTX, RED and FEC mechanisms. This also +// includes the PayloadType that has been negotiated +// +// https://w3c.github.io/webrtc-pc/#rtcrtpcodecparameters +type RTPCodecParameters struct { + MimeType string + ClockRate uint32 + Channels uint16 + SDPFmtpLine string + RTCPFeedback []RTCPFeedback + PayloadType uint8 +} From 0b40e433ae24e5ed5a7c3781544c67488e0bc071 Mon Sep 17 00:00:00 2001 From: "al.bash" Date: Tue, 8 Jul 2025 17:00:39 +0300 Subject: [PATCH 2/2] Add only necessary information to StreamInfo --- streaminfo.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/streaminfo.go b/streaminfo.go index 23d8a683..1fa373ac 100644 --- a/streaminfo.go +++ b/streaminfo.go @@ -25,7 +25,7 @@ type StreamInfo struct { Channels uint16 SDPFmtpLine string RTCPFeedback []RTCPFeedback - Codecs []RTPCodecParameters + PayloadToMimeType map[uint8]string } // RTCPFeedback signals the connection to use additional RTCP packet types. @@ -40,17 +40,3 @@ type RTCPFeedback struct { // For example, type="nack" parameter="pli" will send Picture Loss Indicator packets. Parameter string } - -// RTPCodecParameters is a sequence containing the media codecs that an RtpSender -// will choose from, as well as entries for RTX, RED and FEC mechanisms. This also -// includes the PayloadType that has been negotiated -// -// https://w3c.github.io/webrtc-pc/#rtcrtpcodecparameters -type RTPCodecParameters struct { - MimeType string - ClockRate uint32 - Channels uint16 - SDPFmtpLine string - RTCPFeedback []RTCPFeedback - PayloadType uint8 -}