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)
|
2018-03-15 16:04:49 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use WebRTCRTPReceiver;
|
|
|
|
use WebRTCRTPSender;
|
|
|
|
use ffi;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
|
|
|
use glib::signal::SignalHandlerId;
|
|
|
|
use glib::signal::connect;
|
|
|
|
use glib::translate::*;
|
|
|
|
use glib_ffi;
|
|
|
|
use gobject_ffi;
|
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem;
|
|
|
|
use std::mem::transmute;
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
|
|
|
pub struct WebRTCRTPTransceiver(Object<ffi::GstWebRTCRTPTransceiver, ffi::GstWebRTCRTPTransceiverClass>);
|
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_webrtc_rtp_transceiver_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl WebRTCRTPTransceiver {
|
|
|
|
pub fn get_property_mlineindex(&self) -> u32 {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<u32 as StaticType>::static_type());
|
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "mlineindex".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_receiver(&self) -> Option<WebRTCRTPReceiver> {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<WebRTCRTPReceiver as StaticType>::static_type());
|
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "receiver".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_sender(&self) -> Option<WebRTCRTPSender> {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<WebRTCRTPSender as StaticType>::static_type());
|
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "sender".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_mlineindex_notify<F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::mlineindex",
|
|
|
|
transmute(notify_mlineindex_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_receiver_notify<F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::receiver",
|
|
|
|
transmute(notify_receiver_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_sender_notify<F: Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::sender",
|
|
|
|
transmute(notify_sender_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for WebRTCRTPTransceiver {}
|
|
|
|
unsafe impl Sync for WebRTCRTPTransceiver {}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_mlineindex_trampoline(this: *mut ffi::GstWebRTCRTPTransceiver, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_receiver_trampoline(this: *mut ffi::GstWebRTCRTPTransceiver, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_sender_trampoline(this: *mut ffi::GstWebRTCRTPTransceiver, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&WebRTCRTPTransceiver) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|