mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-05 07:49:32 +00:00
110 lines
4.2 KiB
Rust
110 lines
4.2 KiB
Rust
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
|
// DO NOT EDIT
|
|
|
|
use ffi;
|
|
use glib::StaticType;
|
|
use glib::Value;
|
|
use glib::signal::SignalHandlerId;
|
|
use glib::signal::connect_raw;
|
|
use glib::translate::*;
|
|
use glib_ffi;
|
|
use gobject_ffi;
|
|
use gst;
|
|
use gst_ffi;
|
|
use std::boxed::Box as Box_;
|
|
use std::mem::transmute;
|
|
|
|
glib_wrapper! {
|
|
pub struct NetTimeProvider(Object<ffi::GstNetTimeProvider, ffi::GstNetTimeProviderClass>): [
|
|
gst::Object => gst_ffi::GstObject,
|
|
];
|
|
|
|
match fn {
|
|
get_type => || ffi::gst_net_time_provider_get_type(),
|
|
}
|
|
}
|
|
|
|
impl NetTimeProvider {
|
|
pub fn get_property_active(&self) -> bool {
|
|
unsafe {
|
|
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"active\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
|
value.get().unwrap()
|
|
}
|
|
}
|
|
|
|
pub fn set_property_active(&self, active: bool) {
|
|
unsafe {
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, b"active\0".as_ptr() as *const _, Value::from(&active).to_glib_none().0);
|
|
}
|
|
}
|
|
|
|
pub fn get_property_address(&self) -> Option<String> {
|
|
unsafe {
|
|
let mut value = Value::from_type(<String as StaticType>::static_type());
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"address\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
|
value.get()
|
|
}
|
|
}
|
|
|
|
pub fn get_property_clock(&self) -> Option<gst::Clock> {
|
|
unsafe {
|
|
let mut value = Value::from_type(<gst::Clock as StaticType>::static_type());
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"clock\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
|
value.get()
|
|
}
|
|
}
|
|
|
|
pub fn get_property_port(&self) -> i32 {
|
|
unsafe {
|
|
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"port\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
|
value.get().unwrap()
|
|
}
|
|
}
|
|
|
|
pub fn get_property_qos_dscp(&self) -> i32 {
|
|
unsafe {
|
|
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
|
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"qos-dscp\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
|
value.get().unwrap()
|
|
}
|
|
}
|
|
|
|
pub fn set_property_qos_dscp(&self, qos_dscp: i32) {
|
|
unsafe {
|
|
gobject_ffi::g_object_set_property(self.to_glib_none().0, b"qos-dscp\0".as_ptr() as *const _, Value::from(&qos_dscp).to_glib_none().0);
|
|
}
|
|
}
|
|
|
|
pub fn connect_property_active_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
unsafe {
|
|
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
connect_raw(self.to_glib_none().0, b"notify::active\0".as_ptr() as *const _,
|
|
transmute(notify_active_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
}
|
|
}
|
|
|
|
pub fn connect_property_qos_dscp_notify<F: Fn(&NetTimeProvider) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
|
unsafe {
|
|
let f: Box_<Box_<Fn(&NetTimeProvider) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
|
|
connect_raw(self.to_glib_none().0, b"notify::qos-dscp\0".as_ptr() as *const _,
|
|
transmute(notify_qos_dscp_trampoline as usize), Box_::into_raw(f) as *mut _)
|
|
}
|
|
}
|
|
}
|
|
|
|
unsafe impl Send for NetTimeProvider {}
|
|
unsafe impl Sync for NetTimeProvider {}
|
|
|
|
unsafe extern "C" fn notify_active_trampoline(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f);
|
|
f(&from_glib_borrow(this))
|
|
}
|
|
|
|
unsafe extern "C" fn notify_qos_dscp_trampoline(this: *mut ffi::GstNetTimeProvider, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
|
|
let f: &&(Fn(&NetTimeProvider) + Send + Sync + 'static) = transmute(f);
|
|
f(&from_glib_borrow(this))
|
|
}
|