mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
linted video streaming callbacks
This commit is contained in:
@@ -26,7 +26,7 @@ pub fn start_stream(
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
ctx.callback_null(
|
ctx.callback_null(
|
||||||
"armatak_video_error",
|
"VIDEO ERROR",
|
||||||
"Screen capture is only supported on Windows",
|
"Screen capture is only supported on Windows",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -63,12 +63,12 @@ pub fn start_stream(
|
|||||||
let mut child = cmd.creation_flags(CREATE_NO_WINDOW).spawn().unwrap();
|
let mut child = cmd.creation_flags(CREATE_NO_WINDOW).spawn().unwrap();
|
||||||
|
|
||||||
if rx.recv().is_err() {
|
if rx.recv().is_err() {
|
||||||
let _ = ctx.callback_null("armatak_video_error", "Error receiving stop signal");
|
let _ = ctx.callback_null("VIDEO ERROR", "Error receiving stop signal");
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Err(e) = child.kill() {
|
if let Err(e) = child.kill() {
|
||||||
let _ = ctx.callback_data(
|
let _ = ctx.callback_data(
|
||||||
"armatak_video_error",
|
"VIDEO ERROR",
|
||||||
"Failed to Stop FFmpeg",
|
"Failed to Stop FFmpeg",
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
);
|
);
|
||||||
@@ -92,19 +92,19 @@ pub fn stop_stream(ctx: Context) -> &'static str {
|
|||||||
if let Some(tx) = lock.take() {
|
if let Some(tx) = lock.take() {
|
||||||
if let Err(e) = tx.send(()) {
|
if let Err(e) = tx.send(()) {
|
||||||
let _ = ctx.callback_data(
|
let _ = ctx.callback_data(
|
||||||
"armatak_video_error",
|
"VIDEO ERROR",
|
||||||
"Failed to send stop signal",
|
"Failed to send stop signal",
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let _ =
|
let _ =
|
||||||
ctx.callback_null("armatak_video_error", "Tried to stop a nonexistent stream");
|
ctx.callback_null("VIDEO ERROR", "Tried to stop a nonexistent stream");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let _ = ctx.callback_data(
|
let _ = ctx.callback_data(
|
||||||
"armatak_video_error",
|
"VIDEO ERROR",
|
||||||
"Failed to acquire lock",
|
"Failed to acquire lock",
|
||||||
e.to_string(),
|
e.to_string(),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user