canvas_swap.html [180:241]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (!offer.sdp.match(/a=rtpmap:[0-9]+ H264/g)) { log("No H264 found in the offer!!!"); return; } } if (requireg722.checked) { // to enforce the usage of G.722 we remove other codecs from the offer offer.sdp = removeNonG722(offer.sdp); pc1_offer = offer; log("G.722 only Offer: " + sdpPrettyPrint(offer.sdp)); if (!offer.sdp.match(/a=rtpmap:[0-9]+ G722/g)) { log("No G722 found in the offer!!!"); return; } } pc1.setLocalDescription(offer, step2, failed); } // replace CR NL with HTML breaks function sdpPrettyPrint(sdp) { return sdp.replace(/[\r\n]+/g, '
'); } function h264StateChange(cb) { var h264opts = document.getElementById('divH264'); if(cb.checked){ h264opts.style.display = 'block'; } else { h264opts.style.display = 'none'; } } // Also remove mode 0 if it's offered // Note, we don't bother removing the fmtp lines, which makes a good test // for some SDP parsing issues. function removeVP8(sdp) { updated_sdp = sdp.replace("a=rtpmap:120 VP8/90000\r\n",""); updated_sdp = updated_sdp.replace(/m=video ([0-9]+) RTP\/SAVPF ([0-9 ]*) 120/g, "m=video $1 RTP\/SAVPF $2"); updated_sdp = updated_sdp.replace(/m=video ([0-9]+) RTP\/SAVPF 120([0-9 ]*)/g, "m=video $1 RTP\/SAVPF$2"); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack\r\n",""); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack pli\r\n",""); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 ccm fir\r\n",""); return updated_sdp; } // Remove anything that's not G.722 from the m=audio line function removeNonG722(sdp) { updated_sdp = sdp.replace(/m=audio ([0-9]+) RTP\/SAVPF ([0-9 ]*)/g, "m=audio $1 RTP\/SAVPF 9"); return updated_sdp; } function preferMode0(sdp) { updated_sdp = updated_sdp.replace("126 97", "97 126"); return updated_sdp; } // pc1.setLocal finished, call pc2.setRemote function step2() { pc1.onicecandidate = function(obj) { if (obj.candidate) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - pc_test_fps.html [157:218]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (!offer.sdp.match(/a=rtpmap:[0-9]+ H264/g)) { log("No H264 found in the offer!!!"); return; } } if (requireg722.checked) { // to enforce the usage of G.722 we remove other codecs from the offer offer.sdp = removeNonG722(offer.sdp); pc1_offer = offer; log("G.722 only Offer: " + sdpPrettyPrint(offer.sdp)); if (!offer.sdp.match(/a=rtpmap:[0-9]+ G722/g)) { log("No G722 found in the offer!!!"); return; } } pc1.setLocalDescription(offer, step2, failed); } // replace CR NL with HTML breaks function sdpPrettyPrint(sdp) { return sdp.replace(/[\r\n]+/g, '
'); } function h264StateChange(cb) { var h264opts = document.getElementById('divH264'); if(cb.checked){ h264opts.style.display = 'block'; } else { h264opts.style.display = 'none'; } } // Also remove mode 0 if it's offered // Note, we don't bother removing the fmtp lines, which makes a good test // for some SDP parsing issues. function removeVP8(sdp) { updated_sdp = sdp.replace("a=rtpmap:120 VP8/90000\r\n",""); updated_sdp = updated_sdp.replace(/m=video ([0-9]+) RTP\/SAVPF ([0-9 ]*) 120/g, "m=video $1 RTP\/SAVPF $2"); updated_sdp = updated_sdp.replace(/m=video ([0-9]+) RTP\/SAVPF 120([0-9 ]*)/g, "m=video $1 RTP\/SAVPF$2"); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack\r\n",""); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 nack pli\r\n",""); updated_sdp = updated_sdp.replace("a=rtcp-fb:120 ccm fir\r\n",""); return updated_sdp; } // Remove anything that's not G.722 from the m=audio line function removeNonG722(sdp) { updated_sdp = sdp.replace(/m=audio ([0-9]+) RTP\/SAVPF ([0-9 ]*)/g, "m=audio $1 RTP\/SAVPF 9"); return updated_sdp; } function preferMode0(sdp) { updated_sdp = updated_sdp.replace("126 97", "97 126"); return updated_sdp; } // pc1.setLocal finished, call pc2.setRemote function step2() { pc1.onicecandidate = function(obj) { if (obj.candidate) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -