-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Automatically configure RTX codecs #3095
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3095 +/- ##
==========================================
+ Coverage 78.59% 78.65% +0.06%
==========================================
Files 91 91
Lines 11372 11409 +37
==========================================
+ Hits 8938 8974 +36
- Misses 1944 1946 +2
+ Partials 490 489 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
829ec33
to
4aceefe
Compare
8e565be
to
c46152e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary concerns about this pull request are:
We should only introduce new settings if they improve behavior by aligning more closely with the specification, and we can't break existing behavior. or a options that cannot be configured otherwise for example, SetNAT1To1IPs.
I think we should try to minimize the number of settings to keep the API as compatible with the JavaScript API as possible, especially considering that i think most users are unaware of the existence of the settingsEngine :)
I'm not convinced where this change would fit, and it appears to make assumptions about how the other side implements RTX and NACK
What do you think @Sean-Der @jech
Thank you so much @3DRX
SDPFmtpLine: fmt.Sprintf("apt=%d", codec.PayloadType), | ||
RTCPFeedback: nil, | ||
}, | ||
PayloadType: codec.PayloadType + 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can cause conflicts, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, currently this PR’s behavior when conflict occurs is to return an error in api.NewPeerConnection.
@JoeTurki I understands your concerns, if it’s not that straightforward and beneficial to pion/webrtc, do you think it’s a good idea to have this behavior to be enabled when user is using pion/mediadevices? Although the spec doesn’t describe anything about setting RTX by default, this can make the default behavior closer to libwebrtc. |
I think this shouldn’t be a problem, since the rtx is added before sdp negotiations, and even if a rtx added when remote doesn’t support rtx and nack, the rtx track will always be empty(since no nack packets generated and received, no rtx packets will be send). |
@3DRX I am going to start an issue. I think we can default this to on! We have multiple issues and I want to make sure we get things right (not break something and regret it)
My goal
|
Thanks for reviewing this @JoeTurki :) |
@Sean-Der I’d like to help on fixing the current issues! It seems to only affect pion as a receiver, this PR is all about pion as a sender. I think the issue (A RTX doesn't stop Pion from sending NACKs) won’t block this PR’s work. |
There’ve been quite a lot going on here: #3063. @arjunshajitech did a refactor to fix the issue, but it breaks current interceptor interface. Don’t know if it’s possible to change it at this point. |
What happens if the remote supports NACK but not RTX? That's the case of most Pion applications. |
If the remote doesn't support RTX, the sdp response shouldn't contain the RTX track, and the rtx codec won't be treated as negotiated, which is fine I guess (changes in this PR doesn't force sending retransmission through RTX, it just automatically configures them for the user)? I'm planning to, but haven't build any WebRTC receivers myself using pion so please correct me if I'm wrong. I think pion's receiver will support RTX well after #3063 is fixed, which according to @Sean-Der 's issue that tracks a series of work should be merged together with this PR. |
To be fair, we're trying to achieve something difficult: a library that is both flexible enough to be used for low-level stuff (such as highly efficient SFUs) and easy to use for typical applications. Since we're exposing both low- and high-level functionality, we need to get the layering just right. There's also #2994. |
935e0e6
to
de111a8
Compare
Description
Add a setting engine flag to enable automatically configure RTX codecs in
MediaEngine
.api.NewPeerConnection
.