gst-plugins-rs/net/webrtc/src/signaller/mod.rs
Sebastian Dröge 4ad101b53b Use once_cell crate directly again
The glib crate does not depend on it anymore and also does not re-export
it anymore.

Also switch some usages of OnceCell to OnceLock from std.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1441>
2024-01-31 18:07:57 +02:00

52 lines
1.2 KiB
Rust

mod iface;
mod imp;
use gst::glib;
/**
* GstRSWebRTCSignallableIface:
* @title: Interface for WebRTC signalling protocols
*
* Interface that WebRTC elements can implement their own protocol with.
*/
use once_cell::sync::Lazy;
// Expose traits and objects from the module itself so it exactly looks like
// generated bindings
pub use imp::WebRTCSignallerRole;
pub mod prelude {
pub use {super::SignallableExt, super::SignallableImpl};
}
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
gst::DebugCategory::new(
"webrtcsrc-signaller",
gst::DebugColorFlags::empty(),
Some("WebRTC src signaller"),
)
});
glib::wrapper! {
pub struct Signallable(ObjectInterface<iface::Signallable>);
}
glib::wrapper! {
pub struct Signaller(ObjectSubclass <imp::Signaller>) @implements Signallable;
}
impl Default for Signaller {
fn default() -> Self {
glib::Object::builder().build()
}
}
impl Signaller {
pub fn new(mode: WebRTCSignallerRole) -> Self {
glib::Object::builder().property("role", mode).build()
}
}
pub use iface::SignallableExt;
pub use iface::SignallableImpl;
unsafe impl Send for Signallable {}
unsafe impl Sync for Signallable {}