Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to get the bandwidth estimator at NewPeerConnection time #2998

Open
jech opened this issue Jan 8, 2025 · 0 comments
Open

Not possible to get the bandwidth estimator at NewPeerConnection time #2998

jech opened this issue Jan 8, 2025 · 0 comments

Comments

@jech
Copy link
Member

jech commented Jan 8, 2025

I'm looking at switching Galene to TWCC, and I've found this code:

https://github.com/pion/webrtc/blob/master/examples/bandwidth-estimation-from-disk/main.go#L84

The author has run in the same issue as I have in #2994: there is no simple way to have per-PC state in an interceptor. As a result, they are hanging the same interceptor on all peer connections, and using a channel stored in a global variable in order to get their hands on the bandwidth estimator.

Perhaps I'm too simple, but this API feels awkward to me. In the case of Galene, I'm going to have to run a goroutine to listen for bandwidth estimators, and associate them with the tracks that I'm generating. I was expecting to be able to simply create the bandwidth estimator at NewPeerConnection time, and hang it on the data structure that encapsulate's Galene's peer connections.

It seems to me that both this issue and #2994 would be simply solved by allowing to add an interceptor that is not in the registry at NewPeerConnection time, and to allow the interceptor constructor to return arbitrary data. This way, the BWE interceptor could simply return the estimator at construction time, no need for complex callback code, and my NACK interceptor could be constructed with direct access to my data structures.

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

No branches or pull requests

1 participant