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:
Raja Subramanian
2022-06-24 22:02:03 +05:30
committed by GitHub
parent 407996702b
commit 46bce33fb8
8 changed files with 236 additions and 112 deletions
+17
View File
@@ -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