Skip to content

Commit 4a6a76a

Browse files
authored
Merge pull request #123 from pipeless-ai/fixes
Minor fixes to improve UX
2 parents e849d52 + 55ff150 commit 4a6a76a

File tree

4 files changed

+129
-24
lines changed

4 files changed

+129
-24
lines changed

pipeless/Cargo.lock

+110-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pipeless/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ num_cpus = "1.16.0"
4646
gstreamer-rtsp = "0.21.0"
4747
inquire = "0.6.2"
4848
tabled = "0.15.0"
49+
ctrlc = "3.4.2"
4950

5051
[dependencies.uuid]
5152
version = "1.4.1"

pipeless/src/cli/start.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ use tokio::sync::RwLock;
44
use gstreamer as gst;
55
use glib;
66
use tokio;
7+
use ctrlc;
78

89
use crate as pipeless;
910

1011
pub fn start_pipeless_node(stages_dir: &str) {
12+
ctrlc::set_handler(|| {
13+
println!("Exiting...");
14+
std::process::exit(0);
15+
}).expect("Error setting Ctrl+C handler");
16+
1117
pipeless::setup_logger();
1218
pyo3::prepare_freethreaded_python(); // Setup Pyo3
1319

@@ -34,4 +40,4 @@ pub fn start_pipeless_node(stages_dir: &str) {
3440
});
3541

3642
glib_main_loop.run();
37-
}
43+
}

pipeless/src/output/pipeline.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,18 @@ impl Pipeline {
507507
gst_buffer_mut.set_duration(duration);
508508
}
509509

510+
510511
if let Err(err) = appsrc.push_buffer(gst_buffer) {
511-
return Err(OutputPipelineError::new(&format!("Failed to send the output buffer: {}", err)));
512+
match err {
513+
gst::FlowError::Eos => {
514+
// Do not log error or warn because confuses users
515+
debug!("Unable to send frame, output pipeline is EOS.");
516+
return Ok(());
517+
}
518+
_ => {
519+
return Err(OutputPipelineError::new(&format!("Failed to send the output buffer: {}", err)));
520+
}
521+
}
512522
}
513523
}
514524
}

0 commit comments

Comments
 (0)