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!");