mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
added scopes for windows and linux on video stream
This commit is contained in:
@@ -57,26 +57,27 @@ pub fn start_stream(
|
|||||||
let mut child = match cmd.creation_flags(CREATE_NO_WINDOW).spawn() {
|
let mut child = match cmd.creation_flags(CREATE_NO_WINDOW).spawn() {
|
||||||
Ok(child) => child,
|
Ok(child) => child,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return ctx.callback_data(
|
let _ = ctx.callback_data(
|
||||||
"armatak_video_error",
|
"armatak_video_error",
|
||||||
"Failed to Start FFmpeg",
|
"Failed to Start FFmpeg",
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if rx.recv().is_err() {
|
if rx.recv().is_err() {
|
||||||
return ctx.callback_null("armatak_video_error", "Error receiving stop signal");
|
let _ = ctx.callback_null("armatak_video_error", "Error receiving stop signal");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
Ok(if let Err(e) = child.kill() {
|
if let Err(e) = child.kill() {
|
||||||
return ctx.callback_data(
|
let _ = ctx.callback_data(
|
||||||
"armatak_video_error",
|
"armatak_video_error",
|
||||||
"Failed to Stop FFmpeg",
|
"Failed to Stop FFmpeg",
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
);
|
);
|
||||||
})
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
match STREAM_CTRL.lock() {
|
match STREAM_CTRL.lock() {
|
||||||
|
|||||||
Reference in New Issue
Block a user