Configurable encoder pipeline

This commit is contained in:
2024-03-20 22:46:19 +00:00
parent 13cb456f89
commit 529e3b6234
24 changed files with 1707 additions and 209 deletions

View File

@ -1,7 +1,6 @@
use crate::demux::Demuxer;
use tokio::sync::mpsc::UnboundedReceiver;
use crate::ingress::ConnectionInfo;
use crate::pipeline::runner::PipelineRunner;
use crate::pipeline::PipelineStep;
use crate::webhook::Webhook;
#[derive(Clone)]
@ -14,12 +13,8 @@ impl PipelineBuilder {
Self { webhook }
}
pub async fn build_for(&self, info: ConnectionInfo) -> Result<PipelineRunner, anyhow::Error> {
pub async fn build_for(&self, info: ConnectionInfo, recv: UnboundedReceiver<bytes::Bytes>) -> Result<PipelineRunner, anyhow::Error> {
let config = self.webhook.start(info).await?;
let mut steps: Vec<Box<dyn PipelineStep + Sync + Send>> = Vec::new();
steps.push(Box::new(Demuxer::new()));
Ok(PipelineRunner::new(steps))
Ok(PipelineRunner::new(config, recv))
}
}