Add RTX to downstream (#3247)

* Add RTX to downstream

* test
This commit is contained in:
Raja Subramanian
2024-12-13 09:57:03 +05:30
committed by GitHub
parent 79eda6b72b
commit 789d0484e2
6 changed files with 72 additions and 28 deletions
+3 -7
View File
@@ -24,10 +24,6 @@ import (
"github.com/livekit/protocol/livekit"
)
const (
videoRTXMimeType = "video/rtx"
)
var OpusCodecCapability = webrtc.RTPCodecCapability{
MimeType: webrtc.MimeTypeOpus,
ClockRate: 48000,
@@ -41,7 +37,7 @@ var RedCodecCapability = webrtc.RTPCodecCapability{
SDPFmtpLine: "111/111",
}
var videoRTX = webrtc.RTPCodecCapability{
MimeType: videoRTXMimeType,
MimeType: webrtc.MimeTypeRTX,
ClockRate: 90000,
}
@@ -137,7 +133,7 @@ func registerCodecs(me *webrtc.MediaEngine, codecs []*livekit.Codec, rtcpFeedbac
if filterOutH264HighProfile && codec.RTPCodecCapability.SDPFmtpLine == h264HighProfileFmtp {
continue
}
if codec.MimeType == videoRTXMimeType {
if strings.EqualFold(codec.MimeType, webrtc.MimeTypeRTX) {
continue
}
if IsCodecEnabled(codecs, codec.RTPCodecCapability) {
@@ -147,7 +143,7 @@ func registerCodecs(me *webrtc.MediaEngine, codecs []*livekit.Codec, rtcpFeedbac
if rtxEnabled {
if err := me.RegisterCodec(webrtc.RTPCodecParameters{
RTPCodecCapability: webrtc.RTPCodecCapability{
MimeType: videoRTXMimeType,
MimeType: webrtc.MimeTypeRTX,
ClockRate: 90000,
SDPFmtpLine: fmt.Sprintf("apt=%d", codec.PayloadType),
},
+1 -1
View File
@@ -3017,7 +3017,7 @@ func (p *ParticipantImpl) setupEnabledCodecs(publishEnabledCodecs []*livekit.Cod
func (p *ParticipantImpl) GetEnabledPublishCodecs() []*livekit.Codec {
codecs := make([]*livekit.Codec, 0, len(p.enabledPublishCodecs))
for _, c := range p.enabledPublishCodecs {
if c.Mime == "video/rtx" {
if strings.EqualFold(c.Mime, webrtc.MimeTypeRTX) {
continue
}
codecs = append(codecs, c)