Add bindings for GstRTSPContext

This enables most of the signals of GstRTSPClient
This commit is contained in:
Sebastian Dröge 2018-02-15 17:03:31 +02:00
parent a00243d529
commit b4d5c98834
5 changed files with 397 additions and 107 deletions

View file

@ -83,6 +83,11 @@ name = "Gst.Caps"
status = "manual"
ref_mode = "ref"
[[object]]
name = "GstRtspServer.RTSPContext"
status = "manual"
ref_mode = "ref"
[[object]]
name = "Gst.ClockTime"
status = "manual"

View file

@ -3,6 +3,7 @@
// DO NOT EDIT
use RTSPAuth;
use RTSPContext;
use RTSPMountPoints;
use RTSPSession;
use RTSPSessionPool;
@ -18,6 +19,10 @@ use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
#[cfg(any(feature = "v1_12", feature = "dox"))]
use gst_rtsp;
#[cfg(any(feature = "v1_12", feature = "dox"))]
use gst_rtsp_ffi;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
@ -84,65 +89,65 @@ pub trait RTSPClientExt {
fn set_property_drop_backlog(&self, drop_backlog: bool);
//fn connect_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&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_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_handle_response<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&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_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&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_announce_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_describe_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_get_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_options_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_pause_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_play_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_record_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_set_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&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_setup_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn connect_pre_teardown_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&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_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
//fn connect_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
@ -252,12 +257,15 @@ impl<O: IsA<RTSPClient> + IsA<glib::object::Object>> RTSPClientExt for O {
}
}
//fn connect_announce_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_announce_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "announce-request",
transmute(announce_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//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 }
//}
@ -269,17 +277,29 @@ impl<O: IsA<RTSPClient> + IsA<glib::object::Object>> RTSPClientExt for O {
}
}
//fn connect_describe_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_describe_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "describe-request",
transmute(describe_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_get_parameter_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_get_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "get-parameter-request",
transmute(get_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_handle_response<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_handle_response<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "handle-response",
transmute(handle_response_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_new_session<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
@ -289,87 +309,155 @@ impl<O: IsA<RTSPClient> + IsA<glib::object::Object>> RTSPClientExt for O {
}
}
//fn connect_options_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_options_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "options-request",
transmute(options_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_pause_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_pause_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pause-request",
transmute(pause_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_play_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_play_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "play-request",
transmute(play_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_announce_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-announce-request",
transmute(pre_announce_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_describe_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-describe-request",
transmute(pre_describe_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_get_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-get-parameter-request",
transmute(pre_get_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_options_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-options-request",
transmute(pre_options_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_pause_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-pause-request",
transmute(pre_pause_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_play_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-play-request",
transmute(pre_play_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_record_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-record-request",
transmute(pre_record_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_set_parameter_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-set-parameter-request",
transmute(pre_set_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[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_setup_request<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-setup-request",
transmute(pre_setup_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//#[cfg(any(feature = "v1_12", feature = "dox"))]
//fn connect_pre_teardown_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<F: Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pre-teardown-request",
transmute(pre_teardown_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_record_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_record_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "record-request",
transmute(record_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//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_set_parameter_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "set-parameter-request",
transmute(set_parameter_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_setup_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_setup_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "setup-request",
transmute(setup_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
//fn connect_teardown_request<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
// Ignored ctx: GstRtspServer.RTSPContext
//}
fn connect_teardown_request<F: Fn(&Self, &RTSPContext) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self, &RTSPContext) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "teardown-request",
transmute(teardown_request_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_drop_backlog_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
@ -396,6 +484,13 @@ impl<O: IsA<RTSPClient> + IsA<glib::object::Object>> RTSPClientExt for O {
}
}
unsafe extern "C" fn announce_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn closed_trampoline<P>(this: *mut ffi::GstRTSPClient, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
@ -403,6 +498,27 @@ where P: IsA<RTSPClient> {
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn describe_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn get_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn handle_response_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
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!();
@ -410,6 +526,135 @@ where P: IsA<RTSPClient> {
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object))
}
unsafe extern "C" fn options_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn pause_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn play_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_announce_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_describe_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_get_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_options_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_pause_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_play_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_record_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_set_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_setup_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
#[cfg(any(feature = "v1_12", feature = "dox"))]
unsafe extern "C" fn pre_teardown_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer) -> gst_rtsp_ffi::GstRTSPStatusCode
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) -> gst_rtsp::RTSPStatusCode + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx)).to_glib()
}
unsafe extern "C" fn record_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn set_parameter_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn setup_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
unsafe extern "C" fn teardown_request_trampoline<P>(this: *mut ffi::GstRTSPClient, ctx: *mut ffi::GstRTSPContext, f: glib_ffi::gpointer)
where P: IsA<RTSPClient> {
callback_guard!();
let f: &&(Fn(&P, &RTSPContext) + Send + Sync + 'static) = transmute(f);
f(&RTSPClient::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(ctx))
}
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!();

View file

@ -52,7 +52,7 @@ unsafe impl Sync for RTSPThreadPool {}
pub trait RTSPThreadPoolExt {
fn get_max_threads(&self) -> i32;
//fn get_thread(&self, type_: RTSPThreadType, ctx: /*Ignored*/&mut RTSPContext) -> /*Ignored*/Option<RTSPThread>;
//fn get_thread(&self, type_: RTSPThreadType, ctx: &RTSPContext) -> /*Ignored*/Option<RTSPThread>;
fn set_max_threads(&self, max_threads: i32);
@ -66,7 +66,7 @@ impl<O: IsA<RTSPThreadPool> + IsA<glib::object::Object>> RTSPThreadPoolExt for O
}
}
//fn get_thread(&self, type_: RTSPThreadType, ctx: /*Ignored*/&mut RTSPContext) -> /*Ignored*/Option<RTSPThread> {
//fn get_thread(&self, type_: RTSPThreadType, ctx: &RTSPContext) -> /*Ignored*/Option<RTSPThread> {
// unsafe { TODO: call ffi::gst_rtsp_thread_pool_get_thread() }
//}

View file

@ -56,12 +56,15 @@ mod r_t_s_p_server;
mod r_t_s_p_address_pool;
mod r_t_s_p_client;
mod r_t_s_p_session_pool;
mod r_t_s_p_context;
pub use r_t_s_p_server::RTSPServerExtManual;
pub use r_t_s_p_address_pool::RTSPAddressPoolExtManual;
pub use r_t_s_p_client::RTSPClientExtManual;
pub use r_t_s_p_session_pool::RTSPSessionPoolExtManual;
pub use r_t_s_p_context::*;
// Re-export all the traits in a prelude module, so that applications
// can always "use gst::prelude::*" without getting conflicts
pub mod prelude {

View file

@ -0,0 +1,37 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use ffi;
use glib;
#[derive(PartialEq, Eq)]
pub struct RTSPContext(*mut ffi::GstRTSPContext);
impl RTSPContext {
pub fn with_current_context<F: FnOnce(&RTSPContext) -> T, T>(func: F) -> Option<T> {
unsafe {
let ptr = ffi::gst_rtsp_context_get_current();
if ptr.is_null() {
return None;
}
let ctx = RTSPContext(ptr);
Some(func(&ctx))
}
}
// TODO: Add various getters for all the contained fields as needed
}
#[doc(hidden)]
impl glib::translate::FromGlibPtrBorrow<*mut ffi::GstRTSPContext> for RTSPContext {
#[inline]
unsafe fn from_glib_borrow(ptr: *mut ffi::GstRTSPContext) -> Self {
RTSPContext(ptr)
}
}