Skip to content

Data tracks core - #990

Open
ladvoc wants to merge 14 commits into
ladvoc/data-track-channelfrom
ladvoc/data-track-core
Open

ladvoc wants to merge 14 commits into
ladvoc/data-track-channelfrom
ladvoc/data-track-core

Conversation

@ladvoc

@ladvoc ladvoc commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Adds core types (e.g., info, frame, schema, etc.) and packetizer/depacketizer.

Areas to review:

  • Should some of this implementation be moved to livekit/protocol?

Closes BOT-541

@ladvoc
ladvoc force-pushed the ladvoc/data-track-core branch from f15a229 to b7b6532 Compare September 4, 2026 16:04
@ladvoc
ladvoc marked this pull request as ready for review September 4, 2026 16:07
@ladvoc
ladvoc requested a review from a team as a code owner September 4, 2026 16:07
@ladvoc
ladvoc requested a review from boks1971 September 4, 2026 16:07
devin-ai-integration[bot]

This comment was marked as resolved.

@ladvoc
ladvoc force-pushed the ladvoc/data-track-core branch from b7b6532 to 1c85018 Compare September 4, 2026 22:58
devin-ai-integration[bot]

This comment was marked as resolved.

@ladvoc
ladvoc force-pushed the ladvoc/data-track-core branch from 5572d61 to dc69ba0 Compare September 8, 2026 21:55
Comment thread datatrack/clock.go Outdated
Comment thread datatrack/clock.go
Comment thread datatrack/depacketizer.go
func (d *depacketizer) frameFromSingle(packet dtp.Packet, options depacketizerPushOptions) depacketizerPushResult {
var result depacketizerPushResult
if len(d.partials) >= options.maxPartialFrames {
result.drop = d.evictOldest(packet.FrameNumber)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The single frame has not been appended to the partials, do we still need to evict one?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Single arriving while the partials map is at capacity is treated as a signal that the oldest in-flight partial is stale: the publisher has moved on to a later frame, and on an unordered channel with no retransmits its missing packets aren't coming. It doesn't change what gets dropped (the next Start would evict it anyway), only that the drop is reported promptly and attributed to the frame that actually superseded it. This matches the Rust implementation.

Comment thread datatrack/depacketizer.go
Comment thread datatrack/handle.go Outdated
@ladvoc
ladvoc force-pushed the ladvoc/data-track-core branch 2 times, most recently from c9fa55a to ae3dc6f Compare September 14, 2026 21:28
@ladvoc
ladvoc force-pushed the ladvoc/data-track-core branch from c2ca3f6 to 5692ffc Compare September 14, 2026 21:40
@ladvoc
ladvoc requested a review from cnderrauber September 14, 2026 21:40

@cnderrauber cnderrauber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants