-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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.67% 78.64% -0.04%
==========================================
Files 91 91
Lines 11496 11529 +33
==========================================
+ Hits 9045 9067 +22
- Misses 1958 1966 +8
- Partials 493 496 +3
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? |
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.