gstreamer-rs/gstreamer-rtsp-server/src/auto/rtsp_session_media.rs

167 lines
5.4 KiB
Rust
Raw Normal View History

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)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
2020-11-22 10:40:56 +00:00
use crate::RTSPMedia;
use crate::RTSPStreamTransport;
use glib::object::IsA;
use glib::translate::*;
use std::mem;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstRTSPSessionMedia")]
2020-11-22 10:40:56 +00:00
pub struct RTSPSessionMedia(Object<ffi::GstRTSPSessionMedia, ffi::GstRTSPSessionMediaClass>);
match fn {
type_ => || ffi::gst_rtsp_session_media_get_type(),
}
}
impl RTSPSessionMedia {
2021-11-16 14:02:58 +00:00
pub const NONE: Option<&'static RTSPSessionMedia> = None;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_new")]
pub fn new(path: &str, media: &impl IsA<RTSPMedia>) -> RTSPSessionMedia {
skip_assert_initialized!();
unsafe {
2020-11-22 10:40:56 +00:00
from_glib_full(ffi::gst_rtsp_session_media_new(
path.to_glib_none().0,
media.as_ref().to_glib_full(),
))
}
}
}
unsafe impl Send for RTSPSessionMedia {}
unsafe impl Sync for RTSPSessionMedia {}
pub trait RTSPSessionMediaExt: 'static {
2020-12-08 13:00:17 +00:00
//#[doc(alias = "gst_rtsp_session_media_alloc_channels")]
//fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_get_base_time")]
#[doc(alias = "get_base_time")]
fn base_time(&self) -> Option<gst::ClockTime>;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_get_media")]
#[doc(alias = "get_media")]
2021-04-11 19:38:18 +00:00
fn media(&self) -> Option<RTSPMedia>;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_get_rtpinfo")]
#[doc(alias = "get_rtpinfo")]
2021-04-11 19:38:18 +00:00
fn rtpinfo(&self) -> Option<glib::GString>;
2020-12-08 13:00:17 +00:00
//#[doc(alias = "gst_rtsp_session_media_get_rtsp_state")]
//#[doc(alias = "get_rtsp_state")]
2021-04-11 19:38:18 +00:00
//fn rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_get_transport")]
#[doc(alias = "get_transport")]
2021-04-19 20:13:58 +00:00
fn transport(&self, idx: u32) -> Option<RTSPStreamTransport>;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_get_transports")]
#[doc(alias = "get_transports")]
2021-04-11 19:38:18 +00:00
fn transports(&self) -> Vec<RTSPStreamTransport>;
2018-03-15 08:21:53 +00:00
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_matches")]
fn matches(&self, path: &str) -> Option<i32>;
2020-12-08 13:00:17 +00:00
//#[doc(alias = "gst_rtsp_session_media_set_rtsp_state")]
//fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState);
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_rtsp_session_media_set_state")]
fn set_state(&self, state: gst::State) -> Result<(), glib::error::BoolError>;
2020-12-08 13:00:17 +00:00
//#[doc(alias = "gst_rtsp_session_media_set_transport")]
//fn set_transport(&self, stream: &impl IsA<RTSPStream>, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport>;
}
impl<O: IsA<RTSPSessionMedia>> RTSPSessionMediaExt for O {
//fn alloc_channels(&self, range: /*Ignored*/gst_rtsp::RTSPRange) -> bool {
2020-11-22 10:40:56 +00:00
// unsafe { TODO: call ffi:gst_rtsp_session_media_alloc_channels() }
//}
fn base_time(&self) -> Option<gst::ClockTime> {
unsafe {
2020-11-22 10:40:56 +00:00
from_glib(ffi::gst_rtsp_session_media_get_base_time(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
fn media(&self) -> Option<RTSPMedia> {
unsafe {
2020-11-22 10:40:56 +00:00
from_glib_none(ffi::gst_rtsp_session_media_get_media(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
fn rtpinfo(&self) -> Option<glib::GString> {
unsafe {
2020-11-22 10:40:56 +00:00
from_glib_full(ffi::gst_rtsp_session_media_get_rtpinfo(
self.as_ref().to_glib_none().0,
))
}
}
2021-04-11 19:38:18 +00:00
//fn rtsp_state(&self) -> /*Ignored*/gst_rtsp::RTSPState {
2020-11-22 10:40:56 +00:00
// unsafe { TODO: call ffi:gst_rtsp_session_media_get_rtsp_state() }
//}
2021-04-19 20:13:58 +00:00
fn transport(&self, idx: u32) -> Option<RTSPStreamTransport> {
unsafe {
2020-11-22 10:40:56 +00:00
from_glib_none(ffi::gst_rtsp_session_media_get_transport(
self.as_ref().to_glib_none().0,
idx,
))
}
}
2021-04-11 19:38:18 +00:00
fn transports(&self) -> Vec<RTSPStreamTransport> {
unsafe {
2020-11-22 10:40:56 +00:00
FromGlibPtrContainer::from_glib_full(ffi::gst_rtsp_session_media_get_transports(
self.as_ref().to_glib_none().0,
))
}
}
2018-03-15 08:21:53 +00:00
fn matches(&self, path: &str) -> Option<i32> {
unsafe {
2019-07-10 08:21:28 +00:00
let mut matched = mem::MaybeUninit::uninit();
2020-11-22 10:40:56 +00:00
let ret = from_glib(ffi::gst_rtsp_session_media_matches(
self.as_ref().to_glib_none().0,
path.to_glib_none().0,
2019-07-10 08:21:28 +00:00
matched.as_mut_ptr(),
));
2019-07-10 08:21:28 +00:00
let matched = matched.assume_init();
if ret {
Some(matched)
} else {
None
}
}
}
//fn set_rtsp_state(&self, state: /*Ignored*/gst_rtsp::RTSPState) {
2020-11-22 10:40:56 +00:00
// unsafe { TODO: call ffi:gst_rtsp_session_media_set_rtsp_state() }
//}
fn set_state(&self, state: gst::State) -> 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_session_media_set_state(
self.as_ref().to_glib_none().0,
state.into_glib()
),
"Failed to set state of session media"
)
}
}
//fn set_transport(&self, stream: &impl IsA<RTSPStream>, tr: /*Ignored*/&mut gst_rtsp::RTSPTransport) -> Option<RTSPStreamTransport> {
2020-11-22 10:40:56 +00:00
// unsafe { TODO: call ffi:gst_rtsp_session_media_set_transport() }
//}
}