Don't wait rtp packet to fire track (#3246)
* Don't wait rtp packet to fire track Create track from sdp instead of first rtp packet, it is consistent with the browser behavior and will accelerate the track publication. * fix test
This commit is contained in:
@@ -260,6 +260,7 @@ type TransportParams struct {
|
||||
AllowPlayoutDelay bool
|
||||
DataChannelMaxBufferedAmount uint64
|
||||
UseOneShotSignallingMode bool
|
||||
FireOnTrackBySdp bool
|
||||
}
|
||||
|
||||
func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimator cc.BandwidthEstimator)) (*webrtc.PeerConnection, *webrtc.MediaEngine, error) {
|
||||
@@ -287,6 +288,10 @@ func newPeerConnection(params TransportParams, onBandwidthEstimator func(estimat
|
||||
// https://github.com/pion/webrtc/pull/2961
|
||||
se.DisableCloseByDTLS(true)
|
||||
|
||||
if params.FireOnTrackBySdp {
|
||||
se.SetFireOnTrackBeforeFirstRTP(true)
|
||||
}
|
||||
|
||||
//
|
||||
// Disable SRTP replay protection (https://datatracker.ietf.org/doc/html/rfc3711#page-15).
|
||||
// Needed due to lack of RTX stream support in Pion.
|
||||
|
||||
Reference in New Issue
Block a user