Do server PLI when sync is required. (#2197)

* Do server PLI when sync is required.

A few changes
- Run key frame requester goroutine always. Runs every 200 ms which is
  not bad.
- Post a key frame request when server knows it needs one, like after an
  allocation. This ensures that the initial request is not delayed.
- Periodic check will ensure PLI for cases like all frame chains of a
  dependency descriptor being broken.

* simplify
This commit is contained in:
Raja Subramanian
2023-10-27 15:16:39 +05:30
committed by GitHub
parent 3633dfe39e
commit a64bd23b6d
3 changed files with 77 additions and 59 deletions
+6 -2
View File
@@ -1374,7 +1374,11 @@ func (f *Forwarder) updateAllocation(alloc VideoAllocation, reason string) Video
func (f *Forwarder) setTargetLayer(targetLayer buffer.VideoLayer, requestLayerSpatial int32) {
f.vls.SetTarget(targetLayer)
f.vls.SetRequestSpatial(requestLayerSpatial)
if targetLayer.IsValid() {
f.vls.SetRequestSpatial(requestLayerSpatial)
} else {
f.vls.SetRequestSpatial(buffer.InvalidLayerSpatial)
}
}
func (f *Forwarder) Resync() {
@@ -1392,7 +1396,7 @@ func (f *Forwarder) resyncLocked() {
}
}
func (f *Forwarder) CheckSync() (locked bool, layer int32) {
func (f *Forwarder) CheckSync() (bool, int32) {
f.lock.RLock()
defer f.lock.RUnlock()