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)
|
2018-02-09 02:30:08 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
use glib::object::Cast;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::object::IsA;
|
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;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::translate::*;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::GString;
|
|
|
|
use glib::StaticType;
|
|
|
|
use glib::Value;
|
2019-03-19 07:40:05 +00:00
|
|
|
use glib_sys;
|
|
|
|
use gobject_sys;
|
|
|
|
use gst_rtsp_server_sys;
|
2018-02-09 02:30:08 +00:00
|
|
|
use std::boxed::Box as Box_;
|
|
|
|
use std::mem::transmute;
|
2019-06-18 10:12:00 +00:00
|
|
|
use RTSPMediaFactory;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct RTSPMediaFactoryURI(Object<gst_rtsp_server_sys::GstRTSPMediaFactoryURI, gst_rtsp_server_sys::GstRTSPMediaFactoryURIClass, RTSPMediaFactoryURIClass>) @extends RTSPMediaFactory;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
match fn {
|
2019-03-19 07:40:05 +00:00
|
|
|
get_type => || gst_rtsp_server_sys::gst_rtsp_media_factory_uri_get_type(),
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl RTSPMediaFactoryURI {
|
|
|
|
pub fn new() -> RTSPMediaFactoryURI {
|
|
|
|
assert_initialized_main_thread!();
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe { from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_uri_new()) }
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for RTSPMediaFactoryURI {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for RTSPMediaFactoryURI {}
|
|
|
|
unsafe impl Sync for RTSPMediaFactoryURI {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_RTSP_MEDIA_FACTORY_URI: Option<&RTSPMediaFactoryURI> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait RTSPMediaFactoryURIExt: 'static {
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_uri(&self) -> Option<GString>;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
fn set_uri(&self, uri: &str);
|
|
|
|
|
|
|
|
fn get_property_use_gstpay(&self) -> bool;
|
|
|
|
|
|
|
|
fn set_property_use_gstpay(&self, use_gstpay: bool);
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_use_gstpay_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<RTSPMediaFactoryURI>> RTSPMediaFactoryURIExt for O {
|
2018-12-09 16:06:12 +00:00
|
|
|
fn get_uri(&self) -> Option<GString> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
from_glib_full(gst_rtsp_server_sys::gst_rtsp_media_factory_uri_get_uri(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_uri(&self, uri: &str) {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gst_rtsp_server_sys::gst_rtsp_media_factory_uri_set_uri(
|
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
uri.to_glib_none().0,
|
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_property_use_gstpay(&self) -> bool {
|
|
|
|
unsafe {
|
|
|
|
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
|
|
|
b"use-gstpay\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 `use-gstpay` getter")
|
|
|
|
.unwrap()
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn set_property_use_gstpay(&self, use_gstpay: bool) {
|
|
|
|
unsafe {
|
2019-06-18 10:12:00 +00:00
|
|
|
gobject_sys::g_object_set_property(
|
|
|
|
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
|
|
|
b"use-gstpay\0".as_ptr() as *const _,
|
|
|
|
Value::from(&use_gstpay).to_glib_none().0,
|
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_uri_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactoryURI,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<RTSPMediaFactoryURI>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-02-09 02:30:08 +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::uri\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(notify_uri_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_use_gstpay_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_use_gstpay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
|
|
|
this: *mut gst_rtsp_server_sys::GstRTSPMediaFactoryURI,
|
|
|
|
_param_spec: glib_sys::gpointer,
|
|
|
|
f: glib_sys::gpointer,
|
|
|
|
) where
|
|
|
|
P: IsA<RTSPMediaFactoryURI>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
|
|
|
f(&RTSPMediaFactoryURI::from_glib_borrow(this).unsafe_cast())
|
|
|
|
}
|
2018-02-09 02:30:08 +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::use-gstpay\0".as_ptr() as *const _,
|
|
|
|
Some(transmute(notify_use_gstpay_trampoline::<Self, F> as usize)),
|
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|