initial example axum, streamer runs in thread
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
mod offline;
|
||||
|
||||
use crate::offline::{Header, HDR_SIZE};
|
||||
use clap::Parser;
|
||||
use dotenv::dotenv;
|
||||
use offline::{Header, HDR_SIZE};
|
||||
use std::io::Write;
|
||||
use std::{io::Write, thread::spawn};
|
||||
use v4l::video::Output;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -143,3 +141,11 @@ fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn start_stream_thread() {
|
||||
spawn(move || {
|
||||
if let Err(e) = main() {
|
||||
println!("oops: {:?}", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user