This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [FrameDependencyTemplate spatialLayerId=2 temporalLayerId=2] | |
| [decodeTargetIndications]--------D[/decodeTargetIndications/] | |
| [frameDiffs]3,1[/frameDiffs/] | |
| [frameDiffsChains]11,10,9[/frameDiffsChains/] | |
| [/FrameDependencyTemplate] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [DependencyDescriptor startOfFrame=1 endOfFrame=1 frameDependencyTemplateId=14 frameNumber=104] | |
| [/DependencyDescriptor] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [DependencyDescriptor startOfFrame=1 endOfFrame=1 frameDependencyTemplateId=1 frameNumber=1] | |
| [TemplateDependencyStructure templateIdOffset=0 dtsCount=9 chainsCount=3] | |
| [FrameDependencyTemplate spatialLayerId=0 temporalLayerId=0] | |
| [decodeTargetIndications]SSSRRRRRR[/decodeTargetIndications/] | |
| [frameDiffs]12[/frameDiffs/] | |
| [frameDiffsChains]12,11,10[/frameDiffsChains/] | |
| [/FrameDependencyTemplate] | |
| [FrameDependencyTemplate spatialLayerId=0 temporalLayerId=0] | |
| [decodeTargetIndications]SSSSSSSSS[/decodeTargetIndications/] | |
| [frameDiffsChains]0,0,0[/frameDiffsChains/] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool CustomWebrtcImpl::open(const std::string &sdp, | |
| const std::string &video_codec, | |
| const std::string &audio_codec, | |
| const std::string &stream_name) | |
| { | |
| info("WS-OPEN: stream_name: %s", stream_name.c_str()); | |
| RestClient::Connection *conn = new RestClient::Connection(""); | |
| RestClient::HeaderFields headers; | |
| headers["Authorization"] = "Bearer " + this->token; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Get mic+cam | |
| const stream = await navigator.mediaDevices.getUserMedia({audio:true, video:true}); | |
| //Create peerconnection | |
| const pc = new RTCPeerConnection(); | |
| //Listen for state change events | |
| pc.onconnectionstatechange = (event) =>{ | |
| switch(pc.connectionState) { | |
| case "connected": | |
| // The connection has become fully connected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Create rest api | |
| const rest = Express(); | |
| rest.use(function(req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Headers", "*"); | |
| res.header("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT, OPTIONS"); | |
| next(); | |
| }); | |
| rest.use(BodyParser.text({type:"application/sdp"})); | |
| rest.post("/whip/:streamId" , (req, res)=>{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await senderClient.ratchetSenderEncryptionKey(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await senderClient.addReceiver(receiverId); | |
| await senderClient.setReceiverEncryptionKey(receiverId, shared); | |
| await senderClient.setReceiverVerifyKey(receiverId, receiverPublicKey); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Listen for remote track events | |
| pc.ontrack = (event) => { | |
| const track = event.track; | |
| const stream = event.streams[0]; | |
| //Play track on video object | |
| //Decyprt receiver | |
| senderClient.decrypt(event.transceiver.mid, event.receiver); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const pc = new RTCPeerConnection({ | |
| encodedInsertableStreams: true | |
| }); | |
| //Perform SDP O/A so transceiver gets the mid | |
| //For each sender | |
| for (const transceiver of sender.getTransceivers ()) | |
| //Encrypt it | |
| pc.encrypt(transceiver.mid, transceiver.sender); |