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
|
|
|
|
|
|
|
|
use ffi;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::ObjectType;
|
2017-12-16 12:48:29 +00:00
|
|
|
use glib::signal::SignalHandlerId;
|
2018-12-08 09:05:20 +00:00
|
|
|
use glib::signal::connect_raw;
|
2017-12-16 12:48:29 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
use glib_ffi;
|
|
|
|
use gobject_ffi;
|
|
|
|
use gst;
|
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem::transmute;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-01-16 11:32:39 +00:00
|
|
|
pub struct PtpClock(Object<ffi::GstPtpClock, ffi::GstPtpClockClass, PtpClockClass>) @extends gst::Clock, gst::Object;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
|
|
|
match fn {
|
|
|
|
get_type => || ffi::gst_ptp_clock_get_type(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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-01-16 11:32:39 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::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-01-16 11:32:39 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::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-01-16 11:32:39 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::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-01-16 11:32:39 +00:00
|
|
|
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::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()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_grandmaster_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
connect_raw(self.as_ptr() as *mut _, b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
|
2019-01-29 13:53:44 +00:00
|
|
|
Some(transmute(notify_grandmaster_clock_id_trampoline::<F> as usize)), Box_::into_raw(f))
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_internal_clock_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
connect_raw(self.as_ptr() as *mut _, b"notify::internal-clock\0".as_ptr() as *const _,
|
2019-01-29 13:53:44 +00:00
|
|
|
Some(transmute(notify_internal_clock_trampoline::<F> as usize)), Box_::into_raw(f))
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connect_property_master_clock_id_notify<F: Fn(&PtpClock) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-01-16 11:32:39 +00:00
|
|
|
connect_raw(self.as_ptr() as *mut _, b"notify::master-clock-id\0".as_ptr() as *const _,
|
2019-01-29 13:53:44 +00:00
|
|
|
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 {}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
unsafe extern "C" fn notify_grandmaster_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &F = transmute(f);
|
2017-12-16 12:48:29 +00:00
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
unsafe extern "C" fn notify_internal_clock_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &F = transmute(f);
|
2017-12-16 12:48:29 +00:00
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
unsafe extern "C" fn notify_master_clock_id_trampoline<F: Fn(&PtpClock) + Send + Sync + 'static>(this: *mut ffi::GstPtpClock, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
|
|
let f: &F = transmute(f);
|
2017-12-16 12:48:29 +00:00
|
|
|
f(&from_glib_borrow(this))
|
|
|
|
}
|