use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib::wrapper! {
pub struct NetClientClock(Object<ffi::GstNetClientClock, ffi::GstNetClientClockClass>) @extends gst::Clock, gst::Object;
match fn {
type_ => || ffi::gst_net_client_clock_get_type(),
}
}
impl NetClientClock {
pub fn address(&self) -> Option<glib::GString> {
unsafe {
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"address\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `address` getter")
}
}
pub fn set_address(&self, address: Option<&str>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"address\0".as_ptr() as *const _,
address.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "base-time")]
pub fn base_time(&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"base-time\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `base-time` getter")
}
}
pub fn bus(&self) -> Option<gst::Bus> {
unsafe {
let mut value = glib::Value::from_type(<gst::Bus as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"bus\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value.get().expect("Return Value for property `bus` getter")
}
}
pub fn set_bus<P: IsA<gst::Bus>>(&self, bus: Option<&P>) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"bus\0".as_ptr() as *const _,
bus.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "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 = "minimum-update-interval")]
pub fn minimum_update_interval(&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"minimum-update-interval\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `minimum-update-interval` getter")
}
}
#[doc(alias = "minimum-update-interval")]
pub fn set_minimum_update_interval(&self, minimum_update_interval: u64) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"minimum-update-interval\0".as_ptr() as *const _,
minimum_update_interval.to_value().to_glib_none().0,
);
}
}
pub fn port(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"port\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `port` getter")
}
}
pub fn set_port(&self, port: i32) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"port\0".as_ptr() as *const _,
port.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "qos-dscp")]
pub fn qos_dscp(&self) -> i32 {
unsafe {
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
glib::gobject_ffi::g_object_get_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"qos-dscp\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `qos-dscp` getter")
}
}
#[doc(alias = "qos-dscp")]
pub fn set_qos_dscp(&self, qos_dscp: i32) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"qos-dscp\0".as_ptr() as *const _,
qos_dscp.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "round-trip-limit")]
pub fn round_trip_limit(&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"round-trip-limit\0".as_ptr() as *const _,
value.to_glib_none_mut().0,
);
value
.get()
.expect("Return Value for property `round-trip-limit` getter")
}
}
#[doc(alias = "round-trip-limit")]
pub fn set_round_trip_limit(&self, round_trip_limit: u64) {
unsafe {
glib::gobject_ffi::g_object_set_property(
self.as_ptr() as *mut glib::gobject_ffi::GObject,
b"round-trip-limit\0".as_ptr() as *const _,
round_trip_limit.to_value().to_glib_none().0,
);
}
}
#[doc(alias = "address")]
pub fn connect_address_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_address_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::address\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_address_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "bus")]
pub fn connect_bus_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_bus_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::bus\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_bus_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "internal-clock")]
pub fn connect_internal_clock_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_internal_clock_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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),
)
}
}
#[doc(alias = "minimum-update-interval")]
pub fn connect_minimum_update_interval_notify<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_minimum_update_interval_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::minimum-update-interval\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_minimum_update_interval_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "port")]
pub fn connect_port_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_port_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::port\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_port_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "qos-dscp")]
pub fn connect_qos_dscp_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_qos_dscp_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::qos-dscp\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_qos_dscp_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "round-trip-limit")]
pub fn connect_round_trip_limit_notify<F: Fn(&NetClientClock) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_round_trip_limit_trampoline<
F: Fn(&NetClientClock) + Send + Sync + 'static,
>(
this: *mut ffi::GstNetClientClock,
_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::round-trip-limit\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_round_trip_limit_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
unsafe impl Send for NetClientClock {}
unsafe impl Sync for NetClientClock {}