From c62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 29 Sep 2023 20:56:36 +0200 Subject: move stream generation to new crate --- stream/Cargo.toml | 14 ++++++++++++++ stream/src/lib.rs | 15 +++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 stream/Cargo.toml create mode 100644 stream/src/lib.rs (limited to 'stream') diff --git a/stream/Cargo.toml b/stream/Cargo.toml new file mode 100644 index 0000000..804bc1c --- /dev/null +++ b/stream/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "jellystream" +version = "0.1.0" +edition = "2021" + +[dependencies] +jellycommon = { path = "../common", features = ["rocket"] } +jellybase = { path = "../base" } +jellytranscoder = { path = "../transcoder" } + +log = { workspace = true } +anyhow = { workspace = true } +tokio = { version = "1.32.0", features = ["io-util"] } +tokio-util = { version = "0.7.9", features = ["io", "io-util"] } diff --git a/stream/src/lib.rs b/stream/src/lib.rs new file mode 100644 index 0000000..df75cf5 --- /dev/null +++ b/stream/src/lib.rs @@ -0,0 +1,15 @@ +use jellycommon::{stream::StreamSpec, Node}; +use std::ops::Range; +use tokio::io::{duplex, DuplexStream}; +use tokio_util::io::SyncIoBridge; + +pub async fn stream( + node: Node, + spec: StreamSpec, + range: Range, +) -> anyhow::Result { + let (a, b) = duplex(4096); + let b = SyncIoBridge::new(b); + + Ok(a) +} -- cgit v1.2.3-70-g09d2