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
|
|
|
|
|
|
|
|
use RTSPMediaFactory;
|
2018-12-09 16:06:12 +00:00
|
|
|
use glib::GString;
|
2018-02-09 02:30:08 +00:00
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::translate::*;
|
|
|
|
use gst_rtsp;
|
2019-03-19 07:40:05 +00:00
|
|
|
use gst_rtsp_server_sys;
|
2018-02-09 02:30:08 +00:00
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
glib_wrapper! {
|
2019-03-19 07:40:05 +00:00
|
|
|
pub struct RTSPMountPoints(Object<gst_rtsp_server_sys::GstRTSPMountPoints, gst_rtsp_server_sys::GstRTSPMountPointsClass, RTSPMountPointsClass>);
|
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_mount_points_get_type(),
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl RTSPMountPoints {
|
|
|
|
pub fn new() -> RTSPMountPoints {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_new())
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for RTSPMountPoints {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl Send for RTSPMountPoints {}
|
|
|
|
unsafe impl Sync for RTSPMountPoints {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_RTSP_MOUNT_POINTS: Option<&RTSPMountPoints> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait RTSPMountPointsExt: 'static {
|
2018-02-09 02:30:08 +00:00
|
|
|
fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P);
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option<GString>;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
fn match_(&self, path: &str) -> (RTSPMediaFactory, i32);
|
|
|
|
|
|
|
|
fn remove_factory(&self, path: &str);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTSPMountPoints>> RTSPMountPointsExt for O {
|
|
|
|
fn add_factory<P: IsA<RTSPMediaFactory>>(&self, path: &str, factory: &P) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_rtsp_server_sys::gst_rtsp_mount_points_add_factory(self.as_ref().to_glib_none().0, path.to_glib_none().0, factory.as_ref().to_glib_full());
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-09 16:06:12 +00:00
|
|
|
fn make_path(&self, url: &gst_rtsp::RTSPUrl) -> Option<GString> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_make_path(self.as_ref().to_glib_none().0, url.to_glib_none().0))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn match_(&self, path: &str) -> (RTSPMediaFactory, i32) {
|
|
|
|
unsafe {
|
|
|
|
let mut matched = mem::uninitialized();
|
2019-03-19 07:40:05 +00:00
|
|
|
let ret = from_glib_full(gst_rtsp_server_sys::gst_rtsp_mount_points_match(self.as_ref().to_glib_none().0, path.to_glib_none().0, &mut matched));
|
2018-02-09 02:30:08 +00:00
|
|
|
(ret, matched)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn remove_factory(&self, path: &str) {
|
|
|
|
unsafe {
|
2019-03-19 07:40:05 +00:00
|
|
|
gst_rtsp_server_sys::gst_rtsp_mount_points_remove_factory(self.as_ref().to_glib_none().0, path.to_glib_none().0);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|