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 RTSPStream ;
use glib ;
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 ;
use gst_rtsp ;
2019-03-19 07:40:05 +00:00
use gst_rtsp_server_sys ;
2019-01-29 13:53:44 +00:00
use std ::boxed ::Box as Box_ ;
2018-02-09 02:30:08 +00:00
glib_wrapper! {
2019-03-19 07:40:05 +00:00
pub struct RTSPStreamTransport ( Object < gst_rtsp_server_sys ::GstRTSPStreamTransport , gst_rtsp_server_sys ::GstRTSPStreamTransportClass , RTSPStreamTransportClass > ) ;
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_stream_transport_get_type ( ) ,
2018-02-09 02:30:08 +00:00
}
}
impl RTSPStreamTransport {
2019-01-16 11:32:39 +00:00
//pub fn new<P: IsA<RTSPStream>>(stream: &P, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> RTSPStreamTransport {
2019-03-19 07:40:05 +00:00
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_new() }
2018-02-09 02:30:08 +00:00
//}
}
2019-01-16 11:32:39 +00:00
pub const NONE_RTSP_STREAM_TRANSPORT : Option < & RTSPStreamTransport > = None ;
2018-12-08 09:05:20 +00:00
pub trait RTSPStreamTransportExt : 'static {
2018-12-09 16:06:12 +00:00
fn get_rtpinfo ( & self , start_time : gst ::ClockTime ) -> Option < GString > ;
2018-02-09 02:30:08 +00:00
fn get_stream ( & self ) -> Option < RTSPStream > ;
//fn get_transport(&self) -> /*Ignored*/Option<gst_rtsp::RTSPTransport>;
fn get_url ( & self ) -> Option < gst_rtsp ::RTSPUrl > ;
fn is_timed_out ( & self ) -> bool ;
fn keep_alive ( & self ) ;
2019-04-23 14:32:09 +00:00
#[ cfg(any(feature = " v1_16 " , feature = " dox " )) ]
fn message_sent ( & self ) ;
2018-02-09 02:30:08 +00:00
fn send_rtcp ( & self , buffer : & gst ::Buffer ) -> Result < ( ) , glib ::error ::BoolError > ;
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn send_rtcp_list(&self, buffer_list: /*Ignored*/&mut gst::BufferList) -> bool;
2018-02-09 02:30:08 +00:00
fn send_rtp ( & self , buffer : & gst ::Buffer ) -> Result < ( ) , glib ::error ::BoolError > ;
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn send_rtp_list(&self, buffer_list: /*Ignored*/&mut gst::BufferList) -> bool;
2018-02-09 02:30:08 +00:00
fn set_active ( & self , active : bool ) -> Result < ( ) , glib ::error ::BoolError > ;
2019-01-29 13:53:44 +00:00
//fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q);
2018-02-09 02:30:08 +00:00
2019-01-29 13:53:44 +00:00
fn set_keepalive < P : Fn ( ) + 'static > ( & self , keep_alive : P ) ;
2018-02-09 02:30:08 +00:00
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn set_list_callbacks(&self, send_rtp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, send_rtcp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>);
fn set_message_sent < P : Fn ( ) + 'static > ( & self , message_sent : P ) ;
2018-02-09 02:30:08 +00:00
fn set_timed_out ( & self , timedout : bool ) ;
//fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport);
2019-03-19 07:40:05 +00:00
fn set_url ( & self , url : Option < & gst_rtsp ::RTSPUrl > ) ;
2018-02-09 02:30:08 +00:00
}
impl < O : IsA < RTSPStreamTransport > > RTSPStreamTransportExt for O {
2018-12-09 16:06:12 +00:00
fn get_rtpinfo ( & self , start_time : gst ::ClockTime ) -> 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_stream_transport_get_rtpinfo ( self . as_ref ( ) . to_glib_none ( ) . 0 , start_time . to_glib ( ) ) )
2018-02-09 02:30:08 +00:00
}
}
fn get_stream ( & self ) -> Option < RTSPStream > {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_none ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_get_stream ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
2018-02-09 02:30:08 +00:00
}
}
//fn get_transport(&self) -> /*Ignored*/Option<gst_rtsp::RTSPTransport> {
2019-03-19 07:40:05 +00:00
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_get_transport() }
2018-02-09 02:30:08 +00:00
//}
fn get_url ( & self ) -> Option < gst_rtsp ::RTSPUrl > {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_none ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_get_url ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
2018-02-09 02:30:08 +00:00
}
}
fn is_timed_out ( & self ) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_is_timed_out ( self . as_ref ( ) . to_glib_none ( ) . 0 ) )
2018-02-09 02:30:08 +00:00
}
}
fn keep_alive ( & self ) {
unsafe {
2019-03-19 07:40:05 +00:00
gst_rtsp_server_sys ::gst_rtsp_stream_transport_keep_alive ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ;
2018-02-09 02:30:08 +00:00
}
}
2019-04-23 14:32:09 +00:00
#[ cfg(any(feature = " v1_16 " , feature = " dox " )) ]
fn message_sent ( & self ) {
unsafe {
gst_rtsp_server_sys ::gst_rtsp_stream_transport_message_sent ( self . as_ref ( ) . to_glib_none ( ) . 0 ) ;
}
}
2018-02-09 02:30:08 +00:00
fn send_rtcp ( & self , buffer : & gst ::Buffer ) -> Result < ( ) , glib ::error ::BoolError > {
unsafe {
2019-03-19 07:40:05 +00:00
glib_result_from_gboolean! ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_send_rtcp ( self . as_ref ( ) . to_glib_none ( ) . 0 , buffer . to_glib_none ( ) . 0 ) , " Failed to send rtcp " )
2018-02-09 02:30:08 +00:00
}
}
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn send_rtcp_list(&self, buffer_list: /*Ignored*/&mut gst::BufferList) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_send_rtcp_list() }
//}
2018-02-09 02:30:08 +00:00
fn send_rtp ( & self , buffer : & gst ::Buffer ) -> Result < ( ) , glib ::error ::BoolError > {
unsafe {
2019-03-19 07:40:05 +00:00
glib_result_from_gboolean! ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_send_rtp ( self . as_ref ( ) . to_glib_none ( ) . 0 , buffer . to_glib_none ( ) . 0 ) , " Failed to send rtp " )
2018-02-09 02:30:08 +00:00
}
}
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn send_rtp_list(&self, buffer_list: /*Ignored*/&mut gst::BufferList) -> bool {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_send_rtp_list() }
//}
2018-02-09 02:30:08 +00:00
fn set_active ( & self , active : bool ) -> Result < ( ) , glib ::error ::BoolError > {
unsafe {
2019-03-19 07:40:05 +00:00
glib_result_from_gboolean! ( gst_rtsp_server_sys ::gst_rtsp_stream_transport_set_active ( self . as_ref ( ) . to_glib_none ( ) . 0 , active . to_glib ( ) ) , " Failed to set active " )
2018-02-09 02:30:08 +00:00
}
}
2019-01-29 13:53:44 +00:00
//fn set_callbacks<P: Fn(&gst::Buffer, u8) -> bool + 'static, Q: Fn(&gst::Buffer, u8) -> bool + 'static>(&self, send_rtp: P, send_rtcp: Q) {
2019-03-19 07:40:05 +00:00
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_callbacks() }
2018-02-09 02:30:08 +00:00
//}
2019-01-29 13:53:44 +00:00
fn set_keepalive < P : Fn ( ) + 'static > ( & self , keep_alive : P ) {
let keep_alive_data : Box_ < P > = Box ::new ( keep_alive ) ;
2019-03-19 07:40:05 +00:00
unsafe extern " C " fn keep_alive_func < P : Fn ( ) + 'static > ( user_data : glib_sys ::gpointer ) {
2019-01-29 13:53:44 +00:00
let callback : & P = & * ( user_data as * mut _ ) ;
( * callback ) ( ) ;
}
let keep_alive = Some ( keep_alive_func ::< P > as _ ) ;
2019-03-19 07:40:05 +00:00
unsafe extern " C " fn notify_func < P : Fn ( ) + 'static > ( data : glib_sys ::gpointer ) {
2019-01-29 13:53:44 +00:00
let _callback : Box_ < P > = Box_ ::from_raw ( data as * mut _ ) ;
}
let destroy_call3 = Some ( notify_func ::< P > as _ ) ;
let super_callback0 : Box_ < P > = keep_alive_data ;
unsafe {
2019-03-19 07:40:05 +00:00
gst_rtsp_server_sys ::gst_rtsp_stream_transport_set_keepalive ( self . as_ref ( ) . to_glib_none ( ) . 0 , keep_alive , Box ::into_raw ( super_callback0 ) as * mut _ , destroy_call3 ) ;
2019-01-29 13:53:44 +00:00
}
}
2018-02-09 02:30:08 +00:00
2019-04-23 14:32:09 +00:00
//#[cfg(any(feature = "v1_16", feature = "dox"))]
//fn set_list_callbacks(&self, send_rtp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, send_rtcp_list: /*Unimplemented*/Fn(/*Ignored*/gst::BufferList, u8) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) {
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_list_callbacks() }
//}
fn set_message_sent < P : Fn ( ) + 'static > ( & self , message_sent : P ) {
let message_sent_data : Box_ < P > = Box ::new ( message_sent ) ;
unsafe extern " C " fn message_sent_func < P : Fn ( ) + 'static > ( user_data : glib_sys ::gpointer ) {
let callback : & P = & * ( user_data as * mut _ ) ;
( * callback ) ( ) ;
}
let message_sent = Some ( message_sent_func ::< P > as _ ) ;
unsafe extern " C " fn notify_func < P : Fn ( ) + 'static > ( data : glib_sys ::gpointer ) {
let _callback : Box_ < P > = Box_ ::from_raw ( data as * mut _ ) ;
}
let destroy_call3 = Some ( notify_func ::< P > as _ ) ;
let super_callback0 : Box_ < P > = message_sent_data ;
unsafe {
gst_rtsp_server_sys ::gst_rtsp_stream_transport_set_message_sent ( self . as_ref ( ) . to_glib_none ( ) . 0 , message_sent , Box ::into_raw ( super_callback0 ) as * mut _ , destroy_call3 ) ;
}
}
2018-02-09 02:30:08 +00:00
fn set_timed_out ( & self , timedout : bool ) {
unsafe {
2019-03-19 07:40:05 +00:00
gst_rtsp_server_sys ::gst_rtsp_stream_transport_set_timed_out ( self . as_ref ( ) . to_glib_none ( ) . 0 , timedout . to_glib ( ) ) ;
2018-02-09 02:30:08 +00:00
}
}
//fn set_transport(&self, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) {
2019-03-19 07:40:05 +00:00
// unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_stream_transport_set_transport() }
2018-02-09 02:30:08 +00:00
//}
2019-03-19 07:40:05 +00:00
fn set_url ( & self , url : Option < & gst_rtsp ::RTSPUrl > ) {
2018-02-09 02:30:08 +00:00
unsafe {
2019-03-19 07:40:05 +00:00
gst_rtsp_server_sys ::gst_rtsp_stream_transport_set_url ( self . as_ref ( ) . to_glib_none ( ) . 0 , url . to_glib_none ( ) . 0 ) ;
2018-02-09 02:30:08 +00:00
}
}
}