Skip to content

Use rtpbuffer for the jitter buffer#428

Open
mojl wants to merge 12 commits into
pion:mainfrom
mojl:jitterbuffer-use-rtpbuffer
Open

Use rtpbuffer for the jitter buffer#428
mojl wants to merge 12 commits into
pion:mainfrom
mojl:jitterbuffer-use-rtpbuffer

Conversation

@mojl

@mojl mojl commented Jul 20, 2026

Copy link
Copy Markdown

Description

Use rtpbuffer for the jitter buffer (as suggested by Sean in #278). I am using a ring buffer (as rtpbuffer packets can be overwritten any time) for the playback buffer and it accepts retainable packets too so it uses the buffer pool too.

I tried to keep the behavior of the API as 1:1 as possible, but the differences are:

  • Emitting starts when we have X amount of sequential packets, not just any packets (minStartCount).
  • All forms of Pop do move the playoutHead to that sequance number.
  • The default capacity is now 1024, as keyframes can be big sometimes.

Working on: receiver interceptor, unit tests for the ring buffer, and a NoCopy option.

@mojl

mojl commented Jul 21, 2026

Copy link
Copy Markdown
Author

The interceptor now supports this new jitter buffer, supports multiple tracks/streams, and accepts options for building the jitter buffer.

I've added the #255 fix since it was stopping me from testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant