webrtc: Update Signallable interface to new interface definition API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1570>
This commit is contained in:
Sebastian Dröge 2024-05-10 14:13:35 +03:00
parent f842aff6df
commit e8e173d0d0

View file

@ -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<gst::Structure> {
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] {