Skip to content

Instantly share code, notes, and snippets.

@murillo128
murillo128 / singlessrc.md
Last active April 4, 2016 15:26
Single RTP packet stream (SSRC) per RTCRTPSender/RTCRTPReceiver

#Rationale IMHO it is quite difficult to understand what are the RTCRtpSender / RTCRtpReceiver.

  1. Overview

In the figure above, the RTCRtpSender (Section 5) encodes the track provided as input, which is transported over a RTCDtlsTransport

5.1 Overview

>The RTCRtpSender includes information relating to the RTP sender.

@murillo128
murillo128 / issues.md
Created April 13, 2016 10:19
ORTC issues

#API not based on use cases There are three main use cases:

  • Normal usage -> 1 RTPSender => 1 media codec, 1 encoding, 1 media stream
  • Simulcast -> 1 RTPSender => 1 media codec, n encodings, n media streams (1 media stream per encoding)
  • SVC -> 1 RTPSender => 1 media codec, n encodings, 1 media stream

But the API allows to configure the parameters with valid edge cases:

  • Multiple media codecs per RTPSender (VP8 + H264)
  • Same ssrc sent by two RTPSenders (given that payloads don't collide)
This file has been truncated, but you can view the full file.
/**
* ----------------- ThirdPartyNotices -----------------------------------------
* This file is based on or incorporates material from the projects listed below
* (collectively, “Third Party Code”).
* Skype is not the original author of the Third Party Code.
* The original copyright notice and the license, under which Skype received
* such Third Party Code, are set forth below.
* Such licenses and notices are provided for informational purposes only.
* Skype, not the third party, licenses the Third Party Code to you
* under the terms set forth in the Terms of Use for the Skype Product.
@murillo128
murillo128 / plan-b-ificator.md
Last active March 10, 2017 03:29
I have a plan..

Ok, the idea is to create an utilitiy to allow doing plan B SDP O/A on unified plan peerconnections.

The idea is similar to https://github.com/jitsi/sdp-interop and we will borrow several ideas from them.

We assume that bundling and rtcp-mux is used always.

#CASE A: unified calls plan B

Unified Offer

In this case browser creates an SDP with one m-line per track. We are going to take that SDP, and create one unified local offer to be used in the PC setLocalDescription and one plan-B offer to send to the remote peer.

v=0
o=mozilla...THIS_IS_SDPARTA-63.0.1 3555661637389743256 31 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 4B:5A:72:A9:1F:64:E6:14:61:12:41:5C:0F:2F:40:0D:ED:22:2D:C4:FB:54:63:52:E5:35:9C:A7:63:FE:1B:4B
a=group:BUNDLE 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 53600 UDP/TLS/RTP/SAVPF 109 9 0 8 101
v=0
o=mozilla...THIS_IS_SDPARTA-63.0.1 4116559276938954025 3 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 BC:21:41:A9:28:EB:B8:10:64:84:B8:74:30:AD:6A:29:89:BD:EE:35:03:8D:D2:64:36:36:7F:6C:68:68:E3:8E
1>------ Build started: Project: spinlock_wait, Configuration: Debug Win32 ------
2>------ Build started: Project: int128, Configuration: Debug Win32 ------
3>------ Build started: Project: strings_internal, Configuration: Debug Win32 ------
4>------ Build started: Project: gmock_main, Configuration: Debug Win32 ------
1>spinlock_wait.vcxproj -> C:\prog\abseil-cpp\build\absl\base\Debug\absl_spinlock_wait.lib
2>int128.vcxproj -> C:\prog\abseil-cpp\build\absl\numeric\Debug\absl_int128.lib
5>------ Build started: Project: base, Configuration: Debug Win32 ------
4>Building Custom Rule C:/prog/abseil-cpp/build/googletest-src/googlemock/CMakeLists.txt
4>CMake does not need to re-run because C:/prog/abseil-cpp/build/googletest-build/googlemock/CMakeFiles/generate.stamp is up-to-date.
3>ostringstream.cc
//Get streams
const {readableStream, writableStream} = event.data;
//New transform stream for inserting metadata
const transformStreamMetadata = new TransformStream ({transform: insert});
//New transform stream for encryption
const transformStreamEncrypt = new TransformStream ({transform: encrypt});
//Pipe
readableStream
.pipeThrough (transformStreamMetadata)
.pipeThrough (transformStreamEncrypt)
let detector;
onmessage = async (event) => {
//Depending on the mode
switch(event.data.cmd)
{
case "detector" :
{
//get detector
detector = event.data.port;
import {SFrame} from "./sframe/Client.js";
//Create crypto client
const senderClient = await SFrame.createClient(senderId, {
skipVp8PayloadHeader : true
});