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

Match header extensions to all media sections in offer #2444

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

ellenfkh
Copy link

Description

We noticed that once pion has negotiated headers and codecs for a given Kind, when a subsequent offer SDP adds a media section for that same Kind with different header extensions, the generated answer uses the original headers for all media sections.

This doesn't happen in Chrome, which never seems to send mixed headers like this. Firefox does, though.

We ran into this when sending an offer in which the first video media section had simulcast disabled, and thus didn't set this attribute

a=extmap:8/sendonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id

but the second video media section had simulcast enabled, so included that header.

The resulting answer didn't include that header in either media section, but the second media section did correctly have these attributes

a=rid:f recv
a=rid:h recv
a=rid:q recv
a=simulcast:recv f;h;q

Resulting in this error

Incoming unhandled RTP ssrc(3870936274), OnTrack will not be fired. stream id RTP Extensions required for Simulcast

This patch fixes our manual test case, but I suspect there are more places in the code where this assumption is being made. I'm also not sure whether Plan B vs Unified expects different behavior in this case.

Reference issue

Fixes #...

Copy link
Contributor

@adriancable adriancable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. If one other person can quickly eyeball this (@Sean-Der / @davidzhao ?) then I am happy to merge it. @ellenfkh - can you kindly squash the commits and make sure the new commit message passes the lint rules (begins with a capital letter, no more than 50 characters). Thanks!

@codecov
Copy link

codecov bot commented Sep 28, 2023

Codecov Report

Attention: Patch coverage is 77.41935% with 7 lines in your changes missing coverage. Please review.

Project coverage is 79.08%. Comparing base (166d82e) to head (40a80e3).

Files Patch % Lines
mediaengine.go 73.07% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2444      +/-   ##
==========================================
- Coverage   79.11%   79.08%   -0.04%     
==========================================
  Files          89       89              
  Lines        8249     8270      +21     
==========================================
+ Hits         6526     6540      +14     
- Misses       1256     1260       +4     
- Partials      467      470       +3     
Flag Coverage Δ
go 80.69% <77.41%> (-0.04%) ⬇️
wasm 64.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. It looks good!

Sorry for the delays getting to this one.

Firefox would send updated header extension
in renegotiation, e.g. publish a track without
simucalst then renegotiate second track with
simucalst, the two media secontions will have
different rtp header extensions in offer. Need
to match remote header extentions for each
media sections to avoid second track publish
failed.
@cnderrauber cnderrauber force-pushed the match-header-extensions branch from c138a57 to 40a80e3 Compare July 18, 2024 04:09
@cnderrauber cnderrauber requested a review from boks1971 July 18, 2024 04:28
@cnderrauber
Copy link
Member

cnderrauber commented Jul 18, 2024

cc @boks1971 as you had a related pr #2107 for same issue

@cnderrauber cnderrauber merged commit 287d106 into pion:master Jul 18, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants