From 5e18b460b3f560feb3db36127c6c551b894619b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 29 Nov 2019 20:39:40 +0100 Subject: [PATCH] multiparty/rust: Add Rust version of multiparty demo Different to the C version this also mixes all participants into a grid with videomixer. --- .../multiparty-sendrecv/gst-rust/Cargo.lock | 1366 +++++++++++++++++ .../multiparty-sendrecv/gst-rust/Cargo.toml | 20 + .../gst-rust/src/macos_workaround.rs | 67 + .../multiparty-sendrecv/gst-rust/src/main.rs | 1069 +++++++++++++ 4 files changed, 2522 insertions(+) create mode 100644 webrtc/multiparty-sendrecv/gst-rust/Cargo.lock create mode 100644 webrtc/multiparty-sendrecv/gst-rust/Cargo.toml create mode 100644 webrtc/multiparty-sendrecv/gst-rust/src/macos_workaround.rs create mode 100644 webrtc/multiparty-sendrecv/gst-rust/src/main.rs diff --git a/webrtc/multiparty-sendrecv/gst-rust/Cargo.lock b/webrtc/multiparty-sendrecv/gst-rust/Cargo.lock new file mode 100644 index 0000000000..90d7220e56 --- /dev/null +++ b/webrtc/multiparty-sendrecv/gst-rust/Cargo.lock @@ -0,0 +1,1366 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "anyhow" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "async-macros" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-std" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-task" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "async-tungstenite" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-tls 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tungstenite 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bumpalo" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "c2-chacha" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-channel" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-executor" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-io" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-macro" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-sink" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-task" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-timer" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glib" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glib-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gobject-sys" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "glib 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer-sdp" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sdp-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer-sdp-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer-webrtc" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sdp 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-webrtc-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gstreamer-webrtc-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sdp-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hermit-abi" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "input_buffer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "js-sys" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.66" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "muldiv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "net2" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-rational" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "once_cell" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-project" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-utils" +version = "0.1.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro-error" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro-nested" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ring" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustls" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)", + "sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scopeguard" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sct" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_derive" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha-1" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "sourcefile" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "structopt" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "structopt-derive" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tungstenite" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "input_buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "typenum" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-segmentation" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "untrusted" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf-8" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasm-bindgen" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasm-bindgen-webidl" +version = "0.2.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "web-sys" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webpki" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webpki-roots" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "webrtc-app" +version = "0.1.0" +dependencies = [ + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-tungstenite 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-sdp 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gstreamer-webrtc 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "weedle" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9267dff192e68f3399525901e709a48c1d3982c9c072fa32f2127a0cb0babf14" +"checksum async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "644a5a8de80f2085a1e7e57cd1544a2a7438f6e003c0790999bd43b92a77cdb2" +"checksum async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "513ee3c49800679a319912340f5601afda9e72848d7dea3a48bab489e8c1a46f" +"checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced" +"checksum async-tls 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce6977f57fa68da77ffe5542950d47e9c23d65f5bc7cb0a9f8700996913eec7" +"checksum async-tungstenite 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c24d1cd50a78e107d277c159ccd1eff90e8d2b2c781b2151d7c98eced08ec38" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +"checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" +"checksum cc 1.0.47 (registry+https://github.com/rust-lang/crates.io-index)" = "aa87058dce70a3ff5621797f1506cb837edd02ac4c0ae642b4542dce802908b8" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" +"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" +"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" +"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" +"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" +"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" +"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" +"checksum futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" +"checksum futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" +"checksum futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" +"checksum futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" +"checksum futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" +"checksum futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" +"checksum futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" +"checksum futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" +"checksum glib 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "be27232841baa43e0fd5ae003f7941925735b2f733a336dc75f07b9eff415e7b" +"checksum glib-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4b86a9169fbc9cf9a0ef315039c2304b09d5c575c5fde7defba3576a0311b863" +"checksum gobject-sys 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61d55bc9202447ca776f6ad0048c36e3312010f66f82ab478e97513e93f3604b" +"checksum gstreamer 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa91e470b0cd4b05611f7d0e89caf76e39752156440877f04c23ad34ffc9761c" +"checksum gstreamer-sdp 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b2e680156e5a488eda9ebd6081c0141386ef72bb81e3f0e6a2ca0c3129d82ac2" +"checksum gstreamer-sdp-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e062aa557a851d8aac367df24ca80040ec45340033c0c6675fbdc7f26f71da48" +"checksum gstreamer-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfc2f6cc9b6a1f5159bfd500310fe431cfb0b74b3af17ce3fdf8353cf586975" +"checksum gstreamer-webrtc 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c4e506822afa68a44d7fad6219e781fd1729d84939978b90a23260c07b182590" +"checksum gstreamer-webrtc-sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf7375d6737037e01c6c2342ab30e6ff77cf5e36fc64c81d8d43054b33f4fa7" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum http 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "2790658cddc82e82b08e25176c431d7015a0adeb1718498715cbd20138a0bf68" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum input_buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e1b822cc844905551931d6f81608ed5f50a79c1078a4e2b4d42dbc7c1eedfbf" +"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" +"checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c54d9f465d530a752e6ebdc217e081a7a614b48cb200f6f0aee21ba6bc9aabb" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" +"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" +"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum muldiv 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "451a9a05d2a32c566c897835e0ea95cf79ed2fdfe957924045a1721a36c9980f" +"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" +"checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" +"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" +"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" +"checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +"checksum pin-project 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "94b90146c7216e4cb534069fb91366de4ea0ea353105ee45ed297e2d1619e469" +"checksum pin-project-internal 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "44ca92f893f0656d3cba8158dd0f2b99b94de256a4a54e870bd6922fcc6c8355" +"checksum pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0af6cbca0e6e3ce8692ee19fb8d734b641899e07b68eb73e9bbbd32f1703991" +"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" +"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" +"checksum proc-macro-error 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" +"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" +"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" +"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" +"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6747f8da1f2b1fabbee1aaa4eb8a11abf9adef0bf58a41cee45db5d59cecdfac" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" +"checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" +"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" +"checksum serde_json 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "1a3351dcbc1f067e2c92ab7c3c1f288ad1a4cffc470b5aaddb4c2e0a3ae80043" +"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" +"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" +"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +"checksum structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "30b3a3e93f5ad553c38b3301c8a0a0cec829a36783f6a0c467fc4bf553a5f5bf" +"checksum structopt-derive 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea692d40005b3ceba90a9fe7a78fa8d4b82b0ce627eebbffc329aab850f3410e" +"checksum syn 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f89693ae015201f8de93fd96bde2d065f8bfc3f97ce006d5bc9f900b97c0c7c0" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum tungstenite 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8a0c2bd5aeb7dcd2bb32e472c8872759308495e5eccc942e929a513cd8d36110" +"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" +"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +"checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" +"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" +"checksum wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "29ae32af33bacd663a9a28241abecf01f2be64e6a185c6139b04f18b6385c5f2" +"checksum wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "1845584bd3593442dc0de6e6d9f84454a59a057722f36f005e44665d6ab19d85" +"checksum wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "87fcc747e6b73c93d22c947a6334644d22cfec5abd8b66238484dc2b0aeb9fe4" +"checksum wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3dc4b3f2c4078c8c4a5f363b92fcf62604c5913cbd16c6ff5aaf0f74ec03f570" +"checksum wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ca0b78d6d3be8589b95d1d49cdc0794728ca734adf36d7c9f07e6459508bb53d" +"checksum wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3126356474ceb717c8fb5549ae387c9fbf4872818454f4d87708bee997214bb5" +"checksum web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "98405c0a2e722ed3db341b4c5b70eb9fe0021621f7350bab76df93b09b649bbf" +"checksum webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4" +"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" +"checksum weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/webrtc/multiparty-sendrecv/gst-rust/Cargo.toml b/webrtc/multiparty-sendrecv/gst-rust/Cargo.toml new file mode 100644 index 0000000000..413a0b809d --- /dev/null +++ b/webrtc/multiparty-sendrecv/gst-rust/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "webrtc-app" +version = "0.1.0" +authors = ["Sebastian Dröge "] +edition = "2018" + +[dependencies] +futures = "0.3" +async-std = "1" +structopt = { version = "0.3", default-features = false } +anyhow = "1" +url = "2" +rand = "0.7" +async-tungstenite = "0.2" +gst = { package = "gstreamer", version = "0.14", features = ["v1_14"] } +gst-webrtc = { package = "gstreamer-webrtc", version = "0.14" } +gst-sdp = { package = "gstreamer-sdp", version = "0.14", features = ["v1_14"] } +serde = "1" +serde_derive = "1" +serde_json = "1" diff --git a/webrtc/multiparty-sendrecv/gst-rust/src/macos_workaround.rs b/webrtc/multiparty-sendrecv/gst-rust/src/macos_workaround.rs new file mode 100644 index 0000000000..f22be66f2f --- /dev/null +++ b/webrtc/multiparty-sendrecv/gst-rust/src/macos_workaround.rs @@ -0,0 +1,67 @@ +/// macOS has a specific requirement that there must be a run loop running +/// on the main thread in order to open windows and use OpenGL. + +#[cfg(target_os = "macos")] +mod runloop { + use std::os::raw::c_void; + #[repr(C)] + pub struct CFRunLoop(*mut c_void); + + #[link(name = "foundation", kind = "framework")] + extern "C" { + fn CFRunLoopRun(); + fn CFRunLoopGetMain() -> *mut c_void; + fn CFRunLoopStop(l: *mut c_void); + } + + impl CFRunLoop { + pub fn run() { + unsafe { + CFRunLoopRun(); + } + } + + pub fn get_main() -> CFRunLoop { + unsafe { + let r = CFRunLoopGetMain(); + assert!(!r.is_null()); + CFRunLoop(r) + } + } + + pub fn stop(&self) { + unsafe { CFRunLoopStop(self.0) } + } + } + + unsafe impl Send for CFRunLoop {} +} + +/// On macOS this launches the callback function on a thread. +/// On other platforms it's just executed immediately. +#[cfg(not(target_os = "macos"))] +pub fn run T + Send + 'static>(main: F) -> T +where + T: Send + 'static, +{ + main() +} + +#[cfg(target_os = "macos")] +pub fn run T + Send + 'static>(main: F) -> T +where + T: Send + 'static, +{ + use std::thread; + + let l = runloop::CFRunLoop::get_main(); + let t = thread::spawn(move || { + let res = main(); + l.stop(); + res + }); + + runloop::CFRunLoop::run(); + + t.join().unwrap() +} diff --git a/webrtc/multiparty-sendrecv/gst-rust/src/main.rs b/webrtc/multiparty-sendrecv/gst-rust/src/main.rs new file mode 100644 index 0000000000..1011344571 --- /dev/null +++ b/webrtc/multiparty-sendrecv/gst-rust/src/main.rs @@ -0,0 +1,1069 @@ +#![recursion_limit = "256"] + +mod macos_workaround; + +use std::collections::BTreeMap; +use std::sync::{Arc, Mutex, Weak}; + +use rand::prelude::*; + +use structopt::StructOpt; + +use async_std::prelude::*; +use async_std::task; +use futures::channel::mpsc; +use futures::sink::{Sink, SinkExt}; +use futures::stream::StreamExt; + +use async_tungstenite::tungstenite; +use tungstenite::Error as WsError; +use tungstenite::Message as WsMessage; + +use gst::gst_element_error; +use gst::prelude::*; + +use serde_derive::{Deserialize, Serialize}; + +use anyhow::{anyhow, bail, Context}; + +const STUN_SERVER: &str = "stun://stun.l.google.com:19302"; +const TURN_SERVER: &str = "turn://foo:bar@webrtc.nirbheek.in:3478"; +const VIDEO_WIDTH: u32 = 1024; +const VIDEO_HEIGHT: u32 = 768; + +// upgrade weak reference or return +#[macro_export] +macro_rules! upgrade_weak { + ($x:ident, $r:expr) => {{ + match $x.upgrade() { + Some(o) => o, + None => return $r, + } + }}; + ($x:ident) => { + upgrade_weak!($x, ()) + }; +} + +#[derive(Debug, StructOpt)] +struct Args { + #[structopt(short, long, default_value = "wss://webrtc.nirbheek.in:8443")] + server: String, + #[structopt(short, long)] + room_id: u32, +} + +// JSON messages we communicate with +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +enum JsonMsg { + Ice { + candidate: String, + #[serde(rename = "sdpMLineIndex")] + sdp_mline_index: u32, + }, + Sdp { + #[serde(rename = "type")] + type_: String, + sdp: String, + }, +} + +// Strong reference to our application state +#[derive(Debug, Clone)] +struct App(Arc); + +// Weak reference to our application state +#[derive(Debug, Clone)] +struct AppWeak(Weak); + +// Actual application state +#[derive(Debug)] +struct AppInner { + args: Args, + pipeline: gst::Pipeline, + video_tee: gst::Element, + audio_tee: gst::Element, + video_mixer: gst::Element, + audio_mixer: gst::Element, + send_msg_tx: Arc>>, + peers: Mutex>, +} + +// Strong reference to the state of one peer +#[derive(Debug, Clone)] +struct Peer(Arc); + +// Weak reference to the state of one peer +#[derive(Debug, Clone)] +struct PeerWeak(Weak); + +// Actual peer state +#[derive(Debug)] +struct PeerInner { + peer_id: u32, + bin: gst::Bin, + webrtcbin: gst::Element, + send_msg_tx: Arc>>, +} + +// To be able to access the App's fields directly +impl std::ops::Deref for App { + type Target = AppInner; + + fn deref(&self) -> &AppInner { + &self.0 + } +} + +// To be able to access the Peers's fields directly +impl std::ops::Deref for Peer { + type Target = PeerInner; + + fn deref(&self) -> &PeerInner { + &self.0 + } +} + +impl AppWeak { + // Try upgrading a weak reference to a strong one + fn upgrade(&self) -> Option { + self.0.upgrade().map(App) + } +} + +impl PeerWeak { + // Try upgrading a weak reference to a strong one + fn upgrade(&self) -> Option { + self.0.upgrade().map(Peer) + } +} + +impl App { + // Downgrade the strong reference to a weak reference + fn downgrade(&self) -> AppWeak { + AppWeak(Arc::downgrade(&self.0)) + } + + fn new( + args: Args, + initial_peers: &[&str], + ) -> Result< + ( + Self, + impl Stream, + impl Stream, + ), + anyhow::Error, + > { + // Create the GStreamer pipeline + let pipeline = gst::parse_launch( + &format!( + "videotestsrc is-live=true ! vp8enc deadline=1 ! rtpvp8pay pt=96 ! tee name=video-tee ! \ + queue ! fakesink sync=true \ + audiotestsrc wave=ticks is-live=true ! opusenc ! rtpopuspay pt=97 ! tee name=audio-tee ! \ + queue ! fakesink sync=true \ + audiotestsrc wave=silence is-live=true ! audio-mixer. \ + audiomixer name=audio-mixer sink_0::mute=true ! audioconvert ! audioresample ! autoaudiosink \ + videotestsrc pattern=black ! capsfilter caps=video/x-raw,width=1,height=1 ! video-mixer. \ + compositor name=video-mixer background=black sink_0::alpha=0.0 ! capsfilter caps=video/x-raw,width={width},height={height} ! videoconvert ! autovideosink", + width=VIDEO_WIDTH, + height=VIDEO_HEIGHT, + ))?; + + // Downcast from gst::Element to gst::Pipeline + let pipeline = pipeline + .downcast::() + .expect("not a pipeline"); + + // Get access to the tees and mixers by name + let video_tee = pipeline + .get_by_name("video-tee") + .expect("can't find video-tee"); + let audio_tee = pipeline + .get_by_name("audio-tee") + .expect("can't find audio-tee"); + + let video_mixer = pipeline + .get_by_name("video-mixer") + .expect("can't find video-mixer"); + let audio_mixer = pipeline + .get_by_name("audio-mixer") + .expect("can't find audio-mixer"); + + let bus = pipeline.get_bus().unwrap(); + + // Send our bus messages via a futures channel to be handled asynchronously + let (send_gst_msg_tx, send_gst_msg_rx) = mpsc::unbounded::(); + let send_gst_msg_tx = Mutex::new(send_gst_msg_tx); + bus.set_sync_handler(move |_, msg| { + let _ = send_gst_msg_tx.lock().unwrap().unbounded_send(msg.clone()); + gst::BusSyncReply::Drop + }); + + // Channel for outgoing WebSocket messages from other threads + let (send_ws_msg_tx, send_ws_msg_rx) = mpsc::unbounded::(); + + // Asynchronously set the pipeline to Playing + pipeline.call_async(|pipeline| { + pipeline + .set_state(gst::State::Playing) + .expect("Couldn't set pipeline to Playing"); + }); + + let app = App(Arc::new(AppInner { + args, + pipeline, + video_tee, + audio_tee, + video_mixer, + audio_mixer, + peers: Mutex::new(BTreeMap::new()), + send_msg_tx: Arc::new(Mutex::new(send_ws_msg_tx)), + })); + + for peer in initial_peers { + app.add_peer(peer, true)?; + } + + // Asynchronously set the pipeline to Playing + app.pipeline.call_async(|pipeline| { + // If this fails, post an error on the bus so we exit + if pipeline.set_state(gst::State::Playing).is_err() { + gst_element_error!( + pipeline, + gst::LibraryError::Failed, + ("Failed to set pipeline to Playing") + ); + } + }); + + Ok((app, send_gst_msg_rx, send_ws_msg_rx)) + } + + // Handle WebSocket messages, both our own as well as WebSocket protocol messages + fn handle_websocket_message(&self, msg: &str) -> Result<(), anyhow::Error> { + if msg.starts_with("ERROR") { + bail!("Got error message: {}", msg); + } + + if msg.starts_with("ROOM_PEER_MSG ") { + // Parse message and pass to the peer if we know about it + let mut split = msg["ROOM_PEER_MSG ".len()..].splitn(2, ' '); + let peer_id = split + .next() + .and_then(|s| str::parse::(s).ok()) + .ok_or_else(|| anyhow!("Can't parse peer id"))?; + + let peers = self.peers.lock().unwrap(); + let peer = peers + .get(&peer_id) + .ok_or_else(|| anyhow!("Can't find peer {}", peer_id))? + .clone(); + drop(peers); + + let msg = split + .next() + .ok_or_else(|| anyhow!("Can't parse peer message"))?; + + let json_msg: JsonMsg = serde_json::from_str(msg)?; + + match json_msg { + JsonMsg::Sdp { type_, sdp } => peer.handle_sdp(&type_, &sdp), + JsonMsg::Ice { + sdp_mline_index, + candidate, + } => peer.handle_ice(sdp_mline_index, &candidate), + } + } else if msg.starts_with("ROOM_PEER_JOINED ") { + // Parse message and add the new peer + let mut split = msg["ROOM_PEER_JOINED ".len()..].splitn(2, ' '); + let peer_id = split.next().ok_or_else(|| anyhow!("Can't parse peer id"))?; + + self.add_peer(peer_id, false) + } else if msg.starts_with("ROOM_PEER_LEFT ") { + // Parse message and add the new peer + let mut split = msg["ROOM_PEER_LEFT ".len()..].splitn(2, ' '); + let peer_id = split.next().ok_or_else(|| anyhow!("Can't parse peer id"))?; + + self.remove_peer(peer_id) + } else { + Ok(()) + } + } + + // Handle GStreamer messages coming from the pipeline + fn handle_pipeline_message(&self, message: &gst::Message) -> Result<(), anyhow::Error> { + use gst::message::MessageView; + + match message.view() { + MessageView::Error(err) => bail!( + "Error from element {}: {} ({})", + err.get_src() + .map(|s| String::from(s.get_path_string())) + .unwrap_or_else(|| String::from("None")), + err.get_error(), + err.get_debug().unwrap_or_else(|| String::from("None")), + ), + MessageView::Warning(warning) => { + println!("Warning: \"{}\"", warning.get_debug().unwrap()); + } + _ => (), + } + + Ok(()) + } + + // Add this new peer and if requested, send the offer to it + fn add_peer(&self, peer: &str, offer: bool) -> Result<(), anyhow::Error> { + println!("Adding peer {}", peer); + let peer_id = str::parse::(peer).with_context(|| format!("Can't parse peer id"))?; + let mut peers = self.peers.lock().unwrap(); + if peers.contains_key(&peer_id) { + bail!("Peer {} already called", peer_id); + } + + let peer_bin = gst::parse_bin_from_description( + "queue name=video-queue ! webrtcbin. \ + queue name=audio-queue ! webrtcbin. \ + webrtcbin name=webrtcbin", + false, + )?; + + // Get access to the webrtcbin by name + let webrtcbin = peer_bin + .get_by_name("webrtcbin") + .expect("can't find webrtcbin"); + + // Set some properties on webrtcbin + webrtcbin.set_property_from_str("stun-server", STUN_SERVER); + webrtcbin.set_property_from_str("turn-server", TURN_SERVER); + webrtcbin.set_property_from_str("bundle-policy", "max-bundle"); + + // Add ghost pads for connecting to the input + let audio_queue = peer_bin + .get_by_name("audio-queue") + .expect("can't find audio-queue"); + let audio_sink_pad = gst::GhostPad::new( + Some("audio_sink"), + &audio_queue.get_static_pad("sink").unwrap(), + ) + .unwrap(); + peer_bin.add_pad(&audio_sink_pad).unwrap(); + + let video_queue = peer_bin + .get_by_name("video-queue") + .expect("can't find video-queue"); + let video_sink_pad = gst::GhostPad::new( + Some("video_sink"), + &video_queue.get_static_pad("sink").unwrap(), + ) + .unwrap(); + peer_bin.add_pad(&video_sink_pad).unwrap(); + + let peer = Peer(Arc::new(PeerInner { + peer_id, + bin: peer_bin, + webrtcbin, + send_msg_tx: self.send_msg_tx.clone(), + })); + + // Insert the peer into our map + peers.insert(peer_id, peer.clone()); + drop(peers); + + // Add to the whole pipeline + self.pipeline.add(&peer.bin).unwrap(); + + // If we should send the offer to the peer, do so from on-negotiation-needed + if offer { + // Connect to on-negotiation-needed to handle sending an Offer + let peer_clone = peer.downgrade(); + peer.webrtcbin + .connect("on-negotiation-needed", false, move |values| { + let _webrtc = values[0].get::().unwrap(); + + let peer = upgrade_weak!(peer_clone, None); + if let Err(err) = peer.on_negotiation_needed() { + gst_element_error!( + peer.bin, + gst::LibraryError::Failed, + ("Failed to negotiate: {:?}", err) + ); + } + + None + }) + .unwrap(); + } + + // Whenever there is a new ICE candidate, send it to the peer + let peer_clone = peer.downgrade(); + peer.webrtcbin + .connect("on-ice-candidate", false, move |values| { + let _webrtc = values[0].get::().expect("Invalid argument"); + let mlineindex = values[1].get::().expect("Invalid argument"); + let candidate = values[2].get::().expect("Invalid argument"); + + let peer = upgrade_weak!(peer_clone, None); + + if let Err(err) = peer.on_ice_candidate(mlineindex, candidate) { + gst_element_error!( + peer.bin, + gst::LibraryError::Failed, + ("Failed to send ICE candidate: {:?}", err) + ); + } + + None + }) + .unwrap(); + + // Whenever there is a new stream incoming from the peer, handle it + let peer_clone = peer.downgrade(); + peer.webrtcbin.connect_pad_added(move |_webrtc, pad| { + let peer = upgrade_weak!(peer_clone); + + if let Err(err) = peer.on_incoming_stream(pad) { + gst_element_error!( + peer.bin, + gst::LibraryError::Failed, + ("Failed to handle incoming stream: {:?}", err) + ); + } + }); + + // Whenever a decoded stream comes available, handle it and connect it to the mixers + let app_clone = self.downgrade(); + peer.bin.connect_pad_added(move |_bin, pad| { + let app = upgrade_weak!(app_clone); + + if pad.get_name() == "audio_src" { + let audiomixer_sink_pad = app.audio_mixer.get_request_pad("sink_%u").unwrap(); + pad.link(&audiomixer_sink_pad).unwrap(); + + // Once it is unlinked again later when the peer is being removed, + // also release the pad on the mixer + audiomixer_sink_pad.connect_unlinked(move |pad, _peer| { + if let Some(audiomixer) = pad.get_parent() { + let audiomixer = audiomixer.downcast_ref::().unwrap(); + audiomixer.release_request_pad(pad); + } + }); + } else if pad.get_name() == "video_src" { + let videomixer_sink_pad = app.video_mixer.get_request_pad("sink_%u").unwrap(); + pad.link(&videomixer_sink_pad).unwrap(); + + app.relayout_videomixer(); + + // Once it is unlinked again later when the peer is being removed, + // also release the pad on the mixer + let app_clone = app.downgrade(); + videomixer_sink_pad.connect_unlinked(move |pad, _peer| { + let app = upgrade_weak!(app_clone); + + if let Some(videomixer) = pad.get_parent() { + let videomixer = videomixer.downcast_ref::().unwrap(); + videomixer.release_request_pad(pad); + } + + app.relayout_videomixer(); + }); + } + }); + + // Add pad probes to both tees for blocking them and + // then unblock them once we reached the Playing state. + // + // Then link them and unblock, in case they got blocked + // in the meantime. + // + // Otherwise it might happen that data is received before + // the elements are ready and then an error happens. + let audio_src_pad = self.audio_tee.get_request_pad("src_%u").unwrap(); + let audio_block = audio_src_pad + .add_probe(gst::PadProbeType::BLOCK_DOWNSTREAM, |_pad, _info| { + gst::PadProbeReturn::Ok + }) + .unwrap(); + audio_src_pad.link(&audio_sink_pad)?; + + let video_src_pad = self.video_tee.get_request_pad("src_%u").unwrap(); + let video_block = video_src_pad + .add_probe(gst::PadProbeType::BLOCK_DOWNSTREAM, |_pad, _info| { + gst::PadProbeReturn::Ok + }) + .unwrap(); + video_src_pad.link(&video_sink_pad)?; + + // Asynchronously set the peer bin to Playing + peer.bin.call_async(move |bin| { + // If this fails, post an error on the bus so we exit + if bin.sync_state_with_parent().is_err() { + gst_element_error!( + bin, + gst::LibraryError::Failed, + ("Failed to set peer bin to Playing") + ); + } + + // And now unblock + audio_src_pad.remove_probe(audio_block); + video_src_pad.remove_probe(video_block); + }); + + Ok(()) + } + + // Remove this peer + fn remove_peer(&self, peer: &str) -> Result<(), anyhow::Error> { + println!("Removing peer {}", peer); + let peer_id = str::parse::(peer).with_context(|| format!("Can't parse peer id"))?; + let mut peers = self.peers.lock().unwrap(); + if let Some(peer) = peers.remove(&peer_id) { + drop(peers); + + // Now asynchronously remove the peer from the pipeline + let app_clone = self.downgrade(); + self.pipeline.call_async(move |_pipeline| { + let app = upgrade_weak!(app_clone); + + // Block the tees shortly for removal + let audio_tee_sinkpad = app.audio_tee.get_static_pad("sink").unwrap(); + let audio_block = audio_tee_sinkpad + .add_probe(gst::PadProbeType::BLOCK_DOWNSTREAM, |_pad, _info| { + gst::PadProbeReturn::Ok + }) + .unwrap(); + + let video_tee_sinkpad = app.video_tee.get_static_pad("sink").unwrap(); + let video_block = video_tee_sinkpad + .add_probe(gst::PadProbeType::BLOCK_DOWNSTREAM, |_pad, _info| { + gst::PadProbeReturn::Ok + }) + .unwrap(); + + // Release the tee pads and unblock + let audio_sinkpad = peer.bin.get_static_pad("audio_sink").unwrap(); + let video_sinkpad = peer.bin.get_static_pad("video_sink").unwrap(); + + if let Some(audio_tee_srcpad) = audio_sinkpad.get_peer() { + let _ = audio_tee_srcpad.unlink(&audio_sinkpad); + app.audio_tee.release_request_pad(&audio_tee_srcpad); + } + audio_tee_sinkpad.remove_probe(audio_block); + + if let Some(video_tee_srcpad) = video_sinkpad.get_peer() { + let _ = video_tee_srcpad.unlink(&video_sinkpad); + app.video_tee.release_request_pad(&video_tee_srcpad); + } + video_tee_sinkpad.remove_probe(video_block); + + // Then remove the peer bin gracefully from the pipeline + let _ = app.pipeline.remove(&peer.bin); + let _ = peer.bin.set_state(gst::State::Null); + + println!("Removed peer {}", peer.peer_id); + }); + } + + Ok(()) + } + + fn relayout_videomixer(&self) { + let mut pads = self.video_mixer.get_sink_pads(); + if pads.is_empty() { + return; + } + + // We ignore the first pad + pads.remove(0); + let npads = pads.len(); + + let (width, height) = if npads <= 1 { + (1, 1) + } else if npads <= 4 { + (2, 2) + } else if npads <= 16 { + (4, 4) + } else { + // FIXME: we don't support more than 16 streams for now + (4, 4) + }; + + let mut x: i32 = 0; + let mut y: i32 = 0; + let w = VIDEO_WIDTH as i32 / width; + let h = VIDEO_HEIGHT as i32 / height; + + for pad in pads { + pad.set_property("xpos", &x).unwrap(); + pad.set_property("ypos", &y).unwrap(); + pad.set_property("width", &w).unwrap(); + pad.set_property("height", &h).unwrap(); + + x += w; + if x >= VIDEO_WIDTH as i32 { + x = 0; + y += h; + } + } + } +} + +// Make sure to shut down the pipeline when it goes out of scope +// to release any system resources +impl Drop for AppInner { + fn drop(&mut self) { + let _ = self.pipeline.set_state(gst::State::Null); + } +} + +impl Peer { + // Downgrade the strong reference to a weak reference + fn downgrade(&self) -> PeerWeak { + PeerWeak(Arc::downgrade(&self.0)) + } + + // Whenever webrtcbin tells us that (re-)negotiation is needed, simply ask + // for a new offer SDP from webrtcbin without any customization and then + // asynchronously send it to the peer via the WebSocket connection + fn on_negotiation_needed(&self) -> Result<(), anyhow::Error> { + println!("starting negotiation with peer {}", self.peer_id); + + let peer_clone = self.downgrade(); + let promise = gst::Promise::new_with_change_func(move |promise| { + let peer = upgrade_weak!(peer_clone); + + if let Err(err) = peer.on_offer_created(promise) { + gst_element_error!( + peer.bin, + gst::LibraryError::Failed, + ("Failed to send SDP offer: {:?}", err) + ); + } + }); + + self.webrtcbin + .emit("create-offer", &[&None::, &promise]) + .unwrap(); + + Ok(()) + } + + // Once webrtcbin has create the offer SDP for us, handle it by sending it to the peer via the + // WebSocket connection + fn on_offer_created(&self, promise: &gst::Promise) -> Result<(), anyhow::Error> { + let reply = match promise.wait() { + gst::PromiseResult::Replied => promise.get_reply().unwrap(), + err => { + bail!("Offer creation future got no reponse: {:?}", err); + } + }; + + let offer = reply + .get_value("offer") + .unwrap() + .get::() + .expect("Invalid argument"); + self.webrtcbin + .emit("set-local-description", &[&offer, &None::]) + .unwrap(); + + println!( + "sending SDP offer to peer: {}", + offer.get_sdp().as_text().unwrap() + ); + + let message = serde_json::to_string(&JsonMsg::Sdp { + type_: "offer".to_string(), + sdp: offer.get_sdp().as_text().unwrap(), + }) + .unwrap(); + + self.send_msg_tx + .lock() + .unwrap() + .unbounded_send(WsMessage::Text(format!( + "ROOM_PEER_MSG {} {}", + self.peer_id, message + ))) + .with_context(|| format!("Failed to send SDP offer"))?; + + Ok(()) + } + + // Once webrtcbin has create the answer SDP for us, handle it by sending it to the peer via the + // WebSocket connection + fn on_answer_created(&self, promise: &gst::Promise) -> Result<(), anyhow::Error> { + let reply = match promise.wait() { + gst::PromiseResult::Replied => promise.get_reply().unwrap(), + err => { + bail!("Answer creation future got no reponse: {:?}", err); + } + }; + + let answer = reply + .get_value("answer") + .unwrap() + .get::() + .expect("Invalid argument"); + self.webrtcbin + .emit("set-local-description", &[&answer, &None::]) + .unwrap(); + + println!( + "sending SDP answer to peer: {}", + answer.get_sdp().as_text().unwrap() + ); + + let message = serde_json::to_string(&JsonMsg::Sdp { + type_: "answer".to_string(), + sdp: answer.get_sdp().as_text().unwrap(), + }) + .unwrap(); + + self.send_msg_tx + .lock() + .unwrap() + .unbounded_send(WsMessage::Text(format!( + "ROOM_PEER_MSG {} {}", + self.peer_id, message + ))) + .with_context(|| format!("Failed to send SDP answer"))?; + + Ok(()) + } + + // Handle incoming SDP answers from the peer + fn handle_sdp(&self, type_: &str, sdp: &str) -> Result<(), anyhow::Error> { + if type_ == "answer" { + print!("Received answer:\n{}\n", sdp); + + let ret = gst_sdp::SDPMessage::parse_buffer(sdp.as_bytes()) + .map_err(|_| anyhow!("Failed to parse SDP answer"))?; + let answer = + gst_webrtc::WebRTCSessionDescription::new(gst_webrtc::WebRTCSDPType::Answer, ret); + + self.webrtcbin + .emit("set-remote-description", &[&answer, &None::]) + .unwrap(); + + Ok(()) + } else if type_ == "offer" { + print!("Received offer:\n{}\n", sdp); + + let ret = gst_sdp::SDPMessage::parse_buffer(sdp.as_bytes()) + .map_err(|_| anyhow!("Failed to parse SDP offer"))?; + + // And then asynchronously start our pipeline and do the next steps. The + // pipeline needs to be started before we can create an answer + let peer_clone = self.downgrade(); + self.bin.call_async(move |_pipeline| { + let peer = upgrade_weak!(peer_clone); + + let offer = gst_webrtc::WebRTCSessionDescription::new( + gst_webrtc::WebRTCSDPType::Offer, + ret, + ); + + peer.0 + .webrtcbin + .emit("set-remote-description", &[&offer, &None::]) + .unwrap(); + + let peer_clone = peer.downgrade(); + let promise = gst::Promise::new_with_change_func(move |promise| { + let peer = upgrade_weak!(peer_clone); + + if let Err(err) = peer.on_answer_created(promise) { + gst_element_error!( + peer.bin, + gst::LibraryError::Failed, + ("Failed to send SDP answer: {:?}", err) + ); + } + }); + + peer.0 + .webrtcbin + .emit("create-answer", &[&None::, &promise]) + .unwrap(); + }); + + Ok(()) + } else { + bail!("Sdp type is not \"answer\" but \"{}\"", type_) + } + } + + // Handle incoming ICE candidates from the peer by passing them to webrtcbin + fn handle_ice(&self, sdp_mline_index: u32, candidate: &str) -> Result<(), anyhow::Error> { + self.webrtcbin + .emit("add-ice-candidate", &[&sdp_mline_index, &candidate]) + .unwrap(); + + Ok(()) + } + + // Asynchronously send ICE candidates to the peer via the WebSocket connection as a JSON + // message + fn on_ice_candidate(&self, mlineindex: u32, candidate: String) -> Result<(), anyhow::Error> { + let message = serde_json::to_string(&JsonMsg::Ice { + candidate, + sdp_mline_index: mlineindex, + }) + .unwrap(); + + self.send_msg_tx + .lock() + .unwrap() + .unbounded_send(WsMessage::Text(format!( + "ROOM_PEER_MSG {} {}", + self.peer_id, message + ))) + .with_context(|| format!("Failed to send ICE candidate"))?; + + Ok(()) + } + + // Whenever there's a new incoming, encoded stream from the peer create a new decodebin + // and audio/video sink depending on the stream type + fn on_incoming_stream(&self, pad: &gst::Pad) -> Result<(), anyhow::Error> { + // Early return for the source pads we're adding ourselves + if pad.get_direction() != gst::PadDirection::Src { + return Ok(()); + } + + let caps = pad.get_current_caps().unwrap(); + let s = caps.get_structure(0).unwrap(); + let media_type = s + .get::<&str>("media") + .ok_or_else(|| anyhow!("no media type in caps {:?}", caps))?; + + let conv = if media_type == "video" { + gst::parse_bin_from_description( + &format!( + "decodebin name=dbin ! queue ! videoconvert ! videoscale ! capsfilter name=src caps=video/x-raw,width={width},height={height},pixel-aspect-ratio=1/1", + width=VIDEO_WIDTH, + height=VIDEO_HEIGHT + ), + false, + )? + } else if media_type == "audio" { + gst::parse_bin_from_description( + "decodebin name=dbin ! queue ! audioconvert ! audioresample name=src", + false, + )? + } else { + println!("Unknown pad {:?}, ignoring", pad); + return Ok(()); + }; + + // Add a ghost pad on our conv bin that proxies the sink pad of the decodebin + let dbin = conv.get_by_name("dbin").unwrap(); + let sinkpad = + gst::GhostPad::new(Some("sink"), &dbin.get_static_pad("sink").unwrap()).unwrap(); + conv.add_pad(&sinkpad).unwrap(); + + // And another one that proxies the source pad of the last element + let src = conv.get_by_name("src").unwrap(); + let srcpad = gst::GhostPad::new(Some("src"), &src.get_static_pad("src").unwrap()).unwrap(); + conv.add_pad(&srcpad).unwrap(); + + self.bin.add(&conv).unwrap(); + conv.sync_state_with_parent() + .with_context(|| format!("can't start sink for stream {:?}", caps))?; + + pad.link(&sinkpad) + .with_context(|| format!("can't link sink for stream {:?}", caps))?; + + // And then add a new ghost pad to the peer bin that proxies the source pad we added above + if media_type == "video" { + let srcpad = gst::GhostPad::new(Some("video_src"), &srcpad).unwrap(); + srcpad.set_active(true).unwrap(); + self.bin.add_pad(&srcpad).unwrap(); + } else if media_type == "audio" { + let srcpad = gst::GhostPad::new(Some("audio_src"), &srcpad).unwrap(); + srcpad.set_active(true).unwrap(); + self.bin.add_pad(&srcpad).unwrap(); + } + + Ok(()) + } +} + +// At least shut down the bin here if it didn't happen so far +impl Drop for PeerInner { + fn drop(&mut self) { + let _ = self.bin.set_state(gst::State::Null); + } +} + +async fn run( + args: Args, + initial_peers: &[&str], + ws: impl Sink + Stream>, +) -> Result<(), anyhow::Error> { + // Split the websocket into the Sink and Stream + let (mut ws_sink, ws_stream) = ws.split(); + // Fuse the Stream, required for the select macro + let mut ws_stream = ws_stream.fuse(); + + // Create our application state + let (app, send_gst_msg_rx, send_ws_msg_rx) = App::new(args, initial_peers)?; + + let mut send_gst_msg_rx = send_gst_msg_rx.fuse(); + let mut send_ws_msg_rx = send_ws_msg_rx.fuse(); + + // And now let's start our message loop + loop { + let ws_msg = futures::select! { + // Handle the WebSocket messages here + ws_msg = ws_stream.select_next_some() => { + match ws_msg? { + WsMessage::Close(_) => { + println!("peer disconnected"); + break + }, + WsMessage::Ping(data) => Some(WsMessage::Pong(data)), + WsMessage::Pong(_) => None, + WsMessage::Binary(_) => None, + WsMessage::Text(text) => { + if let Err(err) = app.handle_websocket_message(&text) { + println!("Failed to parse message: {}", err); + } + None + }, + } + }, + // Pass the GStreamer messages to the application control logic + gst_msg = send_gst_msg_rx.select_next_some() => { + app.handle_pipeline_message(&gst_msg)?; + None + }, + // Handle WebSocket messages we created asynchronously + // to send them out now + ws_msg = send_ws_msg_rx.select_next_some() => Some(ws_msg), + // Once we're done, break the loop and return + complete => break, + }; + + // If there's a message to send out, do so now + if let Some(ws_msg) = ws_msg { + ws_sink.send(ws_msg).await?; + } + } + + Ok(()) +} + +// Check if all GStreamer plugins we require are available +fn check_plugins() -> Result<(), anyhow::Error> { + let needed = [ + "videotestsrc", + "audiotestsrc", + "videoconvert", + "audioconvert", + "autodetect", + "opus", + "vpx", + "webrtc", + "nice", + "dtls", + "srtp", + "rtpmanager", + "rtp", + "playback", + "videoscale", + "audioresample", + "compositor", + "audiomixer", + ]; + + let registry = gst::Registry::get(); + let missing = needed + .iter() + .filter(|n| registry.find_plugin(n).is_none()) + .cloned() + .collect::>(); + + if !missing.is_empty() { + bail!("Missing plugins: {:?}", missing); + } else { + Ok(()) + } +} + +async fn async_main() -> Result<(), anyhow::Error> { + // Initialize GStreamer first + gst::init()?; + + check_plugins()?; + + let args = Args::from_args(); + + // Connect to the given server + let url = url::Url::parse(&args.server)?; + let (mut ws, _) = async_tungstenite::connect_async(url).await?; + + println!("connected"); + + // Say HELLO to the server and see if it replies with HELLO + let our_id = rand::thread_rng().gen_range(10, 10_000); + println!("Registering id {} with server", our_id); + ws.send(WsMessage::Text(format!("HELLO {}", our_id))) + .await?; + + let msg = ws + .next() + .await + .ok_or_else(|| anyhow!("didn't receive anything"))??; + + if msg != WsMessage::Text("HELLO".into()) { + bail!("server didn't say HELLO"); + } + + // Join the given room + ws.send(WsMessage::Text(format!("ROOM {}", args.room_id))) + .await?; + + let msg = ws + .next() + .await + .ok_or_else(|| anyhow!("didn't receive anything"))??; + + let peers_str; + if let WsMessage::Text(text) = &msg { + if !text.starts_with("ROOM_OK") { + bail!("server error: {:?}", text); + } + + println!("Joined room {}", args.room_id); + + peers_str = &text["ROOM_OK ".len()..]; + } else { + bail!("server error: {:?}", msg); + } + + // Collect the ids of already existing peers + let initial_peers = peers_str + .split(' ') + .filter_map(|p| { + // Filter out empty lines + let p = p.trim(); + if p.is_empty() { + None + } else { + Some(p) + } + }) + .collect::>(); + + // All good, let's run our message loop + run(args, &initial_peers, ws).await +} + +fn main() -> Result<(), anyhow::Error> { + macos_workaround::run(|| task::block_on(async_main())) +}