Skip to content

Instantly share code, notes, and snippets.

View j1elo's full-sized avatar

Juan Navarro j1elo

View GitHub Profile
@j1elo
j1elo / sdp-offer-chrome-84.txt
Created August 27, 2020 17:53
SDP Offer (Chrome 84)
v=0
o=- 5217540180782877494 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS eEMVYR4txYWGErUa55KnHm0mMBdfrqSbtQul
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:RWim
@j1elo
j1elo / sdp-preferred-codec.java
Last active August 27, 2020 18:34
SDP preferred codec reordering
/*
* `codec` is a uppercase SDP-style codec name: "VP8", "H264".
*
* This looks for all video m-sections (lines starting with "m=video"),
* then searches all of its related PayloadTypes trying to find those which
* correspond to the preferred codec. If any is found, they are moved to the
* front of the PayloadTypes list in the m= line, without removing the other
* codecs that might be present.
*
* If our preferred coded is not found, the m= line is left without changes.