initial example axum, streamer runs in thread

This commit is contained in:
devdesk
2024-02-20 23:29:33 +02:00
parent 24b65a8ee5
commit 831322e44a
3 changed files with 83 additions and 4 deletions

View File

@@ -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);
}
});
}