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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-03-15 16:04:49 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-01-03 18:56:00 +00:00
|
|
|
use crate::{WebRTCDTLSTransport, WebRTCPriorityType};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::{
|
|
|
|
prelude::*,
|
|
|
|
signal::{connect_raw, SignalHandlerId},
|
|
|
|
translate::*,
|
|
|
|
};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2023-01-03 18:56:00 +00:00
|
|
|
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! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstWebRTCRTPSender")]
|
2020-11-22 10:46:23 +00:00
|
|
|
pub struct WebRTCRTPSender(Object<ffi::GstWebRTCRTPSender, ffi::GstWebRTCRTPSenderClass>);
|
2018-03-15 16:04:49 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_webrtc_rtp_sender_get_type(),
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl WebRTCRTPSender {
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
#[doc(alias = "gst_webrtc_rtp_sender_set_priority")]
|
|
|
|
pub fn set_priority(&self, priority: WebRTCPriorityType) {
|
2018-03-15 16:04:49 +00:00
|
|
|
unsafe {
|
2021-04-17 10:11:52 +00:00
|
|
|
ffi::gst_webrtc_rtp_sender_set_priority(self.to_glib_none().0, priority.into_glib());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
pub fn priority(&self) -> WebRTCPriorityType {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self, "priority")
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
pub fn transport(&self) -> Option<WebRTCDTLSTransport> {
|
2021-11-06 17:31:52 +00:00
|
|
|
glib::ObjectExt::property(self, "transport")
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
#[doc(alias = "priority")]
|
|
|
|
pub fn connect_priority_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_priority_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPSender) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPSender,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
|
|
|
) {
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<F> = Box_::new(f);
|
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::priority\0".as_ptr() as *const _,
|
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_priority_trampoline::<F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_20")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
#[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(&WebRTCRTPSender) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPSender,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
|
|
|
) {
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
unsafe {
|
|
|
|
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 WebRTCRTPSender {}
|
|
|
|
unsafe impl Sync for WebRTCRTPSender {}
|