-
-
Notifications
You must be signed in to change notification settings - Fork 229
Description
DelayedReader is pipeline elements that inserts initial delay in the stream, by accumulating packets until there is enough of them, and only then forwarding them.
LatencyTuner is a class that monitors and adjusts latency on fly.
Currently, they work independently. DelayedReader unconditionally inserts initial delay and then enters "normal" mode (just forwards packets through it). We want to change it, so that LatencyTuner will decide when initial delay is done and tell DelayedReader to finish delay and enter normal mode.
This refactoring would allow us (in future) to control initial delay dynamically (#712, #127).
Steps
-
Rework
DelayedReader
. Removetarget_delay
parameter and instead add new methodsis_started()
andstart()
. Until start() is called,DelayedReader
accumulates packets. When it's called, it enters normal mode.- Unit tests for DelayedReader should be updated as well.
-
Update
LatencyTuner
. Add new methodcan_start()
. It starts returning true whenactual_latency
calculated inupdate_stream()
became>= target_latency
. -
Update
LatencyMonitor
. It is a class that glues multiple latency-related classes together. Pass a reference to DelayedReader to LatencyMonitor. Inpre_read_()
, check if DelayedReaderis_started()
. If not, ask LatencyTuner if wecan_start()
. If yes,start()
Delay reader.
After this, all tests (except unit tests for DelayedReader) should continue working without modification. roc_pipeline tests cover initial delay, so if they pass, we've done everything right.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status