aboutsummaryrefslogtreecommitdiff
path: root/stream
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-09-29 20:56:36 +0200
committermetamuffin <metamuffin@disroot.org>2023-09-29 20:56:36 +0200
commitc62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914 (patch)
tree7a32678b59c123ea6fbe6c01237aec5e3b143e87 /stream
parent29b12a48bcfa3aa0f814f7b39a64868b6313c13d (diff)
downloadjellything-c62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914.tar
jellything-c62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914.tar.bz2
jellything-c62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914.tar.zst
move stream generation to new crate
Diffstat (limited to 'stream')
-rw-r--r--stream/Cargo.toml14
-rw-r--r--stream/src/lib.rs15
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)
+}