2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
|
|
|
|
2021-04-26 12:15:53 +00:00
|
|
|
use glib::prelude::*;
|
2020-02-23 08:00:05 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
2020-11-22 10:45:51 +00:00
|
|
|
use crate::RTSPMedia;
|
2020-02-23 08:00:05 +00:00
|
|
|
|
|
|
|
pub trait RTSPMediaExtManual: 'static {
|
2021-05-19 20:35:47 +00:00
|
|
|
#[doc(alias = "gst_rtsp_media_take_pipeline")]
|
2020-02-23 08:00:05 +00:00
|
|
|
fn take_pipeline<P: IsA<gst::Pipeline>>(&self, pipeline: &P);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<O: IsA<RTSPMedia>> RTSPMediaExtManual for O {
|
|
|
|
fn take_pipeline<P: IsA<gst::Pipeline>>(&self, pipeline: &P) {
|
|
|
|
unsafe {
|
|
|
|
let pipeline = pipeline.as_ref().to_glib_full();
|
|
|
|
// 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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|