Key frames (#522)

* Key frames

- Keep track of key frame stats
- Split out PLI from down track used for purpose of layer locking.
This will give us a good picture of down stream issues forcing a PLI.
- Use key frame requester whenever there is a layer lock required.
Not just the first key frame. With the synchronous thing, the counter
was just ridiculously high like 150 or something because of all
the initial padding packets. Also, use RTT in key frame requester.

* send first PLI before waiting

* Turn off key frame requester when disabled

* simplify
This commit is contained in:
Raja Subramanian
2022-03-16 19:55:12 +05:30
committed by GitHub
parent 82192f524e
commit 33f9726b79
8 changed files with 127 additions and 36 deletions
+10 -4
View File
@@ -121,7 +121,6 @@ const (
type TranslationParams struct {
shouldDrop bool
isDroppingRelevant bool
shouldSendPLI bool
isSwitchingToMaxLayer bool
rtp *TranslationParamsRTP
vp8 *TranslationParamsVP8
@@ -1144,6 +1143,16 @@ func (f *Forwarder) resyncLocked() {
f.lastSSRC = 0
}
func (f *Forwarder) CheckSync() (locked bool, layer int32) {
f.lock.RLock()
defer f.lock.RUnlock()
layer = f.targetLayers.spatial
locked = f.targetLayers.spatial == f.currentLayers.spatial
return
}
func (f *Forwarder) FilterRTX(nacks []uint16) (filtered []uint16, disallowedLayers [DefaultMaxLayerSpatial + 1]bool) {
if !FlagFilterRTX {
filtered = nacks
@@ -1247,7 +1256,6 @@ func (f *Forwarder) getTranslationParamsVideo(extPkt *buffer.ExtPacket, layer in
return tp, nil
}
tp.shouldSendPLI = false
if f.targetLayers.spatial != f.currentLayers.spatial {
if f.targetLayers.spatial == layer {
if extPkt.KeyFrame {
@@ -1258,8 +1266,6 @@ func (f *Forwarder) getTranslationParamsVideo(extPkt *buffer.ExtPacket, layer in
tp.isSwitchingToMaxLayer = true
}
f.receivedFirstKeyFrame.Store(true)
} else {
tp.shouldSendPLI = true
}
}
}