mod util; mod demux; mod decode; mod encode; mod muxer; use std::process::exit; use std::sync::mpsc; fn init() -> Result<[mpsc::Receiver>; 4], Box>{ let (v_out, a_out, metadata, demux_err_recv) = demux::spawn()?; let (raw_v_out, raw_a_out, decode_err_recv) = decode::spawn(v_out, a_out, &metadata)?; let (enc_v_out, enc_a_out, encode_err_recv) = encode::spawn(raw_v_out, raw_a_out, &metadata)?; let muxer_err_recv = muxer::spawn(enc_v_out, enc_a_out, &metadata)?; return Ok([demux_err_recv, decode_err_recv, encode_err_recv, muxer_err_recv]); } fn process(error_handles: [mpsc::Receiver>; 4]) -> Result<(), Box> { todo!(); } fn main() { let error_handles = match init() { Ok(x) => x, Err(x) => {dbg!(x); exit(1);} }; match process(error_handles) { Ok(_) => (), Err(x) => {dbg!(x); exit(1)} }; exit(0); }