Compile in send-side bandwidth estimation. (#351)
Still not using it. But, now that Pion has merged the initial version of GCC (Google Congestion Control) for send side bandwidth estimation, we can integrate it. We will enable once we have tested and feel comfortable.
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/pion/interceptor"
|
||||
"github.com/pion/interceptor/pkg/cc"
|
||||
"github.com/pion/interceptor/pkg/gcc"
|
||||
"github.com/pion/interceptor/pkg/twcc"
|
||||
"github.com/pion/sdp/v3"
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
||||
@@ -71,8 +74,7 @@ type TransportParams struct {
|
||||
SimTracks map[uint32]SimulcastTrackInfo
|
||||
}
|
||||
|
||||
// LK-TODO-SSBWE func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimator cc.BandwidthEstimator)) (*webrtc.PeerConnection, *webrtc.MediaEngine, error) {
|
||||
func newPeerConnection(params TransportParams) (*webrtc.PeerConnection, *webrtc.MediaEngine, error) {
|
||||
func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimator cc.BandwidthEstimator)) (*webrtc.PeerConnection, *webrtc.MediaEngine, error) {
|
||||
var directionConfig DirectionConfig
|
||||
if params.Target == livekit.SignalTarget_PUBLISHER {
|
||||
directionConfig = params.Config.Publisher
|
||||
@@ -108,7 +110,6 @@ func newPeerConnection(params TransportParams) (*webrtc.PeerConnection, *webrtc.
|
||||
}
|
||||
|
||||
if isSendSideBWE {
|
||||
/* LK-TODO-SSBWE
|
||||
gf, err := cc.NewInterceptor(func() (cc.BandwidthEstimator, error) {
|
||||
return gcc.NewSendSideBWE(
|
||||
gcc.SendSideBWEInitialBitrate(1*1000*1000),
|
||||
@@ -128,7 +129,6 @@ func newPeerConnection(params TransportParams) (*webrtc.PeerConnection, *webrtc.
|
||||
ir.Add(tf)
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
if len(params.SimTracks) > 0 {
|
||||
@@ -149,13 +149,10 @@ func newPeerConnection(params TransportParams) (*webrtc.PeerConnection, *webrtc.
|
||||
}
|
||||
|
||||
func NewPCTransport(params TransportParams) (*PCTransport, error) {
|
||||
/* LK-TODO-SSBWE
|
||||
var bwe cc.BandwidthEstimator
|
||||
pc, me, err := newPeerConnection(params, func(estimator cc.BandwidthEstimator) {
|
||||
bwe = estimator
|
||||
})
|
||||
*/
|
||||
pc, me, err := newPeerConnection(params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -173,11 +170,9 @@ func NewPCTransport(params TransportParams) (*PCTransport, error) {
|
||||
Logger: params.Logger,
|
||||
})
|
||||
t.streamAllocator.Start()
|
||||
/* LK-TODO-SSBWE
|
||||
if bwe != nil {
|
||||
t.streamAllocator.SetBandwidthEstimator(bwe)
|
||||
}
|
||||
*/
|
||||
}
|
||||
t.pc.OnICEGatheringStateChange(func(state webrtc.ICEGathererState) {
|
||||
if state == webrtc.ICEGathererStateComplete {
|
||||
|
||||
Reference in New Issue
Block a user