-
Notifications
You must be signed in to change notification settings - Fork 115
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
Modifications to [[SendEncodings]] from setParameters and sRD can be racy #2737
Comments
@docfaraday mentioned offline a similar issue with addTrack and SRD(simulcastOffer). |
My sense is there are two aspects to this problem:
1 seems more problematic to me than 2. IOW, if setParameters were a three-way merge (soving 1) then the only remaining problem would seem to be 2 which seems fine since it's an inherent race between parties (a few milliseconds earlier and you'd get one outcome, vs. a few milliseconds later and you'd get the other). |
After more offline discussion, it seems like this particular question (what to do when setParameters races against sRD(simulcast offer)) depends on what the expected behavior is in the non-racy case. So if JS calls addTrack, then performs a get/setParameters cycle (which will have one encoding), what should be done with a subsequent sRD(simulcast offer)? Do we interpret the unicast get/setParameters cycle as establishing unicast, and reject the simulcast in our answer? Do we have the sRD(simulcast offer) stomp the encodings entirely? Or do we try to merge the two parameter sets somehow? |
Also, we need to deal with setParameters racing against rollback. |
There are a handful of types of race here, on further thought. addTrack, then a race between sRD(simulcast recv offer) and setParameters(unicast)
a race between sRD(unicast reoffer/answer/reanswer) and setParameters(simulcast)
a race between sRD(rollback of a unicast reoffer) and setParameters(unicast)
a race between sRD(rollback of initial simulcast offer) and setParameters(simulcast)
I think the simplest way to handle all of these is to mimic what we do when addTrack races against sRD. Let the setParameters finish, and then re-do the sRD(whatever). |
setParameters has the following flow in brief:
sRD(answer) can reject an offered simulcast, which also results in a modification to [[SendEncodings]] (by truncating to size 1). It seems like it would be fairly easy for a message handler to call sRD(answer) so that the truncation happens between steps 1 and 2, or steps 2 and 3.
The text was updated successfully, but these errors were encountered: