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 no supported codecs scenario #61

Merged
merged 2 commits into from
Jan 18, 2024
Merged

Fix no supported codecs scenario #61

merged 2 commits into from
Jan 18, 2024

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented Jan 17, 2024

Following Firefox behaviour, when there are no supported codecs in the offer, we will end up with empty transceivers lists on both sides after finishing negotiation.

See w3c/webrtc-pc#2927

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Merging #61 (cd90b29) into master (528c056) will decrease coverage by 0.29%.
Report is 3 commits behind head on master.
The diff coverage is 72.72%.

❗ Current head cd90b29 differs from pull request most recent head 0cfd170. Consider uploading reports for the commit 0cfd170 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   88.85%   88.57%   -0.29%     
==========================================
  Files          25       25              
  Lines        1059     1068       +9     
==========================================
+ Hits          941      946       +5     
- Misses        118      122       +4     
Files Coverage Δ
lib/ex_webrtc/media_stream_track.ex 100.00% <ø> (ø)
lib/ex_webrtc/peer_connection/configuration.ex 89.85% <ø> (ø)
lib/ex_webrtc/rtp/opus_depayloader.ex 0.00% <ø> (ø)
lib/ex_webrtc/rtp/opus_payloader.ex 0.00% <ø> (ø)
lib/ex_webrtc/rtp/vp8_depayloader.ex 94.11% <ø> (ø)
lib/ex_webrtc/rtp/vp8_payload.ex 90.00% <ø> (ø)
lib/ex_webrtc/rtp/vp8_payloader.ex 100.00% <ø> (ø)
lib/ex_webrtc/rtp_codec_parameters.ex 100.00% <ø> (ø)
lib/ex_webrtc/rtp_sender.ex 100.00% <ø> (ø)
lib/ex_webrtc/rtp_transceiver.ex 97.40% <100.00%> (+0.06%) ⬆️
... and 3 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afa1851...0cfd170. Read the comment docs.

@mickel8 mickel8 force-pushed the failing-negotiation branch 4 times, most recently from cdcaf49 to f373f2d Compare January 17, 2024 20:44
.credo.exs Outdated
@@ -104,7 +104,7 @@
{Credo.Check.Readability.ParenthesesInCondition, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
{Credo.Check.Readability.PredicateFunctionNames, []},
{Credo.Check.Readability.PredicateFunctionNames, [exit_status: 0]},
Copy link
Member Author

Choose a reason for hiding this comment

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

TBH I don't know what we want to do with this but personally I don't think functions like is_supported is_mandatory etc are bad. Credo suggests using supported? and mandatory? which is imo less readable. See https://hexdocs.pm/credo/Credo.Check.Readability.PredicateFunctionNames.html

Copy link
Member

@LVala LVala Jan 18, 2024

Choose a reason for hiding this comment

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

I quite like the something? convention, I think the question mark makes it quite obvious as to what the function returns and it's an established convention. is_something, on the other hand, suggests that it can be used in guards, but in reality it cannot.

@mickel8 mickel8 changed the title Fix no matching codec scenario Fix no supported codecs scenario Jan 17, 2024
@mickel8 mickel8 marked this pull request as ready for review January 17, 2024 20:54
@mickel8 mickel8 requested a review from LVala January 17, 2024 20:55
.credo.exs Outdated
@@ -104,7 +104,7 @@
{Credo.Check.Readability.ParenthesesInCondition, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, []},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
{Credo.Check.Readability.PredicateFunctionNames, []},
{Credo.Check.Readability.PredicateFunctionNames, [exit_status: 0]},
Copy link
Member

@LVala LVala Jan 18, 2024

Choose a reason for hiding this comment

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

I quite like the something? convention, I think the question mark makes it quite obvious as to what the function returns and it's an established convention. is_something, on the other hand, suggests that it can be used in guards, but in reality it cannot.

Comment on lines +146 to +148
offered_direction = SDPUtils.get_media_direction(mline)
direction = get_direction(offered_direction, transceiver.direction)
opts = Keyword.put(opts, :direction, direction)
Copy link
Member

Choose a reason for hiding this comment

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

Was this previously unhandled? How did we handle the sRD(offer) -> tr.direction=inactive -> sLD(answer) scenario then?

Copy link
Member Author

Choose a reason for hiding this comment

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

The only change is that now, when we reject an mline we also set its direction as inactive

@mickel8 mickel8 merged commit bf45f20 into master Jan 18, 2024
2 checks passed
@mickel8 mickel8 deleted the failing-negotiation branch January 18, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants