diff options
Diffstat (limited to 'stream')
-rw-r--r-- | stream/Cargo.toml | 14 | ||||
-rw-r--r-- | stream/src/lib.rs | 15 |
2 files changed, 29 insertions, 0 deletions
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<usize>, +) -> anyhow::Result<DuplexStream> { + let (a, b) = duplex(4096); + let b = SyncIoBridge::new(b); + + Ok(a) +} |