Skip to content

Instantly share code, notes, and snippets.

@hissinger
hissinger / client.go
Last active August 31, 2019 08:38
udp server/client test sample
package main
import (
"fmt"
"net"
"time"
)
func main() {
data := make([]byte, 2048)
#include <glib.h>
#include <stdio.h>
#include <gnu/libc-version.h>
typedef struct {
GSource parent;
} custom_t;
static gboolean custom_prepare(GSource *source, gint *timeout)
{
@hissinger
hissinger / webrtc_simulcast.js
Last active April 11, 2022 18:03
webrtc simulcast example
document.getElementById("btn").onclick = async () => {
await run();
}
async function run() {
let stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false });
/* sender */
let sender = new RTCPeerConnection();
sender.onicecandidate = e => receiver.addIceCandidate(e.candidate);
package main
import (
"log"
"os"
gst "github.com/spreadspace/go-gstreamer"
"github.com/ziutek/glib"
)