From 347bee16d486177c6c83fc47f298b63a44e75be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 22 Nov 2024 15:52:41 +0200 Subject: [PATCH] Update for GLib signal API changes Part-of: --- audio/audiofx/src/ebur128level/imp.rs | 2 +- generic/threadshare/src/appsrc/imp.rs | 4 ++-- generic/threadshare/src/jitterbuffer/imp.rs | 2 +- generic/threadshare/src/udpsink/imp.rs | 6 +++--- mux/fmp4/src/fmp4mux/imp.rs | 4 ++-- net/hlssink3/src/hlsbasesink.rs | 6 +++--- net/hlssink3/src/hlscmafsink/imp.rs | 4 ++-- net/rtp/src/basedepay/imp.rs | 6 +++--- net/rtp/src/basepay/imp.rs | 6 +++--- net/rtp/src/rtpbin2/rtprecv.rs | 2 +- net/rtp/src/rtpbin2/rtpsend.rs | 2 +- net/webrtc/src/signaller/iface.rs | 14 +++++++------- net/webrtc/src/webrtcsink/imp.rs | 8 ++++---- net/webrtc/src/webrtcsrc/imp.rs | 2 +- utils/fallbackswitch/src/fallbacksrc/imp.rs | 4 ++-- utils/tracers/src/buffer_lateness/imp.rs | 2 +- utils/tracers/src/pipeline_snapshot/imp.rs | 2 +- utils/tracers/src/queue_levels/imp.rs | 2 +- 18 files changed, 39 insertions(+), 39 deletions(-) diff --git a/audio/audiofx/src/ebur128level/imp.rs b/audio/audiofx/src/ebur128level/imp.rs index 8dcab522..e35eb5a0 100644 --- a/audio/audiofx/src/ebur128level/imp.rs +++ b/audio/audiofx/src/ebur128level/imp.rs @@ -125,7 +125,7 @@ impl ObjectImpl for EbuR128Level { static SIGNALS: LazyLock> = LazyLock::new(|| { vec![glib::subclass::Signal::builder("reset") .action() - .class_handler(|_token, args| { + .class_handler(|args| { let this = args[0].get::().unwrap(); let imp = this.imp(); diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 8e8620db..b4151758 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -485,7 +485,7 @@ impl ObjectImpl for AppSrc { .param_types([gst::Buffer::static_type()]) .return_type::() .action() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let buffer = args[1].get::().expect("signal arg"); @@ -501,7 +501,7 @@ impl ObjectImpl for AppSrc { glib::subclass::Signal::builder("end-of-stream") .return_type::() .action() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); Some(elem.imp().end_of_stream().to_value()) diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 7e46e635..45ef86e5 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -1380,7 +1380,7 @@ impl ObjectImpl for JitterBuffer { vec![ glib::subclass::Signal::builder("clear-pt-map") .action() - .class_handler(|_, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let jb = element.imp(); jb.clear_pt_map(); diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index 77ca26e2..a1fb5a86 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -1109,7 +1109,7 @@ impl ObjectImpl for UdpSink { glib::subclass::Signal::builder("add") .param_types([String::static_type(), i32::static_type()]) .action() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let host = args[1].get::().expect("signal arg"); let port = args[2].get::().expect("signal arg"); @@ -1125,7 +1125,7 @@ impl ObjectImpl for UdpSink { glib::subclass::Signal::builder("remove") .param_types([String::static_type(), i32::static_type()]) .action() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let host = args[1].get::().expect("signal arg"); let port = args[2].get::().expect("signal arg"); @@ -1140,7 +1140,7 @@ impl ObjectImpl for UdpSink { .build(), glib::subclass::Signal::builder("clear") .action() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let imp = elem.imp(); diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index 1470e608..ce6a12d3 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -3252,7 +3252,7 @@ impl ObjectImpl for FMP4Mux { vec![ glib::subclass::Signal::builder(FMP4_SIGNAL_SEND_HEADERS) .action() - .class_handler(|_token, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let imp = element.imp(); let mut state = imp.state.lock().unwrap(); @@ -3270,7 +3270,7 @@ impl ObjectImpl for FMP4Mux { glib::subclass::Signal::builder(FMP4_SIGNAL_SPLIT_AT_RUNNING_TIME) .param_types([gst::ClockTime::static_type()]) .action() - .class_handler(|_token, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let imp = element.imp(); let mut state = imp.state.lock().unwrap(); diff --git a/net/hlssink3/src/hlsbasesink.rs b/net/hlssink3/src/hlsbasesink.rs index 72310f36..1b970cde 100644 --- a/net/hlssink3/src/hlsbasesink.rs +++ b/net/hlssink3/src/hlsbasesink.rs @@ -204,7 +204,7 @@ impl ObjectImpl for HlsBaseSink { glib::subclass::Signal::builder(SIGNAL_GET_PLAYLIST_STREAM) .param_types([String::static_type()]) .return_type::>() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let playlist_location = args[1].get::().expect("signal arg"); let imp = elem.imp(); @@ -220,7 +220,7 @@ impl ObjectImpl for HlsBaseSink { glib::subclass::Signal::builder(SIGNAL_GET_FRAGMENT_STREAM) .param_types([String::static_type()]) .return_type::>() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let fragment_location = args[1].get::().expect("signal arg"); let imp = elem.imp(); @@ -236,7 +236,7 @@ impl ObjectImpl for HlsBaseSink { glib::subclass::Signal::builder(SIGNAL_DELETE_FRAGMENT) .param_types([String::static_type()]) .return_type::() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let fragment_location = args[1].get::().expect("signal arg"); let imp = elem.imp(); diff --git a/net/hlssink3/src/hlscmafsink/imp.rs b/net/hlssink3/src/hlscmafsink/imp.rs index 0d11575e..f462bb34 100644 --- a/net/hlssink3/src/hlscmafsink/imp.rs +++ b/net/hlssink3/src/hlscmafsink/imp.rs @@ -225,7 +225,7 @@ impl ObjectImpl for HlsCmafSink { glib::subclass::Signal::builder(SIGNAL_GET_INIT_STREAM) .param_types([String::static_type()]) .return_type::>() - .class_handler(|_, args| { + .class_handler(|args| { let elem = args[0].get::().expect("signal arg"); let init_location = args[1].get::().expect("signal arg"); let imp = elem.imp(); @@ -240,7 +240,7 @@ impl ObjectImpl for HlsCmafSink { .build(), glib::subclass::Signal::builder(SIGNAL_NEW_PLAYLIST) .action() - .class_handler(|_token, args| { + .class_handler(|args| { // Forces hlscmafsink to finish the current playlist and start a new one. // Meant to be used after changing output location at runtime, which would // otherwise require changing playback state to READY to make sure that the diff --git a/net/rtp/src/basedepay/imp.rs b/net/rtp/src/basedepay/imp.rs index 97632c4f..90df05b1 100644 --- a/net/rtp/src/basedepay/imp.rs +++ b/net/rtp/src/basedepay/imp.rs @@ -1936,7 +1936,7 @@ impl ObjectImpl for RtpBaseDepay2 { glib::subclass::Signal::builder("add-extension") .action() .param_types([gst_rtp::RTPHeaderExtension::static_type()]) - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); let ext = args[1].get::<&gst_rtp::RTPHeaderExtension>().unwrap(); s.imp().add_extension(ext); @@ -1955,7 +1955,7 @@ impl ObjectImpl for RtpBaseDepay2 { true } }) - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); let ext_id = args[1].get::().unwrap(); let uri = args[2].get::<&str>().unwrap(); @@ -1966,7 +1966,7 @@ impl ObjectImpl for RtpBaseDepay2 { .build(), glib::subclass::Signal::builder("clear-extensions") .action() - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); s.imp().clear_extensions(); diff --git a/net/rtp/src/basepay/imp.rs b/net/rtp/src/basepay/imp.rs index f21add7e..32208bf2 100644 --- a/net/rtp/src/basepay/imp.rs +++ b/net/rtp/src/basepay/imp.rs @@ -1974,7 +1974,7 @@ impl ObjectImpl for RtpBasePay2 { glib::subclass::Signal::builder("add-extension") .action() .param_types([gst_rtp::RTPHeaderExtension::static_type()]) - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); let ext = args[1].get::<&gst_rtp::RTPHeaderExtension>().unwrap(); s.imp().add_extension(ext); @@ -1993,7 +1993,7 @@ impl ObjectImpl for RtpBasePay2 { true } }) - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); let ext_id = args[1].get::().unwrap(); let uri = args[2].get::<&str>().unwrap(); @@ -2004,7 +2004,7 @@ impl ObjectImpl for RtpBasePay2 { .build(), glib::subclass::Signal::builder("clear-extensions") .action() - .class_handler(|_token, args| { + .class_handler(|args| { let s = args[0].get::().unwrap(); s.imp().clear_extensions(); diff --git a/net/rtp/src/rtpbin2/rtprecv.rs b/net/rtp/src/rtpbin2/rtprecv.rs index bcd6711d..1aa2727b 100644 --- a/net/rtp/src/rtpbin2/rtprecv.rs +++ b/net/rtp/src/rtpbin2/rtprecv.rs @@ -1659,7 +1659,7 @@ impl ObjectImpl for RtpRecv { .param_types([u32::static_type()]) .return_type::() .action() - .class_handler(|_token, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let id = args[1].get::().expect("signal arg"); let bin = element.imp(); diff --git a/net/rtp/src/rtpbin2/rtpsend.rs b/net/rtp/src/rtpbin2/rtpsend.rs index a6251ab5..ba065d54 100644 --- a/net/rtp/src/rtpbin2/rtpsend.rs +++ b/net/rtp/src/rtpbin2/rtpsend.rs @@ -595,7 +595,7 @@ impl ObjectImpl for RtpSend { .param_types([u32::static_type()]) .return_type::() .action() - .class_handler(|_token, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let id = args[1].get::().expect("signal arg"); let send = element.imp(); diff --git a/net/webrtc/src/signaller/iface.rs b/net/webrtc/src/signaller/iface.rs index 6b51f2ba..51abefb8 100644 --- a/net/webrtc/src/signaller/iface.rs +++ b/net/webrtc/src/signaller/iface.rs @@ -159,7 +159,7 @@ impl prelude::ObjectInterface for Signallable { */ Signal::builder("request-meta") .return_type::>() - .class_handler(|_token, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -215,7 +215,7 @@ impl prelude::ObjectInterface for Signallable { Signal::builder("start") .run_last() .return_type::() - .class_handler(|_token, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -241,7 +241,7 @@ impl prelude::ObjectInterface for Signallable { Signal::builder("stop") .run_last() .return_type::() - .class_handler(|_tokens, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -276,7 +276,7 @@ impl prelude::ObjectInterface for Signallable { .run_last() .param_types([str::static_type()]) .return_type::() - .class_handler(|_tokens, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -341,7 +341,7 @@ impl prelude::ObjectInterface for Signallable { gst_webrtc::WebRTCSessionDescription::static_type(), ]) .return_type::() - .class_handler(|_tokens, args| { + .class_handler(|args| { let _ = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -378,7 +378,7 @@ impl prelude::ObjectInterface for Signallable { gst_webrtc::WebRTCSessionDescription::static_type(), ]) .return_type::() - .class_handler(|_tokens, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { @@ -421,7 +421,7 @@ impl prelude::ObjectInterface for Signallable { String::static_type(), ]) .return_type::() - .class_handler(|_tokens, args| { + .class_handler(|args| { let this = args[0usize] .get::<&super::Signallable>() .unwrap_or_else(|e| { diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index c56ea504..08ba8f30 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -4864,7 +4864,7 @@ impl ObjectImpl for BaseWebRTCSink { */ glib::subclass::Signal::builder("get-sessions") .action() - .class_handler(|_, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let this = element.imp(); @@ -4902,7 +4902,7 @@ impl ObjectImpl for BaseWebRTCSink { ]) .return_type::() .accumulator(setup_signal_accumulator) - .class_handler(|_, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let enc = args[3].get::().unwrap(); @@ -4947,7 +4947,7 @@ impl ObjectImpl for BaseWebRTCSink { ]) .return_type::() .accumulator(setup_signal_accumulator) - .class_handler(|_, args| { + .class_handler(|args| { let pay = args[3].get::().unwrap(); configure_payloader(&pay); @@ -5014,7 +5014,7 @@ impl ObjectImpl for BaseWebRTCSink { ]) .return_type::() .run_last() - .class_handler(|_token, args| { + .class_handler(|args| { Some(args[3usize].get::().expect("wrong argument").to_value()) }) .accumulator(move |_hint, output, input| { diff --git a/net/webrtc/src/webrtcsrc/imp.rs b/net/webrtc/src/webrtcsrc/imp.rs index aa662e6d..be4fefdc 100644 --- a/net/webrtc/src/webrtcsrc/imp.rs +++ b/net/webrtc/src/webrtcsrc/imp.rs @@ -2061,7 +2061,7 @@ pub(super) mod livekit { vec![glib::subclass::Signal::builder("set-track-disabled") .param_types([bool::static_type()]) .action() - .class_handler(|_token, values| { + .class_handler(|values| { let pad = values[0] .get::<&super::super::LiveKitWebRTCSrcPad>() .unwrap(); diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index 58cd59c6..c30b17c6 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -662,7 +662,7 @@ impl ObjectImpl for FallbackSrc { glib::subclass::Signal::builder("update-uri") .param_types([String::static_type()]) .return_type::() - .class_handler(|_token, args| { + .class_handler(|args| { // Simply return the input by default Some(args[1].clone()) }) @@ -674,7 +674,7 @@ impl ObjectImpl for FallbackSrc { .build(), glib::subclass::Signal::builder("unblock") .action() - .class_handler(|_token, args| { + .class_handler(|args| { let element = args[0].get::().expect("signal arg"); let imp = element.imp(); let mut state_guard = imp.state.lock(); diff --git a/utils/tracers/src/buffer_lateness/imp.rs b/utils/tracers/src/buffer_lateness/imp.rs index d7b17bba..162a6550 100644 --- a/utils/tracers/src/buffer_lateness/imp.rs +++ b/utils/tracers/src/buffer_lateness/imp.rs @@ -237,7 +237,7 @@ impl ObjectImpl for BufferLateness { vec![glib::subclass::Signal::builder("write-log") .action() .param_types([Option::::static_type()]) - .class_handler(|_, args| { + .class_handler(|args| { let obj = args[0].get::().unwrap(); obj.imp().write_log(args[1].get::>().unwrap()); diff --git a/utils/tracers/src/pipeline_snapshot/imp.rs b/utils/tracers/src/pipeline_snapshot/imp.rs index 47a4ff05..980b5791 100644 --- a/utils/tracers/src/pipeline_snapshot/imp.rs +++ b/utils/tracers/src/pipeline_snapshot/imp.rs @@ -341,7 +341,7 @@ impl ObjectImpl for PipelineSnapshot { static SIGNALS: LazyLock> = LazyLock::new(|| { vec![glib::subclass::Signal::builder("snapshot") .action() - .class_handler(|_, args| { + .class_handler(|args| { args[0].get::().unwrap().snapshot(); None diff --git a/utils/tracers/src/queue_levels/imp.rs b/utils/tracers/src/queue_levels/imp.rs index 8fdae6e3..ef42663e 100644 --- a/utils/tracers/src/queue_levels/imp.rs +++ b/utils/tracers/src/queue_levels/imp.rs @@ -245,7 +245,7 @@ impl ObjectImpl for QueueLevels { vec![glib::subclass::Signal::builder("write-log") .action() .param_types([Option::::static_type()]) - .class_handler(|_, args| { + .class_handler(|args| { let obj = args[0].get::().unwrap(); obj.imp().write_log(args[1].get::>().unwrap());