diff --git a/net/webrtc/src/signaller/iface.rs b/net/webrtc/src/signaller/iface.rs index 177d15f7..8a9cb1d5 100644 --- a/net/webrtc/src/signaller/iface.rs +++ b/net/webrtc/src/signaller/iface.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; #[derive(Copy, Clone)] #[repr(C)] -pub struct Signallable { +pub struct SignallableInterface { _parent: glib::gobject_ffi::GTypeInterface, pub start: fn(&super::Signallable), pub stop: fn(&super::Signallable), @@ -15,6 +15,12 @@ pub struct Signallable { pub end_session: fn(&super::Signallable, &str), } +unsafe impl InterfaceStruct for SignallableInterface { + type Type = Signallable; +} + +pub enum Signallable {} + impl Signallable { fn request_meta(_iface: &super::Signallable) -> Option { None @@ -39,16 +45,17 @@ impl Signallable { } #[glib::object_interface] -unsafe impl prelude::ObjectInterface for Signallable { +impl prelude::ObjectInterface for Signallable { const NAME: &'static ::std::primitive::str = "GstRSWebRTCSignallableIface"; + type Interface = SignallableInterface; type Prerequisites = (glib::Object,); - fn interface_init(&mut self) { - self.start = Signallable::start; - self.stop = Signallable::stop; - self.send_sdp = Signallable::send_sdp; - self.add_ice = Signallable::add_ice; - self.end_session = Signallable::end_session; + fn interface_init(iface: &mut SignallableInterface) { + iface.start = Signallable::start; + iface.stop = Signallable::stop; + iface.send_sdp = Signallable::send_sdp; + iface.add_ice = Signallable::add_ice; + iface.end_session = Signallable::end_session; } fn signals() -> &'static [Signal] {