gstreamer-rs/gstreamer-rtsp-server/src/auto/r_t_s_p_client.rs
Mathieu Duponchelle a00243d529 Add initial libgstsdp, libgstrtsp and libgstrtspserver bindings
Only automatic bindings for now, which is enough to allow
implementing a simple rtsp-server example.

Depends on https://github.com/sdroege/gstreamer-sys/pull/8

Uses a new gir feature proposed at
https://github.com/gtk-rs/gir/pull/539 to make doc regeneration
easier.

Fixes https://github.com/sdroege/gstreamer-rs/pull/80
2018-02-14 18:57:58 +02:00

433 lines
17 KiB
Rust

// This file was generated by gir (https://github.com/gtk-rs/gir @ 47eb915)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
use RTSPAuth;
use RTSPMountPoints;
use RTSPSession;
use RTSPSessionPool;
use RTSPThreadPool;
use ffi;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct RTSPClient(Object<ffi::GstRTSPClient, ffi::GstRTSPClientClass>);
match fn {
get_type => || ffi::gst_rtsp_client_get_type(),
}
}
impl RTSPClient {
pub fn new() -> RTSPClient {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_rtsp_client_new())
}
}
}
impl Default for RTSPClient {
fn default() -> Self {
Self::new()
}
}
unsafe impl Send for RTSPClient {}
unsafe impl Sync for RTSPClient {}
pub trait RTSPClientExt {
fn close(&self);
fn get_auth(&self) -> Option<RTSPAuth>;
//fn get_connection(&self) -> /*Ignored*/Option<gst_rtsp::RTSPConnection>;
fn get_mount_points(&self) -> Option<RTSPMountPoints>;
fn get_session_pool(&self) -> Option<RTSPSessionPool>;
fn get_thread_pool(&self) -> Option<RTSPThreadPool>;
//fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult;
//fn send_message<'a, P: Into<Option<&'a RTSPSession>>>(&self, session: P, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult;
//fn session_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPClientSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession>;
fn set_auth<'a, P: Into<Option<&'a RTSPAuth>>>(&self, auth: P);
//fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool;
fn set_mount_points<'a, P: Into<Option<&'a RTSPMountPoints>>>(&self, mounts: P);
//fn set_send_func<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, user_data: P, notify: Q);
fn set_session_pool<'a, P: Into<Option<&'a RTSPSessionPool>>>(&self, pool: P);
fn set_thread_pool<'a, P: Into<Option<&'a RTSPThreadPool>>>(&self, pool: P);
fn get_property_drop_backlog(&self) -> bool;
fn set_property_drop_backlog(&self, drop_backlog: bool);
//fn connect_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_check_requirements<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_describe_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_handle_response<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_options_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_describe_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_options_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_set_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_send_message<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_set_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
//fn connect_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<RTSPClient> + IsA<glib::object::Object>> RTSPClientExt for O {
fn close(&self) {
unsafe {
ffi::gst_rtsp_client_close(self.to_glib_none().0);
}
}
fn get_auth(&self) -> Option<RTSPAuth> {
unsafe {
from_glib_full(ffi::gst_rtsp_client_get_auth(self.to_glib_none().0))
}
}
//fn get_connection(&self) -> /*Ignored*/Option<gst_rtsp::RTSPConnection> {
// unsafe { TODO: call ffi::gst_rtsp_client_get_connection() }
//}
fn get_mount_points(&self) -> Option<RTSPMountPoints> {
unsafe {
from_glib_full(ffi::gst_rtsp_client_get_mount_points(self.to_glib_none().0))
}
}
fn get_session_pool(&self) -> Option<RTSPSessionPool> {
unsafe {
from_glib_full(ffi::gst_rtsp_client_get_session_pool(self.to_glib_none().0))
}
}
fn get_thread_pool(&self) -> Option<RTSPThreadPool> {
unsafe {
from_glib_full(ffi::gst_rtsp_client_get_thread_pool(self.to_glib_none().0))
}
}
//fn handle_message(&self, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
// unsafe { TODO: call ffi::gst_rtsp_client_handle_message() }
//}
//fn send_message<'a, P: Into<Option<&'a RTSPSession>>>(&self, session: P, message: /*Ignored*/&mut gst_rtsp::RTSPMessage) -> gst_rtsp::RTSPResult {
// unsafe { TODO: call ffi::gst_rtsp_client_send_message() }
//}
//fn session_filter<'a, P: Into<Option<&'a /*Unimplemented*/RTSPClientSessionFilterFunc>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q) -> Vec<RTSPSession> {
// unsafe { TODO: call ffi::gst_rtsp_client_session_filter() }
//}
fn set_auth<'a, P: Into<Option<&'a RTSPAuth>>>(&self, auth: P) {
let auth = auth.into();
let auth = auth.to_glib_none();
unsafe {
ffi::gst_rtsp_client_set_auth(self.to_glib_none().0, auth.0);
}
}
//fn set_connection(&self, conn: /*Ignored*/&mut gst_rtsp::RTSPConnection) -> bool {
// unsafe { TODO: call ffi::gst_rtsp_client_set_connection() }
//}
fn set_mount_points<'a, P: Into<Option<&'a RTSPMountPoints>>>(&self, mounts: P) {
let mounts = mounts.into();
let mounts = mounts.to_glib_none();
unsafe {
ffi::gst_rtsp_client_set_mount_points(self.to_glib_none().0, mounts.0);
}
}
//fn set_send_func<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a /*Ignored*/glib::DestroyNotify>>>(&self, func: /*Unknown conversion*//*Unimplemented*/RTSPClientSendFunc, user_data: P, notify: Q) {
// unsafe { TODO: call ffi::gst_rtsp_client_set_send_func() }
//}
fn set_session_pool<'a, P: Into<Option<&'a RTSPSessionPool>>>(&self, pool: P) {
let pool = pool.into();
let pool = pool.to_glib_none();
unsafe {
ffi::gst_rtsp_client_set_session_pool(self.to_glib_none().0, pool.0);
}
}
fn set_thread_pool<'a, P: Into<Option<&'a RTSPThreadPool>>>(&self, pool: P) {
let pool = pool.into();
let pool = pool.to_glib_none();
unsafe {
ffi::gst_rtsp_client_set_thread_pool(self.to_glib_none().0, pool.0);
}
}
fn get_property_drop_backlog(&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, "drop-backlog".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
fn set_property_drop_backlog(&self, drop_backlog: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "drop-backlog".to_glib_none().0, Value::from(&drop_backlog).to_glib_none().0);
}
}
//fn connect_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_check_requirements<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
// Empty ctype arr: *.CArray TypeId { ns_id: 0, id: 28 }
//}
fn connect_closed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "closed",
transmute(closed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_describe_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_handle_response<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPSession) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "new-session",
transmute(new_session_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_options_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_describe_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_options_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_set_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_send_message<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored message: GstRtsp.RTSPMessage
//}
//fn connect_set_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
//fn connect_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::drop-backlog",
transmute(notify_drop_backlog_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_mount_points_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::mount-points",
transmute(notify_mount_points_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_session_pool_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::session-pool",
transmute(notify_session_pool_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe extern "C" fn closed_trampoline<P>(this: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn new_session_trampoline<P>(this: *mut ffi::GstRTSPClient, object: *mut ffi::GstRTSPSession, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPSession) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object))
}
unsafe extern "C" fn notify_drop_backlog_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn notify_mount_points_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn notify_session_pool_trampoline<P>(this: *mut ffi::GstRTSPClient, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked())
}