basic demux read loop (broken)

This commit is contained in:
Muaz Ahmad 2023-10-06 14:55:04 +05:00
parent 0d65197ce9
commit 570fae4017

View file

@ -3,6 +3,7 @@ mod flv;
use std::sync::mpsc; use std::sync::mpsc;
use std::error::Error; use std::error::Error;
use std::thread;
use crate::util; use crate::util;
use crate::demux::input::FileReader; use crate::demux::input::FileReader;
@ -18,8 +19,11 @@ pub fn spawn() -> Result<
> { > {
let mut reader = input::new_reader()?; let mut reader = input::new_reader()?;
let metadata = reader.init()?; let metadata = reader.init()?;
let (_v_in, v_out) = mpsc::channel(); let (v_in, v_out) = mpsc::channel();
let (_a_in, a_out) = mpsc::channel(); let (a_in, a_out) = mpsc::channel();
let (_err_in, err_out) = mpsc::channel(); let (err_in, err_out) = mpsc::channel();
thread::spawn(move || {
reader.data_loop(v_in, a_in, &metadata, err_in);
});
return Ok((v_out, a_out, metadata, err_out)); return Ok((v_out, a_out, metadata, err_out));
} }