Configurable bandwidth estimation side (#298)

* Fix tests

Add back adding track to publishedTracks for testing purposes.

* WIP branch

* Don't know why merge from `master` did not catch this change.

* WIP commit

* Hook up all the bits for TWCC to work

* Fix typo

* WIP commit

* Catch up to latest API

* Move RTP/RTCP info config

* Instantiate GCC/TWCC interceptor only when in use

* comment SSBWE parts

* RTCP feedback in publisher config
This commit is contained in:
Raja Subramanian
2021-12-30 20:09:03 +05:30
committed by GitHub
parent 6f84b36ccf
commit 107e7bbb39
8 changed files with 240 additions and 77 deletions
+12 -8
View File
@@ -25,13 +25,6 @@ import (
"github.com/livekit/livekit-server/pkg/telemetry"
)
var (
FeedbackTypes = []webrtc.RTCPFeedback{
{Type: webrtc.TypeRTCPFBGoogREMB},
{Type: webrtc.TypeRTCPFBNACK},
{Type: webrtc.TypeRTCPFBNACK, Parameter: "pli"}}
)
const (
lostUpdateDelta = time.Second
connectionQualityUpdateInterval = 5 * time.Second
@@ -96,6 +89,8 @@ type MediaTrackParams struct {
AudioConfig config.AudioConfig
Telemetry telemetry.TelemetryService
Logger logger.Logger
SubscriberConfig DirectionConfig
}
func NewMediaTrack(track *webrtc.TrackRemote, params MediaTrackParams) *MediaTrack {
@@ -220,13 +215,22 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
// react-native-webrtc still uses stream based APIs and require this
streamId = PackStreamID(t.params.ParticipantID, t.ID())
}
receiver := NewWrappedReceiver(t.receiver, t.ID(), streamId)
var rtcpFeedback []webrtc.RTCPFeedback
switch t.Kind() {
case livekit.TrackType_AUDIO:
rtcpFeedback = t.params.SubscriberConfig.RTCPFeedback.Audio
case livekit.TrackType_VIDEO:
rtcpFeedback = t.params.SubscriberConfig.RTCPFeedback.Video
}
downTrack, err := sfu.NewDownTrack(webrtc.RTPCodecCapability{
MimeType: codec.MimeType,
ClockRate: codec.ClockRate,
Channels: codec.Channels,
SDPFmtpLine: codec.SDPFmtpLine,
RTCPFeedback: FeedbackTypes,
RTCPFeedback: rtcpFeedback,
}, receiver, t.params.BufferFactory, subscriberID, t.params.ReceiverConfig.PacketBufferSize)
if err != nil {
return err