made ffmpeg thread running with no window

This commit is contained in:
Valmo Trindade
2025-04-06 06:02:53 -03:00
parent 10683d9e2f
commit 63c60bc81a

View File

@@ -1,5 +1,6 @@
use arma_rs::Context; use arma_rs::Context;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use std::os::windows::process::CommandExt;
use std::process::Command; use std::process::Command;
use std::sync::mpsc::{self, Receiver, Sender}; use std::sync::mpsc::{self, Receiver, Sender};
use std::sync::Mutex; use std::sync::Mutex;
@@ -9,6 +10,8 @@ lazy_static! {
static ref STREAM_CTRL: Mutex<Option<Sender<()>>> = Mutex::new(None); static ref STREAM_CTRL: Mutex<Option<Sender<()>>> = Mutex::new(None);
} }
const CREATE_NO_WINDOW: u32 = 0x08000000;
pub fn start_stream( pub fn start_stream(
ctx: Context, ctx: Context,
address: String, address: String,
@@ -37,6 +40,7 @@ pub fn start_stream(
"tcp", "tcp",
&rtsp_url_clone, &rtsp_url_clone,
]) ])
.creation_flags(CREATE_NO_WINDOW)
.spawn() .spawn()
{ {
Ok(child) => child, Ok(child) => child,