Cache and restore forwarder state on resume (#786)
* WIP commit * Clean up * spelling mistake * Run subscribed track onBind in a go routine * Address comments and more safety net * Cache and restore forwarder state on resume * conflicts * mage generate
This commit is contained in:
@@ -36,6 +36,11 @@ type SnTs struct {
|
||||
timestamp uint32
|
||||
}
|
||||
|
||||
type RTPMungerState struct {
|
||||
LastSN uint16
|
||||
LastTS uint32
|
||||
}
|
||||
|
||||
type RTPMungerParams struct {
|
||||
highestIncomingSN uint16
|
||||
lastSN uint16
|
||||
@@ -75,6 +80,18 @@ func (r *RTPMunger) GetParams() RTPMungerParams {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *RTPMunger) GetLast() RTPMungerState {
|
||||
return RTPMungerState{
|
||||
LastSN: r.lastSN,
|
||||
LastTS: r.lastTS,
|
||||
}
|
||||
}
|
||||
|
||||
func (r *RTPMunger) SeedLast(state RTPMungerState) {
|
||||
r.lastSN = state.LastSN
|
||||
r.lastTS = state.LastTS
|
||||
}
|
||||
|
||||
func (r *RTPMunger) SetLastSnTs(extPkt *buffer.ExtPacket) {
|
||||
r.highestIncomingSN = extPkt.Packet.SequenceNumber - 1
|
||||
r.lastSN = extPkt.Packet.SequenceNumber
|
||||
|
||||
Reference in New Issue
Block a user