2018-02-17 17:58:41 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir @ 8b9d0bb)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
2017-12-16 12:48:29 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
|
|
|
use ffi;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
|
|
|
use glib::object::Downcast;
|
|
|
|
use glib::signal::SignalHandlerId;
|
|
|
|
use glib::signal::connect;
|
|
|
|
use glib::translate::*;
|
|
|
|
use glib_ffi;
|
|
|
|
use gobject_ffi;
|
|
|
|
use gst;
|
|
|
|
use gst_ffi;
|
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem;
|
|
|
|
use std::mem::transmute;
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
|
|
|
pub struct NetClientClock(Object<ffi::GstNetClientClock, ffi::GstNetClientClockClass>): [
|
|
|
|
gst::Clock => gst_ffi::GstClock,
|
|
|
|
gst::Object => gst_ffi::GstObject,
|
|
|
|
];
|
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_net_client_clock_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl NetClientClock {
|
|
|
|
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, remote_address: &str, remote_port: i32, base_time: gst::ClockTime) -> NetClientClock {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
let name = name.into();
|
|
|
|
let name = name.to_glib_none();
|
|
|
|
unsafe {
|
|
|
|
gst::Clock::from_glib_none(ffi::gst_net_client_clock_new(name.0, remote_address.to_glib_none().0, remote_port, base_time.to_glib())).downcast_unchecked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_address(&self) -> Option<String> {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<String as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "address".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_property_address(&self, address: Option<&str>) {
|
|
|
|
unsafe {
|
|
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, "address".to_glib_none().0, Value::from(address).to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_base_time(&self) -> u64 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "base-time".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_bus(&self) -> Option<gst::Bus> {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<gst::Bus as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "bus".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_property_bus(&self, bus: Option<&gst::Bus>) {
|
|
|
|
unsafe {
|
|
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, "bus".to_glib_none().0, Value::from(bus).to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_internal_clock(&self) -> Option<gst::Clock> {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<gst::Clock as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "internal-clock".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_minimum_update_interval(&self) -> u64 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "minimum-update-interval".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_property_minimum_update_interval(&self, minimum_update_interval: u64) {
|
|
|
|
unsafe {
|
|
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, "minimum-update-interval".to_glib_none().0, Value::from(&minimum_update_interval).to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_port(&self) -> i32 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "port".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_property_port(&self, port: i32) {
|
|
|
|
unsafe {
|
|
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, "port".to_glib_none().0, Value::from(&port).to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_round_trip_limit(&self) -> u64 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
2017-12-16 12:48:29 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, "round-trip-limit".to_glib_none().0, value.to_glib_none_mut().0);
|
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_property_round_trip_limit(&self, round_trip_limit: u64) {
|
|
|
|
unsafe {
|
|
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, "round-trip-limit".to_glib_none().0, Value::from(&round_trip_limit).to_glib_none().0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::address",
|
|
|
|
transmute(notify_address_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_base_time_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::base-time",
|
|
|
|
transmute(notify_base_time_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::bus",
|
|
|
|
transmute(notify_bus_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_internal_clock_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::internal-clock",
|
|
|
|
transmute(notify_internal_clock_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_minimum_update_interval_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::minimum-update-interval",
|
|
|
|
transmute(notify_minimum_update_interval_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::port",
|
|
|
|
transmute(notify_port_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
|
|
|
let f: Box_<Box_<Fn(&NetClientClock) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
|
|
connect(self.to_glib_none().0, "notify::round-trip-limit",
|
|
|
|
transmute(notify_round_trip_limit_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for NetClientClock {}
|
|
|
|
unsafe impl Sync for NetClientClock {}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_address_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_base_time_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_bus_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_internal_clock_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_minimum_update_interval_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_port_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe extern "C" fn notify_round_trip_limit_trampoline(this: *mut ffi::GstNetClientClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &&(Fn(&NetClientClock) + Send + Sync + 'static) = transmute(f);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|