Closed thatsnotright closed 8 months ago
Attention: 40 lines
in your changes are missing coverage. Please review.
Comparison is base (
450ac84
) 79.73% compared to head (00d52dd
) 79.83%.
Files | Patch % | Lines |
---|---|---|
pkg/jitterbuffer/jitter_buffer.go | 72.72% | 19 Missing and 5 partials :warning: |
pkg/jitterbuffer/priority_queue.go | 85.96% | 12 Missing and 4 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I will work on code coverage, there are a few spots which should get tested that I missed.
Description
This PR adds a very simple jitter buffer for RTP packets. The goal of this is to slowly introduce jitter buffers in places which network jitter can critically impact stream performance without causing unnecessary delay. Right now the heuristic is set at a fixed packet count before moving to the playback state, but this algorithm will be adjusted (and additional dynamic algorithms introduced) in future work.
This jitter buffer relies on a priority queue based on the RTP packet's sequence number. It will insert new packets in priority of sequence number, tracks when its current simplistic total packet count is met to emit a playback event and allows Pop-ing packets off either from the play head (defined as the head position when the jitter buffer met its minimum length) or at a specific timestamp.
For elements which need to exhaust all packets at a specific timestamp, call PopAtTimestamp with the timestamp in a loop and wait for an error response.
More to come, statistics suggestions welcome, as well as any other feedback on approach or suggested algorithms.