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)
|
2017-12-16 12:48:29 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2019-06-18 10:10:46 +00:00
|
|
|
use glib::object::ObjectType as ObjectType_;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2017-12-16 12:48:29 +00:00
|
|
|
use glib::translate::*;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
2019-03-19 07:40:05 +00:00
|
|
|
use glib_sys;
|
|
|
|
use gobject_sys;
|
2017-12-16 12:48:29 +00:00
|
|
|
use gst;
|
2019-03-19 07:40:05 +00:00
|
|
|
use gst_net_sys;
|
2017-12-16 12:48:29 +00:00
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem::transmute;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct PtpClock(Object<gst_net_sys::GstPtpClock, gst_net_sys::GstPtpClockClass, PtpClockClass>) @extends gst::Clock, gst::Object;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
|
|
|
match fn {
|
2019-03-19 07:40:05 +00:00
|
|
|
get_type => || gst_net_sys::gst_ptp_clock_get_type(),
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PtpClock {
|
|
|
|
pub fn get_property_domain(&self) -> u32 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u32 as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"domain\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2017-12-16 12:48:29 +00:00
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_grandmaster_clock_id(&self) -> u64 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"grandmaster-clock-id\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2017-12-16 12:48:29 +00:00
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"internal-clock\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2017-12-16 12:48:29 +00:00
|
|
|
value.get()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_property_master_clock_id(&self) -> u64 {
|
|
|
|
unsafe {
|
2018-02-06 14:42:34 +00:00
|
|
|
let mut value = Value::from_type(<u64 as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut gobject_sys::GObject,
|
|
|
|
b"master-clock-id\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2017-12-16 12:48:29 +00:00
|
|
|
value.get().unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn connect_property_grandmaster_clock_id_notify<
|
|
|
|
F: Fn(&PtpClock) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_grandmaster_clock_id_trampoline<
|
|
|
|
F: Fn(&PtpClock) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_net_sys::GstPtpClock,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(
|
|
|
|
notify_grandmaster_clock_id_trampoline::<F> as usize,
|
|
|
|
)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_internal_clock_trampoline<
|
|
|
|
F: Fn(&PtpClock) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_net_sys::GstPtpClock,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::internal-clock\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(notify_internal_clock_trampoline::<F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_master_clock_id_trampoline<
|
|
|
|
F: Fn(&PtpClock) + Send + Sync + 'static,
|
|
|
|
>(
|
|
|
|
this: *mut gst_net_sys::GstPtpClock,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::master-clock-id\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(notify_master_clock_id_trampoline::<F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for PtpClock {}
|
|
|
|
unsafe impl Sync for PtpClock {}
|