Skip to content
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

Fix ftmp matching for all codecs #1912

Open
jech opened this issue Aug 5, 2021 · 1 comment
Open

Fix ftmp matching for all codecs #1912

jech opened this issue Aug 5, 2021 · 1 comment

Comments

@jech
Copy link
Member

jech commented Aug 5, 2021

Pion used to match m lines in SDP by doing a simple comparison of the fmtp lines. This does not work in general, as some fmtp parameters are symmetric (they must have the same value on both sides for the m lines to match) and others are declarative (they only give additional information about what the announcing peer is able to send or receive). It might also be the case that some symmetric parameters can be omitted, indicating that the announcer will accept whatever value the other side finds convenient (not sure, the RFCs are unclear on this subject).

Here's the situation, as far as I can tell from a quick browse of the relevant documents:

@Sean-Der Sean-Der added this to the 4.0.0 milestone Aug 28, 2021
@Sean-Der Sean-Der removed this from the 4.0.0 milestone May 22, 2022
@aler9
Copy link
Member

aler9 commented Jun 10, 2024

The situation is the following:

Symmetric parameters now play a role in matching codecs between senders and receivers, in particular:

The only thing that remains is that the library does not prevent matching incompatible codecs, since there's a fallback matching algorithm that takes into consideration the mime type only:

webrtc/rtpcodec.go

Lines 112 to 117 in 2d529be

// Fallback to just MimeType
for _, c := range haystack {
if strings.EqualFold(c.RTPCodecCapability.MimeType, needle.RTPCodecCapability.MimeType) {
return c, codecMatchPartial
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants