Skip to content

ECN support - #381

Open
penhauer wants to merge 1 commit into
mainfrom
ecn
Open

penhauer wants to merge 1 commit into
mainfrom
ecn

Conversation

@penhauer

Copy link
Copy Markdown

Just updated ecn's type from uint8 to rtcp.ECN plus actually reading the ECN value from the interceptor attributes.

@codecov

codecov Bot commented Nov 13, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.42%. Comparing base (a921ef9) to head (ade090f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #381      +/-   ##
==========================================
- Coverage   81.54%   81.42%   -0.13%     
==========================================
  Files          91       91              
  Lines        4688     4689       +1     
==========================================
- Hits         3823     3818       -5     
- Misses        691      694       +3     
- Partials      174      177       +3     
Flag Coverage Δ
go 81.42% <100.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/rfc8888/interceptor.go Outdated
Comment thread pkg/rfc8888/interceptor.go Outdated
@JoTurk

JoTurk commented Sep 16, 2026

Copy link
Copy Markdown
Member

I rebased and simplifed this PR.

@JoTurk
JoTurk requested a review from mengelbart September 16, 2026 07:38
Comment thread pkg/ccfb/interceptor.go Outdated
ssrc: header.SSRC,
sequenceNumber: header.SequenceNumber,
ecn: 0, // ECN is not supported (yet).
ecn: uint8(ecn),

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.

we could convert the ecn field to rtcp.ECN, too, because that is what it will be converted back to when we build the report.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's unfortunate because the public API uses uint8 Recorder.AddPacket(..., ecn uint8) I can store it as rtcp.ECN but we'll have a mismatch in types until we break the public API.

@JoTurk JoTurk Sep 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'll do that and move the cast to AddPacket but the other side. Until we can break Recorder.AddPacket

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done we now cast 3 times instead of 1 before :) but we can get rid of them once we break the public API :)

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.

Oh, sorry, I didn't realize that API is public. I'm not sure if there are any downsides of having rtcp.ECN in the public API of this package. If not, I'm fine with breaking it at any time since we're still v0. (I'd also be fine with unexporting the recorder, but I guess that may be really annoying if anyone is using it already...).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

searched both package names "github.com/pion/interceptor/pkg/rfc8888" "NewRecorder(" language:Go -repo:pion/interceptor and it doesn't seem that anyone is using this API, I'll break it :)

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.

It might break the deprecated RFC8888 package that just redirects here, but that should be fine, too.

@JoTurk JoTurk Sep 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah it broke both rfc8888 and ccfb, but removed the casts, from a quick github search nobody used this API from the old package or the new.

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.

We could just drop rfc8888 already, but we can also do it separately from this PR.

Comment thread pkg/ccfb/interceptor_test.go Outdated
@JoTurk
JoTurk force-pushed the ecn branch 3 times, most recently from da4ffd3 to 8fd942e Compare September 16, 2026 08:15
@JoTurk
JoTurk requested a review from mengelbart September 16, 2026 08:16
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.

3 participants