2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
2020-02-23 08:00:05 +00:00
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use crate::RTSPMedia;
|
2020-02-23 08:00:05 +00:00
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::RTSPMedia>> Sealed for T {}
|
2020-02-23 08:00:05 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait RTSPMediaExtManual: sealed::Sealed + IsA<RTSPMedia> + 'static {
|
|
|
|
#[doc(alias = "gst_rtsp_media_take_pipeline")]
|
2023-01-04 16:11:27 +00:00
|
|
|
fn take_pipeline(&self, pipeline: impl IsA<gst::Pipeline>) {
|
2020-02-23 08:00:05 +00:00
|
|
|
unsafe {
|
2023-01-04 16:11:27 +00:00
|
|
|
let pipeline = pipeline.upcast().into_glib_ptr();
|
2020-02-23 08:00:05 +00:00
|
|
|
// See https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/merge_requests/109
|
2020-11-22 10:45:51 +00:00
|
|
|
glib::gobject_ffi::g_object_force_floating(pipeline as *mut _);
|
|
|
|
ffi::gst_rtsp_media_take_pipeline(self.as_ref().to_glib_none().0, pipeline);
|
|
|
|
if glib::gobject_ffi::g_object_is_floating(pipeline as *mut _) != glib::ffi::GFALSE {
|
|
|
|
glib::gobject_ffi::g_object_ref_sink(pipeline as *mut _);
|
2020-02-23 08:00:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<RTSPMedia>> RTSPMediaExtManual for O {}
|