1// Take a look at the license at the top of the repository in the LICENSE file.
23use glib::{prelude::*, translate::*};
45use crate::{ffi, RTSPMedia};
67pub trait RTSPMediaExtManual: IsA<RTSPMedia> + 'static {
8/// Set `pipeline` as the [`gst::Pipeline`][crate::gst::Pipeline] for `self`. Ownership is
9 /// taken of `pipeline`.
10 /// ## `pipeline`
11 /// a [`gst::Pipeline`][crate::gst::Pipeline]
12#[doc(alias = "gst_rtsp_media_take_pipeline")]
13fn take_pipeline(&self, pipeline: &impl IsA<gst::Pipeline>) {
14unsafe {
15#[cfg(feature = "v1_18")]
16{
17 ffi::gst_rtsp_media_take_pipeline(
18self.as_ref().to_glib_none().0,
19 pipeline.upcast_ref().to_glib_none().0,
20 );
21 }
22#[cfg(not(feature = "v1_18"))]
23{
24let pipeline = pipeline.upcast_ref().to_glib_full();
25// See https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/merge_requests/109
26glib::gobject_ffi::g_object_force_floating(pipeline as *mut _);
27 ffi::gst_rtsp_media_take_pipeline(self.as_ref().to_glib_none().0, pipeline);
28if glib::gobject_ffi::g_object_is_floating(pipeline as *mut _) != glib::ffi::GFALSE
29 {
30 glib::gobject_ffi::g_object_ref_sink(pipeline as *mut _);
31 }
32 }
33 }
34 }
35}
3637impl<O: IsA<RTSPMedia>> RTSPMediaExtManual for O {}