gstreamer-rs/gstreamer-net/src/auto/ptp_clock.rs

169 lines
5.7 KiB
Rust

// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
pub struct PtpClock(Object<ffi::GstPtpClock, ffi::GstPtpClockClass>) @extends gst::Clock, gst::Object;
match fn {
type_ => || ffi::gst_ptp_clock_get_type(),
}
}
impl PtpClock {
#[doc(alias = "get_property_domain")]
pub fn domain(&self) -> u32 {
unsafe {
let mut value = glib::Value::from_type(<u32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"domain\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `domain` getter")
}
}
#[doc(alias = "get_property_grandmaster_clock_id")]
pub fn grandmaster_clock_id(&self) -> u64 {
unsafe {
let mut value = glib::Value::from_type(<u64 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"grandmaster-clock-id\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `grandmaster-clock-id` getter")
}
}
#[doc(alias = "get_property_internal_clock")]
pub fn internal_clock(&self) -> Option<gst::Clock> {
unsafe {
let mut value = glib::Value::from_type(<gst::Clock as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"internal-clock\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `internal-clock` getter")
}
}
#[doc(alias = "get_property_master_clock_id")]
pub fn master_clock_id(&self) -> u64 {
unsafe {
let mut value = glib::Value::from_type(<u64 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"master-clock-id\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `master-clock-id` getter")
}
}
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 ffi::GstPtpClock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::grandmaster-clock-id\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_grandmaster_clock_id_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
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 ffi::GstPtpClock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::internal-clock\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_internal_clock_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
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 ffi::GstPtpClock,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::master-clock-id\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_master_clock_id_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
unsafe impl Send for PtpClock {}
unsafe impl Sync for PtpClock {}