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

Use normalized comparison in PeerConnection.Configuration.supported_codec?/2 #87

Conversation

clone1018
Copy link
Contributor

This PR adds a couple of minor things:

  • Add SDP offer from OBS to tests
  • Lowercase mime type for codec comparison
  • Show developer a warning whenever no codecs in the PeerConnection matched the mline

@LVala LVala requested a review from mickel8 March 11, 2024 14:57
Copy link
Member

@mickel8 mickel8 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks! Just three small, minor fixes and we can merge!

test/ex_webrtc/peer_sdp_test.exs Outdated Show resolved Hide resolved
lib/ex_webrtc/rtp_transceiver.ex Show resolved Hide resolved
rtpmap = ExSDP.get_attribute(mline, :rtpmap)

Logger.warning(
"No valid codecs for \"#{rtpmap}\" found in registered %ExWebRTC.PeerConnection.Configuration{}"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should use inspect here, shouldn't we? rtpmap should be a struct.

Suggested change
"No valid codecs for \"#{rtpmap}\" found in registered %ExWebRTC.PeerConnection.Configuration{}"
"No valid codecs for #{inspect(rtpmap)} found in registered %ExWebRTC.PeerConnection.Configuration{}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This actually prints nicely by default thanks to: https://github.com/membraneframework/ex_sdp/blob/master/lib/ex_sdp/attribute/rtp_mapping.ex#L62

Let me know if you want to keep that, or swap it out for inspect!

@mickel8 mickel8 merged commit 5975704 into elixir-webrtc:master Mar 11, 2024
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.

None yet

2 participants