From 27504d97540a53dae57d9526c8b182e1b4328819 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Tue, 13 Aug 2024 20:00:32 -0700 Subject: [PATCH] narrowed down the required plugins --- Cargo.toml | 2 +- flake.nix | 2 +- src/main.rs | 34 ++++++++++++---------------------- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d4dec6..8ac88d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ gst-plugin-rtsp = "0.13.0" gst-plugin-hlssink3 = "0.13.0" gst-plugin-reqwest = "0.13.0" -gstreamer = { version = "0.23.0", features = ["v1_22"] } +gstreamer = { version = "0.23.0", features = ["v1_24"] } gstreamer-webrtc = { version = "0.23.0", features = ["v1_22"] } lazy_static = "1.5.0" log = "0.4.22" diff --git a/flake.nix b/flake.nix index dc75467..1985e0d 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ Some utility commands: gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad # contains gst-webrtc gst_all_1.gst-plugins-ugly # contains x264enc - gst_all_1.gst-plugins-rs #contains whipclientsink + # gst_all_1.gst-plugins-rs #contains whipclientsink mediamtx libnice ]; diff --git a/src/main.rs b/src/main.rs index 9f53323..a22ab2e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,8 +35,8 @@ fn main() -> Result<(), Error> { gstrswebrtc::plugin_register_static()?; gstrsrtp::plugin_register_static()?; - gstrsrtsp::plugin_register_static()?; - gstwebrtchttp::plugin_register_static()?; + // gstrsrtsp::plugin_register_static()?; + // gstwebrtchttp::plugin_register_static()?; // gsthlssink3::plugin_register_static()?; // working pipeline @@ -59,39 +59,29 @@ fn main() -> Result<(), Error> { let signaller = whipsink.property::("signaller"); signaller.set_property_from_str( "whip-endpoint", - &format!("http://localhost:{}/whip", 8889), + "http://localhost:8080/whip" ); } + for i in whipclientsink.list_properties() { + println!("{:?}", i.type_()); + } + pipeline .add_many(&[&videotestsrc, &x264enc, &whipclientsink]) .unwrap(); Element::link_many(&[&videotestsrc, &x264enc, &whipclientsink]) .unwrap(); - - if let Some(whipsink) = whipclientsink.dynamic_cast_ref::() { - let signaller = whipsink.property::("signaller"); - signaller.set_property_from_str( - "whip-endpoint", - &format!("http://localhost:{}/whip", 8889), - ); - } - // PIPELINE START pipeline.set_state(State::Playing).unwrap(); + let bus = pipeline.bus().unwrap(); - - loop { - if to_quit.load(std::sync::atomic::Ordering::SeqCst) { - println!("Recieved Ctrl+C, stopping"); - - pipeline.set_state(State::Null).unwrap(); - break; - } - std::thread::sleep(std::time::Duration::from_millis(200)); - } + let _ = bus.timed_pop_filtered( + gstreamer::ClockTime::NONE, + &[gstreamer::MessageType::Eos] + ); println!("Success!");