From 7a058b1f2812ae8a840b63758cdde21616046a0a Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:29:40 -0800 Subject: [PATCH] Fuck Rust, this is getting way too complicated. Fixed error handling in ``start``. Fixed more stuff in ``render`` --- .gitignore | 7 + Cargo.lock | 2189 +++++++++++++++++ Cargo.toml | 12 + {gst-warp-sink => gst-moq-sink}/.gitignore | 0 {gst-warp-sink => gst-moq-sink}/Cargo.lock | 54 +- {gst-warp-sink => gst-moq-sink}/Cargo.toml | 7 +- {gst-warp-sink => gst-moq-sink}/build.rs | 0 {gst-warp-sink => gst-moq-sink}/src/lib.rs | 0 .../src/moqsink/imp.rs | 207 +- .../src/moqsink/mod.rs | 0 .../src/relayurl.rs | 0 src/main.rs | 45 +- src/main.rs.test.txt | 542 ---- 13 files changed, 2381 insertions(+), 682 deletions(-) create mode 100644 Cargo.lock create mode 100644 Cargo.toml rename {gst-warp-sink => gst-moq-sink}/.gitignore (100%) rename {gst-warp-sink => gst-moq-sink}/Cargo.lock (99%) rename {gst-warp-sink => gst-moq-sink}/Cargo.toml (75%) rename {gst-warp-sink => gst-moq-sink}/build.rs (100%) rename {gst-warp-sink => gst-moq-sink}/src/lib.rs (100%) rename {gst-warp-sink => gst-moq-sink}/src/moqsink/imp.rs (79%) rename {gst-warp-sink => gst-moq-sink}/src/moqsink/mod.rs (100%) rename {gst-warp-sink => gst-moq-sink}/src/relayurl.rs (100%) delete mode 100644 src/main.rs.test.txt diff --git a/.gitignore b/.gitignore index bc8e85f..2f3f4bc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,10 @@ # already existing elements were commented out #/target + + +# Added by cargo +# +# already existing elements were commented out + +#/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..a6de192 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2189 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +dependencies = [ + "backtrace", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.1", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.2.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.1.0", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.1.1", + "async-executor", + "async-io 2.2.2", + "async-lock 3.2.0", + "blocking", + "futures-lite 2.1.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +dependencies = [ + "async-lock 3.2.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.1.0", + "parking", + "polling 3.3.1", + "rustix 0.38.28", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +dependencies = [ + "event-listener 4.0.1", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" + +[[package]] +name = "async-trait" +version = "0.1.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "atomic_refcell" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "blocking" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +dependencies = [ + "async-channel 2.1.1", + "async-lock 3.2.0", + "async-task", + "fastrand 2.0.1", + "futures-io", + "futures-lite 2.1.0", + "piper", + "tracing", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-expr" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.48.5", +] + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "crossbeam-utils" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.1", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "gio-sys" +version = "0.19.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core#b47fbcc5d219064f9929e0e9cb4ce6633c187f72" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "windows-sys 0.52.0", +] + +[[package]] +name = "glib" +version = "0.19.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core#b47fbcc5d219064f9929e0e9cb4ce6633c187f72" +dependencies = [ + "bitflags 2.4.1", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.19.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core#b47fbcc5d219064f9929e0e9cb4ce6633c187f72" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "glib-sys" +version = "0.19.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core#b47fbcc5d219064f9929e0e9cb4ce6633c187f72" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gobject-sys" +version = "0.19.0" +source = "git+https://github.com/gtk-rs/gtk-rs-core#b47fbcc5d219064f9929e0e9cb4ce6633c187f72" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gst-plugin-version-helper" +version = "0.8.0" +source = "git+https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs#17f0b6157685e7ff0d8893a453edd332c4a3d3e5" +dependencies = [ + "chrono", + "toml_edit 0.21.0", +] + +[[package]] +name = "gstreamer" +version = "0.22.0" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs#3b3c3baee56d5f9ad436e684bee86f78b1631310" +dependencies = [ + "cfg-if", + "futures-channel", + "futures-core", + "futures-util", + "glib", + "gstreamer-sys", + "itertools", + "libc", + "muldiv", + "num-integer", + "num-rational", + "option-operations", + "paste", + "pin-project-lite", + "smallvec", + "thiserror", +] + +[[package]] +name = "gstreamer-base" +version = "0.22.0" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs#3b3c3baee56d5f9ad436e684bee86f78b1631310" +dependencies = [ + "atomic_refcell", + "cfg-if", + "glib", + "gstreamer", + "gstreamer-base-sys", + "libc", +] + +[[package]] +name = "gstreamer-base-sys" +version = "0.22.0" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs#3b3c3baee56d5f9ad436e684bee86f78b1631310" +dependencies = [ + "glib-sys", + "gobject-sys", + "gstreamer-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gstreamer-sys" +version = "0.22.0" +source = "git+https://gitlab.freedesktop.org/gstreamer/gstreamer-rs#3b3c3baee56d5f9ad436e684bee86f78b1631310" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "isobmff" +version = "0.1.0" +source = "git+https://github.com/LMinJae/isobmff-rs#fbfff435d99bf909766ad738b66fb974f285eee3" +dependencies = [ + "bytes", +] + +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] + +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "moq-sink" +version = "0.1.0" +dependencies = [ + "anyhow", + "bytes", + "chrono", + "gst-plugin-version-helper", + "gstreamer", + "gstreamer-base", + "gstreamer-sys", + "isobmff", + "moq-transport", + "mp4", + "once_cell", + "quinn", + "rand", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "tokio", + "tracing", + "tracing-subscriber", + "url", + "webtransport-quinn", +] + +[[package]] +name = "moq-transport" +version = "0.2.0" +source = "git+https://github.com/kixelated/moq-rs#f64c2e894e4f09873aeef4620dbf20aaabe5d12e" +dependencies = [ + "async-trait", + "bytes", + "indexmap", + "log", + "paste", + "quinn", + "thiserror", + "tokio", + "webtransport-quinn", +] + +[[package]] +name = "mp4" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ef834d5ed55e494a2ae350220314dc4aacd1c43a9498b00e320e0ea352a5c3" +dependencies = [ + "byteorder", + "bytes", + "num-rational", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "muldiv" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956787520e75e9bd233246045d19f42fb73242759cc57fba9611d940ae96d4b0" + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "option-operations" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c26d27bb1aeab65138e4bf7666045169d1717febcc9ff870166be8348b223d0" +dependencies = [ + "paste", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + +[[package]] +name = "pkg-config" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.28", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand", + "ring 0.16.20", + "rustc-hash", + "rustls", + "rustls-native-certs", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2 0.5.5", + "tracing", + "windows-sys 0.48.0", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +dependencies = [ + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "system-deps" +version = "6.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + +[[package]] +name = "target-lexicon" +version = "0.12.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" + +[[package]] +name = "thiserror" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.5", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "toml" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "value-bag" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "warp" +version = "0.1.0" +dependencies = [ + "anyhow", + "gstreamer", + "moq-sink", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.43", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.43", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" + +[[package]] +name = "web-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webtransport-generic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df712317d761312996f654739debeb3838eb02c6fd9146d9efdfd08a46674e45" +dependencies = [ + "bytes", + "tokio", +] + +[[package]] +name = "webtransport-proto" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebeada5037d6302980ae2e0ab8d840e329c1697c612c6c077172de2b7631a276" +dependencies = [ + "bytes", + "http", + "thiserror", + "url", +] + +[[package]] +name = "webtransport-quinn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6536bd7382e3ecaeaf791fefbe8aa98d987eb5809ba7f1bd20617161d3a319" +dependencies = [ + "async-std", + "bytes", + "futures", + "http", + "log", + "quinn", + "quinn-proto", + "thiserror", + "tokio", + "url", + "webtransport-generic", + "webtransport-proto", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +dependencies = [ + "memchr", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..cd96955 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "warp" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = { version = "1", features = ["backtrace"] } + +gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"} +moq-sink = { path = "gst-moq-sink" } \ No newline at end of file diff --git a/gst-warp-sink/.gitignore b/gst-moq-sink/.gitignore similarity index 100% rename from gst-warp-sink/.gitignore rename to gst-moq-sink/.gitignore diff --git a/gst-warp-sink/Cargo.lock b/gst-moq-sink/Cargo.lock similarity index 99% rename from gst-warp-sink/Cargo.lock rename to gst-moq-sink/Cargo.lock index 9cf8ec2..aa65eb9 100644 --- a/gst-warp-sink/Cargo.lock +++ b/gst-moq-sink/Cargo.lock @@ -1021,7 +1021,33 @@ dependencies = [ ] [[package]] -name = "me" +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "moq-sink" version = "0.1.0" dependencies = [ "anyhow", @@ -1048,32 +1074,6 @@ dependencies = [ "webtransport-quinn", ] -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "moq-transport" version = "0.2.0" diff --git a/gst-warp-sink/Cargo.toml b/gst-moq-sink/Cargo.toml similarity index 75% rename from gst-warp-sink/Cargo.toml rename to gst-moq-sink/Cargo.toml index fdaa54b..4117ec6 100644 --- a/gst-warp-sink/Cargo.toml +++ b/gst-moq-sink/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "me" +name = "moq-sink" version = "0.1.0" edition = "2021" @@ -9,9 +9,8 @@ edition = "2021" anyhow = { version = "1", features = ["backtrace"] } gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"} -gst-app = { package = "gstreamer-app", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs"} -gst-check = { package = "gstreamer-check", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_18"] } -gst-pbutils = { package = "gstreamer-pbutils", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", features = ["v1_20"] } +gst-base = { package = "gstreamer-base", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } +gst-sys = { package = "gstreamer-sys", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" } chrono = "0.4.31" isobmff = { git = "https://github.com/LMinJae/isobmff-rs", version = "0.1.0" } bytes = "1.5.0" diff --git a/gst-warp-sink/build.rs b/gst-moq-sink/build.rs similarity index 100% rename from gst-warp-sink/build.rs rename to gst-moq-sink/build.rs diff --git a/gst-warp-sink/src/lib.rs b/gst-moq-sink/src/lib.rs similarity index 100% rename from gst-warp-sink/src/lib.rs rename to gst-moq-sink/src/lib.rs diff --git a/gst-warp-sink/src/moqsink/imp.rs b/gst-moq-sink/src/moqsink/imp.rs similarity index 79% rename from gst-warp-sink/src/moqsink/imp.rs rename to gst-moq-sink/src/moqsink/imp.rs index 11a08ef..15020d8 100644 --- a/gst-warp-sink/src/moqsink/imp.rs +++ b/gst-moq-sink/src/moqsink/imp.rs @@ -2,14 +2,15 @@ use gst::glib; use gst::glib::once_cell::sync::Lazy; use gst::prelude::*; use gst::subclass::prelude::*; +use gst::ClockTime; +use gst_base::subclass::prelude::BaseSinkImpl; -use std::sync::{Arc, Mutex}; +use std::sync::Mutex; use crate::relayurl::*; use crate::RUNTIME; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; -use tokio::sync::mpsc; use moq_transport::cache::{broadcast, fragment, segment, track}; use url::Url; @@ -106,11 +107,11 @@ struct Started { moof_atom: Option, // Below members that track current fragment (moof, mdat). /// Minimum PTS in fragment. - fragment_pts: ClockTime, + fragment_pts: Option, /// Minimum DTS in fragment. - fragment_dts: ClockTime, + fragment_dts: Option, /// Maximum PTS + duration in fragment. - fragment_max_pts_plus_duration: ClockTime, + fragment_max_pts_plus_duration: Option, /// Minimum offset in fragment. fragment_offset: Option, /// Maximum offset_end in fragment. @@ -126,9 +127,9 @@ impl Started { ftype_atom: None, moov_atom: None, moof_atom: None, - fragment_pts: ClockTime::none(), - fragment_dts: ClockTime::none(), - fragment_max_pts_plus_duration: ClockTime::none(), + fragment_pts: ClockTime::NONE, + fragment_dts: ClockTime::NONE, + fragment_max_pts_plus_duration: ClockTime::NONE, fragment_offset: None, fragment_offset_end: None, fragment_buffer_flags: gst::BufferFlags::DELTA_UNIT, @@ -185,7 +186,6 @@ static CAT: Lazy = Lazy::new(|| { ) }); -#[derive(Default, object_subclass)] pub struct MoqSink { state: Mutex, url: Mutex>, @@ -195,7 +195,7 @@ pub struct MoqSink { impl Default for MoqSink { fn default() -> Self { MoqSink { - state: Mutex::new(None), + state: Mutex::new(State::Stopped), url: Mutex::new(None), settings: Mutex::new(Settings::default()), } @@ -228,25 +228,6 @@ impl MoqSink { } }; - //More complex but with error handling - - // let relay_url = self - // .url - // .lock() - // .map_err(|e| { - // gst::error_msg!( - // gst::ResourceError::Settings, - // ["Failed to acquire URL lock: {}", e] - // ) - // })? - // .clone() - // .ok_or_else(|| { - // gst::error_msg!( - // gst::ResourceError::Settings, - // ["Cannot start without a URL being set"] - // ) - // })?; - gst::trace!( CAT, imp: self, @@ -267,12 +248,34 @@ impl MoqSink { let mut roots = rustls::RootCertStore::empty(); // Add the platform's native root certificates. - for cert in - rustls_native_certs::load_native_certs().context("could not load platform certs")? - { - roots - .add(&rustls::Certificate(cert.0)) - .context("failed to add root cert")?; + let certs = { + let c = rustls_native_certs::load_native_certs(); + match c { + Ok(certs) => certs, + Err(e) => { + gst::error!(CAT,"Could not load platform certs : {}", e); + + return gst::error_msg!( + gst::ResourceError::Failed, + ["could not load platform certs"] + ); + } + } + }; + + for cert in certs { + let res = roots.add(&rustls::Certificate(cert.0)); + match res { + Ok(_) => {} + Err(e) => { + gst::error!(CAT, "Failed to add root cert : {}", e); + + return gst::error_msg!( + gst::ResourceError::Failed, + ["failed to add root cert"] + ); + } + } } let mut tls_config = rustls::ClientConfig::builder() @@ -286,25 +289,71 @@ impl MoqSink { let arc_tls_config = std::sync::Arc::new(tls_config); let quinn_client_config = quinn::ClientConfig::new(arc_tls_config); - let mut endpoint = - quinn::Endpoint::client(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0))?; + let mut endpoint = { + let endpoint = quinn::Endpoint::client(SocketAddr::new( + IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), + 0, + )); + + match endpoint { + Ok(end) => end, + Err(e) => { + gst::error!(CAT, "Failed to set endpoint to [::]:0 : {}", e); + + return gst::error_msg!( + gst::ResourceError::Failed, + ["failed to set endpoint to [::]:0"] + ); + } + } + }; + endpoint.set_default_client_config(quinn_client_config); - let session = webtransport_quinn::connect(&endpoint, &relay_url) - .await - .context("failed to create WebTransport session")?; + let session = { + let session = webtransport_quinn::connect(&endpoint, &relay_url).await; - let session = moq_transport::session::Client::publisher(session, subscriber) - .await - .context("failed to create MoQ Transport session")?; + match session { + Ok(session) => session, + Err(e) => { + gst::error!(CAT, "Failed to create WebTransport session: {}", e); - session.run().await.context("session error")?; + return gst::error_msg!( + gst::ResourceError::Failed, + ["failed to create WebTransport session"] + ); + } + } + }; - Ok::<(), anyhow::Error>(()) + let session = { + let session = moq_transport::session::Client::publisher(session, subscriber).await; + + match session { + Ok(session) => session, + Err(e) => { + gst::error!(CAT, "Failed to create MoQ Transport session: {}", e); + + return gst::error_msg!( + gst::ResourceError::Failed, + ["failed to create MoQ Transport session"] + ); + } + } + }; + + if let Err(e) = session.run().await { + gst::error!(CAT, "Session error: {}", e); + }; + + return gst::error_msg!( + gst::ResourceError::Failed, + ["something is not working as intended on this thread"] + ); }); // Update the state to indicate the element has started - *state = State::Started(Started::new(broadcast)); + *state = State::Started(Started::new(publisher)); Ok(()) } @@ -346,18 +395,14 @@ impl ObjectSubclass for MoqSink { type ParentType = gst_base::BaseSink; type Interfaces = (gst::URIHandler,); - - type Instance; - - type Class; } -impl GstObjectImpl for WaylandDisplaySrc {} +impl GstObjectImpl for MoqSink {} impl ObjectImpl for MoqSink { fn constructed(&self) { self.parent_constructed(); - self.obj().set_sync(false); + self.obj(); } fn properties() -> &'static [glib::ParamSpec] { @@ -443,8 +488,6 @@ impl ObjectImpl for MoqSink { } } -impl GstObjectImpl for MoqSink {} - impl ElementImpl for MoqSink { fn metadata() -> Option<&'static gst::subclass::ElementMetadata> { static ELEMENT_METADATA: Lazy = Lazy::new(|| { @@ -496,11 +539,8 @@ impl BaseSinkImpl for MoqSink { fn start(&self) -> Result<(), gst::ErrorMessage> { self.start() } - fn render( - &self, - element: &Self::Type, - buffer: &gst::Buffer, - ) -> Result { + + fn render(&self, buffer: &gst::Buffer) -> Result { if let State::Stopped = *self.state.lock().unwrap() { gst::element_imp_error!(self, gst::CoreError::Failed, ["Not started yet"]); return Err(gst::FlowError::Error); @@ -536,19 +576,26 @@ impl BaseSinkImpl for MoqSink { if started_state.fragment_dts.is_none() || started_state.fragment_dts > buffer.dts() { started_state.fragment_dts = buffer.dts(); } - let pts_plus_duration = buffer.pts() + buffer.duration(); + let pts = buffer.pts(); + let duration = buffer.duration(); + + let pts_plus_duration = match (pts, duration) { + (Some(pts), Some(duration)) => Some(pts + duration), + // Handle the case where one or both values are `None` + _ => None, + }; if started_state.fragment_max_pts_plus_duration.is_none() || started_state.fragment_max_pts_plus_duration < pts_plus_duration { started_state.fragment_max_pts_plus_duration = pts_plus_duration; } - if buffer.offset() != gst::BUFFER_OFFSET_NONE + if buffer.offset() != gst_sys::GST_BUFFER_OFFSET_NONE && (started_state.fragment_offset.is_none() || started_state.fragment_offset.unwrap() > buffer.offset()) { started_state.fragment_offset = Some(buffer.offset()); } - if buffer.offset_end() != gst::BUFFER_OFFSET_NONE + if buffer.offset_end() != gst_sys::GST_BUFFER_OFFSET_NONE && (started_state.fragment_offset_end.is_none() || started_state.fragment_offset_end.unwrap() < buffer.offset_end()) { @@ -616,18 +663,31 @@ impl BaseSinkImpl for MoqSink { let buffer_ref = gst_buffer.get_mut().unwrap(); buffer_ref.set_pts(started_state.fragment_pts); buffer_ref.set_dts(started_state.fragment_dts); - let duration = started_state.fragment_max_pts_plus_duration - - started_state.fragment_pts; + // let duration = + // started_state.fragment_max_pts_plus_duration.clone() + // - started_state.fragment_pts.clone(); + + let pts_plus_duration = + started_state.fragment_max_pts_plus_duration.clone(); + let fragment_pts = started_state.fragment_pts.clone(); + + let duration = match (pts_plus_duration, fragment_pts) { + (Some(pts_plus_duration), Some(fragment_pts)) => { + Some(pts_plus_duration - fragment_pts) + } + // Handle the case where one or both values are `None` + _ => None, + }; buffer_ref.set_duration(duration); buffer_ref.set_offset( started_state .fragment_offset - .unwrap_or(gst::BUFFER_OFFSET_NONE), + .unwrap_or(gst_sys::GST_BUFFER_OFFSET_NONE), ); buffer_ref.set_offset_end( started_state .fragment_offset_end - .unwrap_or(gst::BUFFER_OFFSET_NONE), + .unwrap_or(gst_sys::GST_BUFFER_OFFSET_NONE), ); buffer_ref.set_flags(started_state.fragment_buffer_flags); let mut buffer_map = buffer_ref.map_writable().unwrap(); @@ -652,29 +712,30 @@ impl BaseSinkImpl for MoqSink { //FIXME: Work on the Json here, instead of redoing it in a new method. } // Clear fragment variables. - started_state.fragment_pts = ClockTime::none(); - started_state.fragment_dts = ClockTime::none(); - started_state.fragment_max_pts_plus_duration = ClockTime::none(); + started_state.fragment_pts = ClockTime::NONE; + started_state.fragment_dts = ClockTime::NONE; + started_state.fragment_max_pts_plus_duration = ClockTime::NONE; started_state.fragment_offset = None; started_state.fragment_offset_end = None; - started_state.fragment_buffer_flags = gst::BufferFlags::DELTA_UNIT; + started_state.fragment_buffer_flags = + gst::BufferFlags::DELTA_UNIT; // Push new buffer. gst::log!(CAT, imp: self, "Pushing buffer {:?}", gst_buffer); } _ => { - gst_warning!(CAT, obj: pad, "Received mdat without ftype, moov, or moof"); + gst::warning!(CAT, imp: self, "Received mdat without ftype, moov, or moof"); } } } _ => { - gst_warning!(CAT, obj: pad, "Unknown atom type {:?}", atom); + gst::warning!(CAT, imp: self, "Unknown atom type {:?}", atom); } } } None => break, } } - gst_trace!(CAT, obj: element, "sink_chain: END: state={:?}", state); + gst::trace!(CAT, imp: self, "sink_chain: END: state={:?}", started_state); Ok(gst::FlowSuccess::Ok) } diff --git a/gst-warp-sink/src/moqsink/mod.rs b/gst-moq-sink/src/moqsink/mod.rs similarity index 100% rename from gst-warp-sink/src/moqsink/mod.rs rename to gst-moq-sink/src/moqsink/mod.rs diff --git a/gst-warp-sink/src/relayurl.rs b/gst-moq-sink/src/relayurl.rs similarity index 100% rename from gst-warp-sink/src/relayurl.rs rename to gst-moq-sink/src/relayurl.rs diff --git a/src/main.rs b/src/main.rs index 05cb0d9..3d0890c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,43 +1,16 @@ -use anyhow::Error; + use gst::prelude::*; +use std::path::PathBuf; +use std::sync::{Arc, Mutex}; + +use anyhow::Error; + fn main() -> Result<(), Error> { - gst::init()?; - gstfmp4::plugin_register_static().expect("Failed to register fmp4 plugin"); + // gst::init()?; - let pipeline = gst::parse_launch("videotestsrc num-buffers=2500 ! timecodestamper ! video/x-raw,format=I420,width=1280,height=720,framerate=30/1 ! videoconvert ! queue ! x264enc tune=zerolatency key-int-max=30 ! mp4mux streamable=true fragment-duration=1 ! ! testsink name=sink ").unwrap().downcast::().unwrap(); - - pipeline.set_state(gst::State::Playing)?; - - let bus = pipeline - .bus() - .expect("Pipeline without bus. Shouldn't happen!"); - - for msg in bus.iter_timed(gst::ClockTime::NONE) { - use gst::MessageView; - - match msg.view() { - MessageView::Eos(..) => { - println!("EOS"); - break; - } - MessageView::Error(err) => { - pipeline.set_state(gst::State::Null)?; - eprintln!( - "Got error from {}: {} ({})", - msg.src() - .map(|s| String::from(s.path_string())) - .unwrap_or_else(|| "None".into()), - err.error(), - err.debug().unwrap_or_else(|| "".into()), - ); - break; - } - _ => (), - } - } - - pipeline.set_state(gst::State::Null)?; + // gstfmp4::plugin_register_static()?; + Ok(()) } diff --git a/src/main.rs.test.txt b/src/main.rs.test.txt deleted file mode 100644 index 5aadaa5..0000000 --- a/src/main.rs.test.txt +++ /dev/null @@ -1,542 +0,0 @@ -// Copyright (C) 2022 Mathieu Duponchelle -// -// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0. -// If a copy of the MPL was not distributed with this file, You can obtain one at -// . -// -// SPDX-License-Identifier: MPL-2.0 - -// This creates a live HLS stream with one video playlist and two video playlists. -// Basic trimming is implemented - -use bytes::BytesMut; -use gst::prelude::*; - -use std::collections::VecDeque; -use std::io::Cursor; -use std::path::{Path, PathBuf}; -use std::sync::{Arc, Mutex}; - -use anyhow::Error; -use chrono::{DateTime, Duration, Utc}; -use isobmff::IO; -use m3u8_rs::{ - AlternativeMedia, AlternativeMediaType, MasterPlaylist, MediaPlaylist, MediaSegment, - VariantStream, -}; - -struct State { - video_streams: Vec, - audio_streams: Vec, - all_mimes: Vec, - path: PathBuf, - wrote_manifest: bool, -} - -impl State { - fn maybe_write_manifest(&mut self) { - if self.wrote_manifest { - return; - } - - if self.all_mimes.len() < self.video_streams.len() + self.audio_streams.len() { - return; - } - - let mut all_mimes = self.all_mimes.clone(); - all_mimes.sort(); - all_mimes.dedup(); - - let playlist = MasterPlaylist { - version: Some(7), - variants: self - .video_streams - .iter() - .map(|stream| { - let mut path = PathBuf::new(); - - path.push(&stream.name); - path.push("manifest.m3u8"); - - VariantStream { - uri: path.as_path().display().to_string(), - bandwidth: stream.bitrate, - codecs: Some(all_mimes.join(",")), - resolution: Some(m3u8_rs::Resolution { - width: stream.width, - height: stream.height, - }), - audio: Some("audio".to_string()), - ..Default::default() - } - }) - .collect(), - alternatives: self - .audio_streams - .iter() - .map(|stream| { - let mut path = PathBuf::new(); - path.push(&stream.name); - path.push("manifest.m3u8"); - - AlternativeMedia { - media_type: AlternativeMediaType::Audio, - uri: Some(path.as_path().display().to_string()), - group_id: "audio".to_string(), - language: Some(stream.lang.clone()), - name: stream.name.clone(), - default: stream.default, - autoselect: stream.default, - channels: Some("2".to_string()), - ..Default::default() - } - }) - .collect(), - independent_segments: true, - ..Default::default() - }; - - println!("Writing master manifest to {}", self.path.display()); - - let mut file = std::fs::File::create(&self.path).unwrap(); - playlist - .write_to(&mut file) - .expect("Failed to write master playlist"); - - self.wrote_manifest = true; - } -} - -struct Segment { - date_time: DateTime, - duration: gst::ClockTime, - path: String, -} - -struct UnreffedSegment { - removal_time: DateTime, - path: String, -} - -struct StreamState { - path: PathBuf, - segments: VecDeque, - trimmed_segments: VecDeque, - start_date_time: Option>, - start_time: Option, - media_sequence: u64, - segment_index: u32, -} - -struct VideoStream { - name: String, - bitrate: u64, - width: u64, - height: u64, -} - -struct AudioStream { - name: String, - lang: String, - default: bool, - wave: String, -} - -fn trim_segments(state: &mut StreamState) { - // Arbitrary 5 segments window - while state.segments.len() > 5 { - let segment = state.segments.pop_front().unwrap(); - - state.media_sequence += 1; - - state.trimmed_segments.push_back(UnreffedSegment { - // HLS spec mandates that segments are removed from the filesystem no sooner - // than the duration of the longest playlist + duration of the segment. - // This is 15 seconds (12.5 + 2.5) in our case, we use 20 seconds to be on the - // safe side - removal_time: segment - .date_time - .checked_add_signed(Duration::seconds(20)) - .unwrap(), - path: segment.path.clone(), - }); - } - - while let Some(segment) = state.trimmed_segments.front() { - if segment.removal_time < state.segments.front().unwrap().date_time { - let segment = state.trimmed_segments.pop_front().unwrap(); - - let mut path = state.path.clone(); - path.push(segment.path); - println!("Removing {}", path.display()); - std::fs::remove_file(path).expect("Failed to remove old segment"); - } else { - break; - } - } -} - -fn update_manifest(state: &mut StreamState) { - // Now write the manifest - let mut path = state.path.clone(); - path.push("manifest.m3u8"); - - println!("writing manifest to {}", path.display()); - - trim_segments(state); - - let playlist = MediaPlaylist { - version: Some(7), - target_duration: 2.5, - media_sequence: state.media_sequence, - segments: state - .segments - .iter() - .enumerate() - .map(|(idx, segment)| MediaSegment { - uri: segment.path.to_string(), - duration: (segment.duration.nseconds() as f64 - / gst::ClockTime::SECOND.nseconds() as f64) as f32, - map: Some(m3u8_rs::Map { - uri: "init.cmfi".into(), - ..Default::default() - }), - program_date_time: if idx == 0 { - Some(segment.date_time.into()) - } else { - None - }, - ..Default::default() - }) - .collect(), - end_list: false, - playlist_type: None, - i_frames_only: false, - start: None, - independent_segments: true, - ..Default::default() - }; - - let mut file = std::fs::File::create(path).unwrap(); - playlist - .write_to(&mut file) - .expect("Failed to write media playlist"); -} - -fn setup_appsink(appsink: &gst_app::AppSink, name: &str, path: &Path, is_video: bool) { - let mut path: PathBuf = path.into(); - path.push(name); - - let state = Arc::new(Mutex::new(StreamState { - segments: VecDeque::new(), - trimmed_segments: VecDeque::new(), - path, - start_date_time: None, - start_time: gst::ClockTime::NONE, - media_sequence: 0, - segment_index: 0, - })); - - appsink.set_callbacks( - gst_app::AppSinkCallbacks::builder() - .new_sample(move |sink| { - let sample = sink.pull_sample().map_err(|_| gst::FlowError::Eos)?; - // let mut state = state.lock().unwrap(); - let mut state = state.lock().unwrap(); - - // The muxer only outputs non-empty buffer lists - let mut buffer_list = sample.buffer_list_owned().expect("no buffer list"); - assert!(!buffer_list.is_empty()); - - let mut first = buffer_list.get(0).unwrap(); - - // Each list contains a full segment, i.e. does not start with a DELTA_UNIT - assert!(!first.flags().contains(gst::BufferFlags::DELTA_UNIT)); - - // If the buffer has the DISCONT and HEADER flag set then it contains the media - // header, i.e. the `ftyp`, `moov` and other media boxes. - // - // This might be the initial header or the updated header at the end of the stream. - if first - .flags() - .contains(gst::BufferFlags::DISCONT | gst::BufferFlags::HEADER) - { - // let mut path = state.path.clone(); - // std::fs::create_dir_all(&path).expect("failed to create directory"); - // path.push("init.cmfi"); - - // println!("writing header to {}", path.display()); - let map = first.map_readable().unwrap(); - let mut cursor = Cursor::new(&*map); - - let header = mp4::BoxHeader::read(&mut cursor).unwrap(); - println!("header name {}", header.name); - - match header.name { - mp4::BoxType::MoofBox => { - println!("writing manifest to moof"); - } - mp4::BoxType::MdatBox => { - println!("writing manifest to mdat"); - } - - _ => { - // Skip unknown atoms - } - } - - drop(map); - - // Remove the header from the buffer list - buffer_list.make_mut().remove(0, 1); - - // If the list is now empty then it only contained the media header and nothing - // else. - if buffer_list.is_empty() { - return Ok(gst::FlowSuccess::Ok); - } - - // Otherwise get the next buffer and continue working with that. - first = buffer_list.get(0).unwrap(); - } - - // If the buffer only has the HEADER flag set then this is a segment header that is - // followed by one or more actual media buffers. - assert!(first.flags().contains(gst::BufferFlags::HEADER)); - - let map = first.map_readable().unwrap(); - let mut cursor = Cursor::new(&*map); - - let header = mp4::BoxHeader::read(&mut cursor).unwrap(); - println!("header name 2 {}", header.name); - - match header.name { - mp4::BoxType::MoofBox => { - println!("writing manifest to moof"); - } - mp4::BoxType::MdatBox => { - println!("writing manifest to mdat"); - } - - _ => { - // Skip unknown atoms - } - } - - Ok(gst::FlowSuccess::Ok) - }) - .eos(move |_sink| { - unreachable!(); - }) - .build(), - ); -} - -fn probe_encoder(state: Arc>, enc: gst::Element) { - enc.static_pad("src").unwrap().add_probe( - gst::PadProbeType::EVENT_DOWNSTREAM, - move |_pad, info| { - let Some(ev) = info.event() else { - return gst::PadProbeReturn::Ok; - }; - let gst::EventView::Caps(ev) = ev.view() else { - return gst::PadProbeReturn::Ok; - }; - - let mime = gst_pbutils::codec_utils_caps_get_mime_codec(ev.caps()); - - let mut state = state.lock().unwrap(); - state.all_mimes.push(mime.unwrap().into()); - state.maybe_write_manifest(); - - gst::PadProbeReturn::Remove - }, - ); -} - -impl VideoStream { - fn setup( - &self, - state: Arc>, - pipeline: &gst::Pipeline, - path: &Path, - ) -> Result<(), Error> { - let src = gst::ElementFactory::make("videotestsrc") - .property("is-live", true) - .build()?; - - let raw_capsfilter = gst::ElementFactory::make("capsfilter") - .property( - "caps", - gst_video::VideoCapsBuilder::new() - .format(gst_video::VideoFormat::I420) - .width(self.width as i32) - .height(self.height as i32) - .framerate(30.into()) - .build(), - ) - .build()?; - let timeoverlay = gst::ElementFactory::make("timeoverlay").build()?; - let enc = gst::ElementFactory::make("x264enc") - .property("bframes", 0u32) - .property("bitrate", self.bitrate as u32 / 1000u32) - .property_from_str("tune", "zerolatency") - .build()?; - let h264_capsfilter = gst::ElementFactory::make("capsfilter") - .property( - "caps", - gst::Caps::builder("video/x-h264") - .field("profile", "main") - .build(), - ) - .build()?; - let mux = gst::ElementFactory::make("cmafmux") - .property("movie-timescale", 0) - .property("fragment-duration", 1.mseconds()) - .build()?; - let appsink = gst_app::AppSink::builder().buffer_list(true).build(); - - pipeline.add_many([ - &src, - &raw_capsfilter, - &timeoverlay, - &enc, - &h264_capsfilter, - &mux, - appsink.upcast_ref(), - ])?; - - gst::Element::link_many([ - &src, - &raw_capsfilter, - &timeoverlay, - &enc, - &h264_capsfilter, - &mux, - appsink.upcast_ref(), - ])?; - - probe_encoder(state, enc); - - setup_appsink(&appsink, &self.name, path, true); - - Ok(()) - } -} - -impl AudioStream { - fn setup( - &self, - state: Arc>, - pipeline: &gst::Pipeline, - path: &Path, - ) -> Result<(), Error> { - let src = gst::ElementFactory::make("audiotestsrc") - .property("is-live", true) - .property_from_str("wave", &self.wave) - .build()?; - let enc = gst::ElementFactory::make("avenc_aac").build()?; - let mux = gst::ElementFactory::make("cmafmux") - .property("fragment-duration", 1.mseconds()) - .property("movie-timescale", 0) - .build()?; - let appsink = gst_app::AppSink::builder().buffer_list(true).build(); - - pipeline.add_many([&src, &enc, &mux, appsink.upcast_ref()])?; - - gst::Element::link_many([&src, &enc, &mux, appsink.upcast_ref()])?; - - probe_encoder(state, enc); - - setup_appsink(&appsink, &self.name, path, false); - - Ok(()) - } -} - -fn main() -> Result<(), Error> { - gst::init()?; - - gstfmp4::plugin_register_static()?; - - let path = PathBuf::from("hls_live_stream"); - - let pipeline = gst::Pipeline::default(); - - std::fs::create_dir_all(&path).expect("failed to create directory"); - - let mut manifest_path = path.clone(); - manifest_path.push("manifest.m3u8"); - - let state = Arc::new(Mutex::new(State { - video_streams: vec![VideoStream { - name: "video_0".to_string(), - bitrate: 2_048_000, - width: 1280, - height: 720, - }], - audio_streams: vec![ - AudioStream { - name: "audio_0".to_string(), - lang: "eng".to_string(), - default: true, - wave: "sine".to_string(), - }, - AudioStream { - name: "audio_1".to_string(), - lang: "fre".to_string(), - default: false, - wave: "white-noise".to_string(), - }, - ], - all_mimes: vec![], - path: manifest_path.clone(), - wrote_manifest: false, - })); - - { - let state_lock = state.lock().unwrap(); - - for stream in &state_lock.video_streams { - stream.setup(state.clone(), &pipeline, &path)?; - } - - for stream in &state_lock.audio_streams { - stream.setup(state.clone(), &pipeline, &path)?; - } - } - - pipeline.set_state(gst::State::Playing)?; - - let bus = pipeline - .bus() - .expect("Pipeline without bus. Shouldn't happen!"); - - for msg in bus.iter_timed(gst::ClockTime::NONE) { - use gst::MessageView; - - match msg.view() { - MessageView::Eos(..) => { - println!("EOS"); - break; - } - MessageView::Error(err) => { - pipeline.set_state(gst::State::Null)?; - eprintln!( - "Got error from {}: {} ({})", - msg.src() - .map(|s| String::from(s.path_string())) - .unwrap_or_else(|| "None".into()), - err.error(), - err.debug().unwrap_or_else(|| "".into()), - ); - break; - } - _ => (), - } - } - - pipeline.set_state(gst::State::Null)?; - - Ok(()) -}