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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-02-09 02:30:08 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:40:56 +00:00
|
|
|
use crate::RTSPStream;
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
2019-01-29 13:53:44 +00:00
|
|
|
use std::boxed::Box as Box_;
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstRTSPStreamTransport")]
|
2020-11-22 10:40:56 +00:00
|
|
|
pub struct RTSPStreamTransport(Object<ffi::GstRTSPStreamTransport, ffi::GstRTSPStreamTransportClass>);
|
2018-02-09 02:30:08 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_rtsp_stream_transport_get_type(),
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl RTSPStreamTransport {
|
2021-11-16 14:02:58 +00:00
|
|
|
pub const NONE: Option<&'static RTSPStreamTransport> = None;
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_new")]
|
2023-01-03 18:56:00 +00:00
|
|
|
//pub fn new(stream: &impl IsA<RTSPStream>, tr: /*Ignored*/gst_rtsp::RTSPTransport) -> RTSPStreamTransport {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_new() }
|
2018-02-09 02:30:08 +00:00
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::RTSPStreamTransport>> Sealed for T {}
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
pub trait RTSPStreamTransportExt: IsA<RTSPStreamTransport> + sealed::Sealed + 'static {
|
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_get_rtpinfo")]
|
|
|
|
#[doc(alias = "get_rtpinfo")]
|
2021-04-05 10:48:30 +00:00
|
|
|
fn rtpinfo(&self, start_time: impl Into<Option<gst::ClockTime>>) -> Option<glib::GString> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_full(ffi::gst_rtsp_stream_transport_get_rtpinfo(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-05 10:48:30 +00:00
|
|
|
start_time.into().into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_get_stream")]
|
|
|
|
#[doc(alias = "get_stream")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn stream(&self) -> Option<RTSPStream> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_none(ffi::gst_rtsp_stream_transport_get_stream(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_get_transport")]
|
|
|
|
//#[doc(alias = "get_transport")]
|
2021-04-11 19:38:18 +00:00
|
|
|
//fn transport(&self) -> /*Ignored*/Option<gst_rtsp::RTSPTransport> {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_get_transport() }
|
2018-02-09 02:30:08 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_get_url")]
|
|
|
|
#[doc(alias = "get_url")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn url(&self) -> Option<gst_rtsp::RTSPUrl> {
|
2018-02-09 02:30:08 +00:00
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib_none(ffi::gst_rtsp_stream_transport_get_url(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_is_timed_out")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn is_timed_out(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
from_glib(ffi::gst_rtsp_stream_transport_is_timed_out(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_keep_alive")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn keep_alive(&self) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_keep_alive(self.as_ref().to_glib_none().0);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_16")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_message_sent")]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn message_sent(&self) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_message_sent(self.as_ref().to_glib_none().0);
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_recv_data")]
|
2021-04-28 12:32:14 +00:00
|
|
|
fn recv_data(
|
|
|
|
&self,
|
|
|
|
channel: u32,
|
2023-01-03 18:56:00 +00:00
|
|
|
buffer: gst::Buffer,
|
2021-04-28 12:32:14 +00:00
|
|
|
) -> Result<gst::FlowSuccess, gst::FlowError> {
|
|
|
|
unsafe {
|
2021-05-23 16:27:13 +00:00
|
|
|
try_from_glib(ffi::gst_rtsp_stream_transport_recv_data(
|
2021-04-28 12:32:14 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
channel,
|
2023-01-03 18:56:00 +00:00
|
|
|
buffer.into_glib_ptr(),
|
2021-04-28 12:32:14 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_send_rtcp")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn send_rtcp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_send_rtcp(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
buffer.to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to send rtcp"
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
//#[cfg(feature = "v1_16")]
|
|
|
|
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_send_rtcp_list")]
|
2021-06-28 10:14:00 +00:00
|
|
|
//fn send_rtcp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_send_rtcp_list() }
|
2019-04-23 14:32:09 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_send_rtp")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn send_rtp(&self, buffer: &gst::Buffer) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_send_rtp(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
buffer.to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to send rtp"
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
//#[cfg(feature = "v1_16")]
|
|
|
|
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_send_rtp_list")]
|
2021-06-28 10:14:00 +00:00
|
|
|
//fn send_rtp_list(&self, buffer_list: /*Ignored*/&gst::BufferList) -> bool {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_send_rtp_list() }
|
2019-04-23 14:32:09 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_active")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::result_from_gboolean!(
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_active(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
active.into_glib()
|
2019-06-18 10:12:00 +00:00
|
|
|
),
|
|
|
|
"Failed to set active"
|
|
|
|
)
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_set_callbacks")]
|
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) {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_callbacks() }
|
2018-02-09 02:30:08 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_keepalive")]
|
2019-01-29 13:53:44 +00:00
|
|
|
fn set_keepalive<P: Fn() + 'static>(&self, keep_alive: P) {
|
2019-10-04 21:03:57 +00:00
|
|
|
let keep_alive_data: Box_<P> = Box_::new(keep_alive);
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe extern "C" fn keep_alive_func<P: Fn() + 'static>(user_data: glib::ffi::gpointer) {
|
2023-11-29 09:59:03 +00:00
|
|
|
let callback = &*(user_data as *mut P);
|
2023-02-07 19:00:46 +00:00
|
|
|
(*callback)()
|
2019-01-29 13:53:44 +00:00
|
|
|
}
|
|
|
|
let keep_alive = Some(keep_alive_func::<P> as _);
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib::ffi::gpointer) {
|
2023-11-29 09:59:03 +00:00
|
|
|
let _callback = Box_::from_raw(data as *mut P);
|
2019-01-29 13:53:44 +00:00
|
|
|
}
|
|
|
|
let destroy_call3 = Some(notify_func::<P> as _);
|
|
|
|
let super_callback0: Box_<P> = keep_alive_data;
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_keepalive(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
keep_alive,
|
2019-10-04 21:03:57 +00:00
|
|
|
Box_::into_raw(super_callback0) as *mut _,
|
2019-06-18 10:12:00 +00:00
|
|
|
destroy_call3,
|
|
|
|
);
|
2019-01-29 13:53:44 +00:00
|
|
|
}
|
|
|
|
}
|
2018-02-09 02:30:08 +00:00
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
//#[cfg(feature = "v1_16")]
|
|
|
|
//#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_set_list_callbacks")]
|
2022-06-30 05:22:05 +00:00
|
|
|
//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<Basic: Pointer>) {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_list_callbacks() }
|
2019-04-23 14:32:09 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_message_sent")]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn set_message_sent<P: Fn() + 'static>(&self, message_sent: P) {
|
2019-10-04 21:03:57 +00:00
|
|
|
let message_sent_data: Box_<P> = Box_::new(message_sent);
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe extern "C" fn message_sent_func<P: Fn() + 'static>(user_data: glib::ffi::gpointer) {
|
2023-11-29 09:59:03 +00:00
|
|
|
let callback = &*(user_data as *mut P);
|
2023-02-07 19:00:46 +00:00
|
|
|
(*callback)()
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
let message_sent = Some(message_sent_func::<P> as _);
|
2020-11-22 10:40:56 +00:00
|
|
|
unsafe extern "C" fn notify_func<P: Fn() + 'static>(data: glib::ffi::gpointer) {
|
2023-11-29 09:59:03 +00:00
|
|
|
let _callback = Box_::from_raw(data as *mut P);
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
let destroy_call3 = Some(notify_func::<P> as _);
|
|
|
|
let super_callback0: Box_<P> = message_sent_data;
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_message_sent(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
message_sent,
|
2019-10-04 21:03:57 +00:00
|
|
|
Box_::into_raw(super_callback0) as *mut _,
|
2019-06-18 10:12:00 +00:00
|
|
|
destroy_call3,
|
|
|
|
);
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_message_sent_full")]
|
2020-06-03 12:26:16 +00:00
|
|
|
fn set_message_sent_full<P: Fn(&RTSPStreamTransport) + 'static>(&self, message_sent: P) {
|
|
|
|
let message_sent_data: Box_<P> = Box_::new(message_sent);
|
|
|
|
unsafe extern "C" fn message_sent_func<P: Fn(&RTSPStreamTransport) + 'static>(
|
2020-11-22 10:40:56 +00:00
|
|
|
trans: *mut ffi::GstRTSPStreamTransport,
|
|
|
|
user_data: glib::ffi::gpointer,
|
2020-06-03 12:26:16 +00:00
|
|
|
) {
|
|
|
|
let trans = from_glib_borrow(trans);
|
2023-11-29 09:59:03 +00:00
|
|
|
let callback = &*(user_data as *mut P);
|
2023-02-07 19:00:46 +00:00
|
|
|
(*callback)(&trans)
|
2020-06-03 12:26:16 +00:00
|
|
|
}
|
|
|
|
let message_sent = Some(message_sent_func::<P> as _);
|
|
|
|
unsafe extern "C" fn notify_func<P: Fn(&RTSPStreamTransport) + 'static>(
|
2020-11-22 10:40:56 +00:00
|
|
|
data: glib::ffi::gpointer,
|
2020-06-03 12:26:16 +00:00
|
|
|
) {
|
2023-11-29 09:59:03 +00:00
|
|
|
let _callback = Box_::from_raw(data as *mut P);
|
2020-06-03 12:26:16 +00:00
|
|
|
}
|
|
|
|
let destroy_call3 = Some(notify_func::<P> as _);
|
|
|
|
let super_callback0: Box_<P> = message_sent_data;
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_message_sent_full(
|
2020-06-03 12:26:16 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
message_sent,
|
|
|
|
Box_::into_raw(super_callback0) as *mut _,
|
|
|
|
destroy_call3,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_timed_out")]
|
2018-02-09 02:30:08 +00:00
|
|
|
fn set_timed_out(&self, timedout: bool) {
|
|
|
|
unsafe {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_timed_out(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
timedout.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
//#[doc(alias = "gst_rtsp_stream_transport_set_transport")]
|
2023-01-03 18:56:00 +00:00
|
|
|
//fn set_transport(&self, tr: /*Ignored*/gst_rtsp::RTSPTransport) {
|
2020-11-22 10:40:56 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_rtsp_stream_transport_set_transport() }
|
2018-02-09 02:30:08 +00:00
|
|
|
//}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_rtsp_stream_transport_set_url")]
|
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 {
|
2020-11-22 10:40:56 +00:00
|
|
|
ffi::gst_rtsp_stream_transport_set_url(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
url.to_glib_none().0,
|
|
|
|
);
|
2018-02-09 02:30:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<RTSPStreamTransport>> RTSPStreamTransportExt for O {}
|