2022-02-25 16:22:29 +01:00
|
|
|
extern crate log;
|
|
|
|
extern crate simplelog;
|
|
|
|
|
2022-03-28 15:52:03 +02:00
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
|
2022-02-20 22:08:17 +01:00
|
|
|
mod filter;
|
2022-03-18 17:04:43 +01:00
|
|
|
mod input;
|
2022-02-16 18:27:03 +01:00
|
|
|
mod output;
|
2022-02-12 22:32:51 +01:00
|
|
|
mod utils;
|
2022-02-16 18:27:03 +01:00
|
|
|
|
2022-02-25 16:22:29 +01:00
|
|
|
use simplelog::*;
|
2022-03-28 15:52:03 +02:00
|
|
|
use tokio::runtime::Builder;
|
2022-02-25 16:22:29 +01:00
|
|
|
|
2022-03-10 19:50:05 +01:00
|
|
|
use crate::output::play;
|
2022-03-24 17:21:38 +01:00
|
|
|
use crate::utils::{init_config, init_logging, validate_ffmpeg};
|
2022-02-12 22:32:51 +01:00
|
|
|
|
|
|
|
fn main() {
|
2022-03-13 22:18:53 +01:00
|
|
|
init_config();
|
2022-03-16 20:12:12 +01:00
|
|
|
|
2022-03-28 15:52:03 +02:00
|
|
|
let runtime = Builder::new_multi_thread()
|
|
|
|
.enable_all()
|
|
|
|
.build()
|
|
|
|
.unwrap();
|
2022-03-16 20:12:12 +01:00
|
|
|
let rt_handle = runtime.handle();
|
2022-03-28 15:52:03 +02:00
|
|
|
let is_terminated: Arc<Mutex<bool>> = Arc::new(Mutex::new(false));
|
2022-03-16 20:12:12 +01:00
|
|
|
|
2022-03-28 15:52:03 +02:00
|
|
|
let logging = init_logging(rt_handle.clone(), is_terminated.clone());
|
2022-02-25 16:22:29 +01:00
|
|
|
CombinedLogger::init(logging).unwrap();
|
2022-02-23 18:06:40 +01:00
|
|
|
|
2022-03-24 17:21:38 +01:00
|
|
|
validate_ffmpeg();
|
|
|
|
|
2022-03-28 15:52:03 +02:00
|
|
|
play(rt_handle, is_terminated);
|
2022-02-12 22:32:51 +01:00
|
|
|
}
|