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)
|
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;
|
2017-12-16 12:48:29 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2020-11-22 09:45:06 +00:00
|
|
|
pub struct PtpClock(Object<ffi::GstPtpClock, ffi::GstPtpClockClass>) @extends gst::Clock, gst::Object;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
|
|
|
match fn {
|
2020-11-22 09:45:06 +00:00
|
|
|
get_type => || ffi::gst_ptp_clock_get_type(),
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl PtpClock {
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_domain")]
|
|
|
|
pub fn domain(&self) -> u32 {
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<u32 as StaticType>::static_type());
|
2020-11-22 09:45:06 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"domain\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `domain` getter")
|
|
|
|
.unwrap()
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_grandmaster_clock_id")]
|
|
|
|
pub fn grandmaster_clock_id(&self) -> u64 {
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<u64 as StaticType>::static_type());
|
2020-11-22 09:45:06 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"grandmaster-clock-id\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `grandmaster-clock-id` getter")
|
|
|
|
.unwrap()
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_internal_clock")]
|
|
|
|
pub fn internal_clock(&self) -> Option<gst::Clock> {
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<gst::Clock as StaticType>::static_type());
|
2020-11-22 09:45:06 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"internal-clock\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `internal-clock` getter")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
#[doc(alias = "get_property_master_clock_id")]
|
|
|
|
pub fn master_clock_id(&self) -> u64 {
|
2017-12-16 12:48:29 +00:00
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<u64 as StaticType>::static_type());
|
2020-11-22 09:45:06 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"master-clock-id\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `master-clock-id` getter")
|
|
|
|
.unwrap()
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstPtpClock,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) {
|
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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_grandmaster_clock_id_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstPtpClock,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) {
|
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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_internal_clock_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
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,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstPtpClock,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) {
|
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 _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_master_clock_id_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for PtpClock {}
|
|
|
|
unsafe impl Sync for PtpClock {}
|