gstreamer-rs/gstreamer-webrtc/src/auto/web_rtcrtp_receiver.rs

69 lines
2.3 KiB
Rust
Raw Normal View History

2018-04-23 17:34:22 +00:00
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
2018-03-15 16:04:49 +00:00
// DO NOT EDIT
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
2020-11-22 10:46:23 +00:00
use crate::WebRTCDTLSTransport;
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
use glib::{
prelude::*,
signal::{connect_raw, SignalHandlerId},
translate::*,
};
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
use std::{boxed::Box as Box_, mem::transmute};
2018-03-15 16:04:49 +00:00
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstWebRTCRTPReceiver")]
2020-11-22 10:46:23 +00:00
pub struct WebRTCRTPReceiver(Object<ffi::GstWebRTCRTPReceiver, ffi::GstWebRTCRTPReceiverClass>);
2018-03-15 16:04:49 +00:00
match fn {
type_ => || ffi::gst_webrtc_rtp_receiver_get_type(),
2018-03-15 16:04:49 +00:00
}
}
impl WebRTCRTPReceiver {
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
pub fn transport(&self) -> Option<WebRTCDTLSTransport> {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self, "transport")
2018-03-15 16:04:49 +00:00
}
2021-04-17 10:11:52 +00:00
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "transport")]
pub fn connect_transport_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_transport_trampoline<
F: Fn(&WebRTCRTPReceiver) + Send + Sync + 'static,
>(
this: *mut ffi::GstWebRTCRTPReceiver,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
2018-03-15 16:04:49 +00:00
unsafe {
2021-04-17 10:11:52 +00:00
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::transport\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_transport_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
2018-03-15 16:04:49 +00:00
}
}
}
unsafe impl Send for WebRTCRTPReceiver {}
unsafe impl Sync for WebRTCRTPReceiver {}