-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix BindRemoteStream StreamInfo #3157
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 #3157 +/- ##
==========================================
+ Coverage 78.03% 78.21% +0.18%
==========================================
Files 93 93
Lines 11769 11802 +33
==========================================
+ Hits 9184 9231 +47
+ Misses 2074 2062 -12
+ Partials 511 509 -2
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:
|
fe60c5b
to
0e25e1a
Compare
f68bda4
to
5d25e38
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.
I'm outside today, looking at the code from my phone, this is a step in the right direction to fix that part of pion, thank you so much.
Just one thing, can we add a test because it's easy to break this change?
@JoeTurki Thanks for review! Sure, I will look into existing tests to see how to test this kind of things properly. |
5d25e38
to
5e75e69
Compare
d59897b
to
46062ad
Compare
@JoeTurki I refactored the code a bit for better testability and add test cases for video stream only and video + RTX, this is ready for review again. No rush :) |
46062ad
to
a969355
Compare
@arjunshajitech |
Just to clarify, I said that |
Thank you so much @arjunshajitech ! I hope this PR's refactor doesn't change any current behavior and logic, only improves testability so that reviewing is easier. Do you mind opening another PR to make the change? |
@3DRX, do you think that it would be better to feed RTX/FEC packets to the same stream as the media packets? These streams are not separate in BindLocalStream, so it looks a bit inconsistent from the interceptor's point of view. It's a breaking change, so it could be done using the SettingsEngine I guess. Of course it's not a blocker for this PR, which is definitely a step in the right direction. |
Yes, it definately would be better imo. Current way of handling RTX is quite unintuitive to me, with |
@3DRX, I'm concerned not only about breaking RTX implementation in users' interceptors, but also about breaking the existing interceptors' logic which expects packets of only one SSRC inside the stream. We even have this kind of logic in pion's interceptors, which would require fixes. Some examples: Send side. Receive side. |
a969355
to
926f532
Compare
@JoeTurki @aalekseevx have a good point here, I guess we can also mark this as a reasonable breaking change in future major version? This won’t block this PR though, it’s ready to be merged on my side. Thanks guys :) |
Maybe it's time to start making a v5 milestone? and aim for jan 2026? |
926f532
to
e5a9e5a
Compare
@JoeTurki So sorry I missed this, sure we can make the milestone, there's a couple of things I think worth a breaking change. |
@jech Can you please look at this? Will it break any behavior for Galene? |
@3DRX I would love to hear all your ideas on how to make Pion better! In the past I used the Wiki, but w/e you prefer works for me https://github.com/pion/webrtc/wiki/Big-Ideas My hope/goal is to try and squeeze peoples ideas in without an API break :) |
@Sean-Der Hi, I've updated https://github.com/pion/webrtc/wiki/Big-Ideas, please check it out, thanks :) |
The change is a net positive, it only adds more data to previously unused fields. On the other hand, I don't think it solves any of the fundamental issues we have, which make the RTX/FEC tracks unusable in practice. It's a difficult problem. Pion aims at being suitable both for high-level applications (streaming a video as simply as possible), and at low-level software (high-performance SFUs). The difficultly lies in designing an API that is transparent to high-level software (create a track and get RTX/FEC handling for free) and low-level software (full control on RTX/FEC, let the SFU decide whether to forward FEC or terminate FEC and regenerate it). I don't currently see a good solution. I'd like people to join my suffering by having a look at
as well as the following patch series: |
Provide correct StreamInfo to receiver interceptors
Before this change, interceptor's
BindRemoteStream
gets called twice per track when RTX is used, with only the SSRC being different. Hence, the interceptor can't distinguish between RTX track and video track.After this change, interceptor's
BindRemoteStream
gets called twice, the first time bind to video track, second time bind to RTX track, like this.With this change, interceptor can implement internal logic to handle rtx track with video track. This will also make implementing
BindRemoteStream
to FEC track in the future easier.This shouldn't break anything, since this PR only adds new data (that's originally always 0) to StreamInfo.