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
|
|
|
|
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::{
|
|
|
|
prelude::*,
|
|
|
|
signal::{connect_raw, SignalHandlerId},
|
|
|
|
translate::*,
|
|
|
|
};
|
2023-08-28 16:52:26 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstNetClientClock")]
|
2020-11-22 09:45:06 +00:00
|
|
|
pub struct NetClientClock(Object<ffi::GstNetClientClock, ffi::GstNetClientClockClass>) @extends gst::Clock, gst::Object;
|
2017-12-16 12:48:29 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_net_client_clock_get_type(),
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl NetClientClock {
|
2022-04-07 08:22:39 +00:00
|
|
|
#[doc(alias = "gst_net_client_clock_new")]
|
|
|
|
pub fn new(
|
2022-10-22 17:21:52 +00:00
|
|
|
name: Option<&str>,
|
2022-04-07 08:22:39 +00:00
|
|
|
remote_address: &str,
|
|
|
|
remote_port: i32,
|
|
|
|
base_time: impl Into<Option<gst::ClockTime>>,
|
|
|
|
) -> NetClientClock {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
|
|
|
gst::Clock::from_glib_full(ffi::gst_net_client_clock_new(
|
|
|
|
name.to_glib_none().0,
|
|
|
|
remote_address.to_glib_none().0,
|
|
|
|
remote_port,
|
|
|
|
base_time.into().into_glib(),
|
|
|
|
))
|
|
|
|
.unsafe_cast()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn address(&self) -> Option<glib::GString> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "address")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_address(&self, address: Option<&str>) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "address", address)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "base-time")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn base_time(&self) -> u64 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "base-time")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn bus(&self) -> Option<gst::Bus> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "bus")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_bus<P: IsA<gst::Bus>>(&self, bus: Option<&P>) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "bus", bus)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "internal-clock")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn internal_clock(&self) -> Option<gst::Clock> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "internal-clock")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "minimum-update-interval")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn minimum_update_interval(&self) -> u64 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "minimum-update-interval")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "minimum-update-interval")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_minimum_update_interval(&self, minimum_update_interval: u64) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "minimum-update-interval", minimum_update_interval)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn port(&self) -> i32 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "port")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_port(&self, port: i32) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "port", port)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "qos-dscp")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn qos_dscp(&self) -> i32 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "qos-dscp")
|
2018-03-15 08:12:01 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "qos-dscp")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_qos_dscp(&self, qos_dscp: i32) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "qos-dscp", qos_dscp)
|
2018-03-15 08:12:01 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "round-trip-limit")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn round_trip_limit(&self) -> u64 {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self, "round-trip-limit")
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "round-trip-limit")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn set_round_trip_limit(&self, round_trip_limit: u64) {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::set_property(self, "round-trip-limit", round_trip_limit)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "address")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_address_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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::address\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_address_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "bus")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_bus_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_bus_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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::bus\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_bus_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "internal-clock")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_internal_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_internal_clock_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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 _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "minimum-update-interval")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_minimum_update_interval_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_minimum_update_interval_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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::minimum-update-interval\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_minimum_update_interval_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "port")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_port_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_port_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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::port\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_port_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2017-12-16 12:48:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "qos-dscp")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_qos_dscp_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_qos_dscp_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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))
|
|
|
|
}
|
2018-03-15 08:12:01 +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::qos-dscp\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_qos_dscp_trampoline::<F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-03-15 08:12:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "round-trip-limit")]
|
2021-05-26 22:02:42 +00:00
|
|
|
pub fn connect_round_trip_limit_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_round_trip_limit_trampoline<
|
|
|
|
F: Fn(&NetClientClock) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 09:45:06 +00:00
|
|
|
this: *mut ffi::GstNetClientClock,
|
|
|
|
_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::round-trip-limit\0".as_ptr() as *const _,
|
2023-08-28 16:52:26 +00:00
|
|
|
Some(std::mem::transmute::<_, unsafe extern "C" fn()>(
|
2020-04-13 16:11:33 +00:00
|
|
|
notify_round_trip_limit_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 NetClientClock {}
|
|
|
|
unsafe impl Sync for NetClientClock {}
|