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")))]
|
2021-04-17 10:11:52 +00:00
|
|
|
use crate::WebRTCKind;
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2020-11-22 10:46:23 +00:00
|
|
|
use crate::WebRTCRTPTransceiverDirection;
|
2023-01-03 18:56:00 +00:00
|
|
|
use crate::{WebRTCRTPReceiver, WebRTCRTPSender};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::signal::{connect_raw, SignalHandlerId};
|
|
|
|
use glib::{prelude::*, translate::*};
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-08-28 16:52:26 +00:00
|
|
|
use std::boxed::Box as Box_;
|
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 = "GstWebRTCRTPTransceiver")]
|
2020-11-22 10:46:23 +00:00
|
|
|
pub struct WebRTCRTPTransceiver(Object<ffi::GstWebRTCRTPTransceiver, ffi::GstWebRTCRTPTransceiverClass>);
|
2018-03-15 16:04:49 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_webrtc_rtp_transceiver_get_type(),
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl WebRTCRTPTransceiver {
|
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 = "codec-preferences")]
|
|
|
|
pub fn codec_preferences(&self) -> Option<gst::Caps> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "codec-preferences")
|
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 = "codec-preferences")]
|
|
|
|
pub fn set_codec_preferences(&self, codec_preferences: Option<&gst::Caps>) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "codec-preferences", codec_preferences)
|
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 = "current-direction")]
|
|
|
|
pub fn current_direction(&self) -> WebRTCRTPTransceiverDirection {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "current-direction")
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn direction(&self) -> WebRTCRTPTransceiverDirection {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "direction")
|
2020-04-30 16:51:41 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_direction(&self, direction: WebRTCRTPTransceiverDirection) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "direction", direction)
|
2020-04-30 16:51:41 +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 kind(&self) -> WebRTCKind {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "kind")
|
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
|
|
|
pub fn mid(&self) -> Option<glib::GString> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "mid")
|
2021-04-17 10:11:52 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn mlineindex(&self) -> u32 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "mlineindex")
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn receiver(&self) -> Option<WebRTCRTPReceiver> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "receiver")
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn sender(&self) -> Option<WebRTCRTPSender> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "sender")
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
2020-04-30 16:51:41 +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 = "codec-preferences")]
|
|
|
|
pub fn connect_codec_preferences_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_codec_preferences_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPTransceiver,
|
|
|
|
_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::codec-preferences\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_codec_preferences_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 = "current-direction")]
|
|
|
|
pub fn connect_current_direction_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_current_direction_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPTransceiver,
|
|
|
|
_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::current-direction\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_current_direction_trampoline::<F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "direction")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_direction_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2020-04-30 16:51:41 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_direction_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 10:46:23 +00:00
|
|
|
this: *mut ffi::GstWebRTCRTPTransceiver,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2020-04-30 16:51:41 +00:00
|
|
|
) {
|
|
|
|
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::direction\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-30 16:51:41 +00:00
|
|
|
notify_direction_trampoline::<F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
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 = "kind")]
|
|
|
|
pub fn connect_kind_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_kind_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPTransceiver,
|
|
|
|
_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::kind\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_kind_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 = "mid")]
|
|
|
|
pub fn connect_mid_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_mid_trampoline<
|
|
|
|
F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut ffi::GstWebRTCRTPTransceiver,
|
|
|
|
_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::mid\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2021-04-17 10:11:52 +00:00
|
|
|
notify_mid_trampoline::<F> as *const (),
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2018-03-15 16:04:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for WebRTCRTPTransceiver {}
|
|
|
|
unsafe impl Sync for WebRTCRTPTransceiver {}
|