Add ability to roll back video layer selection. (#1871)

* Add ability to roll back video layer selection.

Not currently useful, but it is possible to do things like not
applying a layer switch if the switch point time stamp is too far back.

Add ability to roll back a layer switch and invoke rollback if
a packet was selected for forwarding, but a subsequent error or decision
to drop the packet can rollback layer switch if that was the switching
packet.

In current code, the paths where a packet can be dropped after selection
does not happen at switch points. So, it was okay to apply the selection
unconditionally. But, adding the call to rollback in the current code
also in all paths where packet is dropped after selection for consistent
code flow.

* separate switch for temporal layer
This commit is contained in:
Raja Subramanian
2023-07-12 14:12:00 +05:30
committed by GitHub
parent ed867fafe5
commit 8dc2c005c3
6 changed files with 179 additions and 128 deletions
@@ -8,6 +8,7 @@ import (
type VideoLayerSelectorResult struct {
IsSelected bool
IsRelevant bool
IsSwitching bool
IsResuming bool
IsSwitchingToRequestSpatial bool
IsSwitchingToMaxSpatial bool
@@ -46,5 +47,6 @@ type VideoLayerSelector interface {
GetCurrent() buffer.VideoLayer
Select(extPkt *buffer.ExtPacket, layer int32) VideoLayerSelectorResult
SelectTemporal(extPkt *buffer.ExtPacket) int32
SelectTemporal(extPkt *buffer.ExtPacket) (int32, bool)
Rollback()
}