Handle repair SSRC of simulcast tracks during migration. (#4193)
* Handle repair SSRC of simulcast tracks during migration. * fix * fix comment
This commit is contained in:
@@ -68,6 +68,7 @@ type Buffer struct {
|
||||
onClose func()
|
||||
onRtcpFeedback func([]rtcp.Packet)
|
||||
onFinalRtpStats func(*livekit.RTPStats)
|
||||
onNotifyRTX func(uint32, uint32, string)
|
||||
|
||||
primaryBufferForRTX *Buffer
|
||||
rtxPktBuf []byte
|
||||
@@ -219,6 +220,12 @@ func (b *Buffer) SetPrimaryBufferForRTX(primaryBuffer *Buffer) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) NotifyRTX(ssrc uint32, repairSSRC uint32, rsid string) {
|
||||
if onNotifyRTX := b.getOnNotifyRTX(); onNotifyRTX != nil {
|
||||
onNotifyRTX(ssrc, repairSSRC, rsid)
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) writeRTX(rtxPkt *rtp.Packet, arrivalTime int64) {
|
||||
b.Lock()
|
||||
defer b.Unlock()
|
||||
@@ -435,3 +442,16 @@ func (b *Buffer) getOnFinalRtpStats() func(*livekit.RTPStats) {
|
||||
|
||||
return b.onFinalRtpStats
|
||||
}
|
||||
|
||||
func (b *Buffer) OnNotifyRTX(fn func(ssrc uint32, repairSSRC uint32, rsid string)) {
|
||||
b.Lock()
|
||||
b.onNotifyRTX = fn
|
||||
b.Unlock()
|
||||
}
|
||||
|
||||
func (b *Buffer) getOnNotifyRTX() func(ssrc uint32, repairSSRC uint32, rsid string) {
|
||||
b.RLock()
|
||||
defer b.RUnlock()
|
||||
|
||||
return b.onNotifyRTX
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user