2022-11-19 00:43:03 +00:00
|
|
|
mod iface;
|
2021-10-05 21:28:05 +00:00
|
|
|
mod imp;
|
2022-11-19 00:43:03 +00:00
|
|
|
use gst::glib;
|
2021-10-05 21:28:05 +00:00
|
|
|
|
2023-06-08 23:06:36 +00:00
|
|
|
/**
|
|
|
|
* GstRSWebRTCSignallableIface:
|
|
|
|
* @title: Interface for WebRTC signalling protocols
|
|
|
|
*
|
|
|
|
* Interface that WebRTC elements can implement their own protocol with.
|
|
|
|
*/
|
2024-01-31 15:07:56 +00:00
|
|
|
use once_cell::sync::Lazy;
|
2022-11-19 00:43:03 +00:00
|
|
|
// 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};
|
2021-10-05 21:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-11-19 00:43:03 +00:00
|
|
|
pub static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
|
|
|
gst::DebugCategory::new(
|
|
|
|
"webrtcsrc-signaller",
|
|
|
|
gst::DebugColorFlags::empty(),
|
|
|
|
Some("WebRTC src signaller"),
|
|
|
|
)
|
|
|
|
});
|
2021-10-05 21:28:05 +00:00
|
|
|
|
2022-11-19 00:43:03 +00:00
|
|
|
glib::wrapper! {
|
|
|
|
pub struct Signallable(ObjectInterface<iface::Signallable>);
|
|
|
|
}
|
2021-10-05 21:28:05 +00:00
|
|
|
|
2022-11-19 00:43:03 +00:00
|
|
|
glib::wrapper! {
|
|
|
|
pub struct Signaller(ObjectSubclass <imp::Signaller>) @implements Signallable;
|
2021-10-05 21:28:05 +00:00
|
|
|
}
|
|
|
|
|
2021-12-26 10:02:09 +00:00
|
|
|
impl Default for Signaller {
|
|
|
|
fn default() -> Self {
|
2022-11-19 00:43:03 +00:00
|
|
|
glib::Object::builder().build()
|
2021-10-05 21:28:05 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-19 00:43:03 +00:00
|
|
|
|
|
|
|
impl Signaller {
|
|
|
|
pub fn new(mode: WebRTCSignallerRole) -> Self {
|
2023-04-20 13:47:45 +00:00
|
|
|
glib::Object::builder().property("role", mode).build()
|
2022-11-19 00:43:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub use iface::SignallableExt;
|
|
|
|
pub use iface::SignallableImpl;
|
|
|
|
|
|
|
|
unsafe impl Send for Signallable {}
|
|
|
|
unsafe impl Sync for Signallable {}
|