-
Notifications
You must be signed in to change notification settings - Fork 114
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
Clarify a=rtpmap codec mappings should be offered even if the codec is not a preferred one #2932
Comments
https://www.rfc-editor.org/rfc/rfc8829.html#section-5.3.1 updates this in the bullet points following
I do not think those "unidirectional use-cases" are well supported or tested currently and would not push this further without a clear need. |
pc1 should be able to ask for VP8 and pc2 ask for H264 and it should work, but on Chromium the following fiddle results in VP8 in both directions: https://jsfiddle.net/henbos/1vzjybs3/ When we setCodecPreferences, we don't just filter out the preferences, we filter out the codecs, and it doesn't seem to add new codecs either IDK |
Which is expected and how things have been behaving like this for a decade. And as https://wpt.fyi/results/webrtc/protocol/additional-codecs.html?label=experimental&label=master&aligned shows adding H264 in the answer causes H264 to be sent by pc1 so we have forward compability for whenever implementations feel motivated to implement what JSEP suggested (as an optional thing I believe) I'm open to the argument that setCodecPreferences should not restrict the codecs pc1 offers but this introduces a compability risk without clear benefits. |
It's good for compat that adding H264 via SDP munging works already. But how do I ask to receive VP8 and have the other endpoint ask to receive H264 using You could tweak it to list both |
There was a bug in the fiddle (by awaiting Fixed and it works for the case of offer This may be good or it may be bad depending on what we want to do with unidirectional codecs. |
This isn't munging, this is signaling ;-)
That is not what setCodecPreferences does, it only controls receive preferences. We have answer handling for additional codecs but we do not have anything in offers. https://www.rfc-editor.org/rfc/rfc8829.html#section-5.2.1 is quite specific:
and that is what we are doing? |
What we're seeing is not being allowed to prefer to receive H264 unless the offerer is preferring to receive it too. This is fine for codecs that work in both directions because you can always swap preference order and use the codec you don't want to use as a fallback, but it makes little sense for unidirectional codecs. Whether we want to solve this or not is up to us, there are workarounds like modifying SDP (in a legal way) or preferring to receive something you can't receive knowing the other endpoint will swap orders. Just because you can shoot yourself in the foot doesn't mean you will. |
Heeey, we're already dealing with unidirectionality with this filtering:
This means that if I want to use a sendonly codec WITHOUT having to modify SDP I simply ensure the transceiver is sendonly. And if I want to do sendrecv, then I can always modify SDP, but nobody is forcing me to do this. I think no changes are needed but we should add more WPTs. Yay. |
Oh but the plot thickens, it's not possible to setCodecPreferences([send-only codec]) if #2926 lands |
preferring to receive on a send-only codec is kind of silly, so that would be a feature not a bug.... |
If But if the direction is
|
@fippo Explained to me that the fact that we have to SDP munge to add H264 in the |
It is a missing feature in the implementation, in particular the
from https://www.rfc-editor.org/rfc/rfc8829.html#name-initial-answers I did tinker with a recv-only codec and setting the transceiver direction to sendonly: |
Yeah this to me is an argument for allowing to "prefer to receive send codecs" and let the But while this helps sendonly transceiver with sendonly codec use case, it also adds complexity and confusion, so probably best to keep it simple: setting preference is the same thing as setting receive codecs. |
This is the sentence that I proposed to delete in #2926 because it doesn't make sense when we consider If we delete this sentence, then the fact that we don't exclude it is a feature, but if we don't delete it, it is a bug. |
Pilot error previously, deleted that comment. So there is a change of behavior in what I am proposing: With my change it bails out in setLocalDescription. Further splitting this up into createOffer + SLD shows that the offer is created with a rejected m-line. This gets rejected by Chromium because
which I believe to be a bogus error since it is attempting to set receive parameters on a m-line marked as rejected. |
In general this needs to stay. The current behavior is not to include recvonly codecs on a sendrecv m-line. We can not and should not change that. The consequence of doing something foolish is the transceiver being stopped after SLD (I hope... we currently don't get there) |
I can argue either way on that one. The sad consequence is it that the receiving endpoint does not know which profiles the sending endpoint supports. So we're designing the API in a way where you have to signal codec capabilities outside of the SDP instead of simply including them in the This problem goes away if we allow a=rtpmap to not be filtered out while preferences is filtered out. Doesn't that make more sense somehow? |
JSEP says we MUST NOT do that. I assume the reason is that the answerer could interpret such codecs as codecs we are willing to receive. I've addressed the SLD failure from https://jsfiddle.net/fippo/r63bp8d2/2/ with my change, turned out to be a fairly trivial implementation issue. The new behavior if you set a receive-only codec via sCP and set the direction to sendonly is that the transceiver is stopped by SLD. |
Perfect, if JSEP forbids, we don't even need to discuss this. sCP is just received codecs, the app picking codecs that works is the app's problem |
My reading of RFC3264, section 6.1 leads me to believe that in sendrecv and recvonly use cases, the answerer has no choice but to have at least one receive codec that was in the offer. So even though it can add its own codecs, there has to be some codec in common between offerer and answerer.
In order to support unidirectional use cases (pc1 prefers X, pc2 prefers Y), pc1 has to list codec Y in the offer even though it is not in its preference list and has no intention of ever receiving it. In other words the
a=rtpmap
list of codecs is a separate list of codecs than thea=audio/video
preference list.Proposal: Add a NOTE under
setCodecPreferences
explaining that the preference list only affects thea=audio/video
line, not which codecs get a PT. And we need test coverage that removing a codec from the preference list does not prevent it getting a PT.IIUC...
The text was updated successfully, but these errors were encountered: