gstreamer_rtsp_server/auto/
rtsp_media.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{
7    ffi, RTSPAddressPool, RTSPMediaStatus, RTSPPublishClockMode, RTSPStream, RTSPStreamTransport,
8    RTSPSuspendMode, RTSPThread, RTSPTransportMode,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{connect_raw, SignalHandlerId},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// A class that contains the GStreamer element along with a list of
20    /// [`RTSPStream`][crate::RTSPStream] objects that can produce data.
21    ///
22    /// This object is usually created from a [`RTSPMediaFactory`][crate::RTSPMediaFactory].
23    ///
24    /// ## Properties
25    ///
26    ///
27    /// #### `bind-mcast-address`
28    ///  Readable | Writeable
29    ///
30    ///
31    /// #### `buffer-size`
32    ///  Readable | Writeable
33    ///
34    ///
35    /// #### `clock`
36    ///  Readable | Writeable
37    ///
38    ///
39    /// #### `dscp-qos`
40    ///  Readable | Writeable
41    ///
42    ///
43    /// #### `element`
44    ///  Readable | Writeable | Construct Only
45    ///
46    ///
47    /// #### `ensure-keyunit-on-start`
48    ///  Whether or not a keyunit should be ensured when a client connects. It
49    /// will also configure the streams to drop delta units to ensure that they start
50    /// on a keyunit.
51    ///
52    /// Note that this will only affect non-shared medias for now.
53    ///
54    /// Readable | Writeable
55    ///
56    ///
57    /// #### `ensure-keyunit-on-start-timeout`
58    ///  The maximum allowed time before the first keyunit is considered
59    /// expired.
60    ///
61    /// Note that this will only have an effect when ensure-keyunit-on-start is
62    /// enabled.
63    ///
64    /// Readable | Writeable
65    ///
66    ///
67    /// #### `eos-shutdown`
68    ///  Readable | Writeable
69    ///
70    ///
71    /// #### `latency`
72    ///  Readable | Writeable
73    ///
74    ///
75    /// #### `max-mcast-ttl`
76    ///  Readable | Writeable
77    ///
78    ///
79    /// #### `profiles`
80    ///  Readable | Writeable
81    ///
82    ///
83    /// #### `protocols`
84    ///  Readable | Writeable
85    ///
86    ///
87    /// #### `reusable`
88    ///  Readable | Writeable
89    ///
90    ///
91    /// #### `shared`
92    ///  Readable | Writeable
93    ///
94    ///
95    /// #### `stop-on-disconnect`
96    ///  Readable | Writeable
97    ///
98    ///
99    /// #### `suspend-mode`
100    ///  Readable | Writeable
101    ///
102    ///
103    /// #### `time-provider`
104    ///  Readable | Writeable
105    ///
106    ///
107    /// #### `transport-mode`
108    ///  Readable | Writeable
109    ///
110    /// ## Signals
111    ///
112    ///
113    /// #### `handle-message`
114    ///  Will be emitted when a message appears on the pipeline bus.
115    ///
116    /// Detailed
117    ///
118    ///
119    /// #### `new-state`
120    ///
121    ///
122    ///
123    /// #### `new-stream`
124    ///
125    ///
126    ///
127    /// #### `prepared`
128    ///
129    ///
130    ///
131    /// #### `removed-stream`
132    ///
133    ///
134    ///
135    /// #### `target-state`
136    ///
137    ///
138    ///
139    /// #### `unprepared`
140    ///
141    ///
142    /// # Implements
143    ///
144    /// [`RTSPMediaExt`][trait@crate::prelude::RTSPMediaExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual]
145    #[doc(alias = "GstRTSPMedia")]
146    pub struct RTSPMedia(Object<ffi::GstRTSPMedia, ffi::GstRTSPMediaClass>);
147
148    match fn {
149        type_ => || ffi::gst_rtsp_media_get_type(),
150    }
151}
152
153impl RTSPMedia {
154    pub const NONE: Option<&'static RTSPMedia> = None;
155
156    /// Create a new [`RTSPMedia`][crate::RTSPMedia] instance. `element` is the bin element that
157    /// provides the different streams. The [`RTSPMedia`][crate::RTSPMedia] object contains the
158    /// element to produce RTP data for one or more related (audio/video/..)
159    /// streams.
160    ///
161    /// Ownership is taken of `element`.
162    /// ## `element`
163    /// a [`gst::Element`][crate::gst::Element]
164    ///
165    /// # Returns
166    ///
167    /// a new [`RTSPMedia`][crate::RTSPMedia] object.
168    #[doc(alias = "gst_rtsp_media_new")]
169    pub fn new(element: impl IsA<gst::Element>) -> RTSPMedia {
170        assert_initialized_main_thread!();
171        unsafe { from_glib_full(ffi::gst_rtsp_media_new(element.upcast().into_glib_ptr())) }
172    }
173}
174
175unsafe impl Send for RTSPMedia {}
176unsafe impl Sync for RTSPMedia {}
177
178mod sealed {
179    pub trait Sealed {}
180    impl<T: super::IsA<super::RTSPMedia>> Sealed for T {}
181}
182
183/// Trait containing all [`struct@RTSPMedia`] methods.
184///
185/// # Implementors
186///
187/// [`RTSPMedia`][struct@crate::RTSPMedia], [`RTSPOnvifMedia`][struct@crate::RTSPOnvifMedia]
188pub trait RTSPMediaExt: IsA<RTSPMedia> + sealed::Sealed + 'static {
189    /// Check if the pipeline for `self` can be shared between multiple clients.
190    ///
191    /// This checks if the media is shareable and whether it is either reusable or
192    /// was never unprepared before.
193    ///
194    /// The function must be called with [`lock()`][Self::lock()].
195    ///
196    /// # Returns
197    ///
198    /// [`true`] if the media can be shared between clients.
199    #[cfg(feature = "v1_24")]
200    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
201    #[doc(alias = "gst_rtsp_media_can_be_shared")]
202    fn can_be_shared(&self) -> bool {
203        unsafe {
204            from_glib(ffi::gst_rtsp_media_can_be_shared(
205                self.as_ref().to_glib_none().0,
206            ))
207        }
208    }
209
210    /// Find all payloader elements, they should be named pay\`d` in the
211    /// element of `self`, and create `GstRTSPStreams` for them.
212    ///
213    /// Collect all dynamic elements, named dynpay\`d`, and add them to
214    /// the list of dynamic elements.
215    ///
216    /// Find all depayloader elements, they should be named depay\`d` in the
217    /// element of `self`, and create `GstRTSPStreams` for them.
218    #[doc(alias = "gst_rtsp_media_collect_streams")]
219    fn collect_streams(&self) {
220        unsafe {
221            ffi::gst_rtsp_media_collect_streams(self.as_ref().to_glib_none().0);
222        }
223    }
224
225    //#[doc(alias = "gst_rtsp_media_complete_pipeline")]
226    //fn complete_pipeline(&self, transports: /*Ignored*/&[gst_rtsp::RTSPTransport]) -> bool {
227    //    unsafe { TODO: call ffi:gst_rtsp_media_complete_pipeline() }
228    //}
229
230    /// Create a new stream in `self` that provides RTP data on `pad`.
231    /// `pad` should be a pad of an element inside `self`->element.
232    /// ## `payloader`
233    /// a [`gst::Element`][crate::gst::Element]
234    /// ## `pad`
235    /// a [`gst::Pad`][crate::gst::Pad]
236    ///
237    /// # Returns
238    ///
239    /// a new [`RTSPStream`][crate::RTSPStream] that remains valid for as long
240    /// as `self` exists.
241    #[doc(alias = "gst_rtsp_media_create_stream")]
242    fn create_stream(
243        &self,
244        payloader: &impl IsA<gst::Element>,
245        pad: &impl IsA<gst::Pad>,
246    ) -> RTSPStream {
247        unsafe {
248            from_glib_none(ffi::gst_rtsp_media_create_stream(
249                self.as_ref().to_glib_none().0,
250                payloader.as_ref().to_glib_none().0,
251                pad.as_ref().to_glib_none().0,
252            ))
253        }
254    }
255
256    /// Find a stream in `self` with `control` as the control uri.
257    /// ## `control`
258    /// the control of the stream
259    ///
260    /// # Returns
261    ///
262    /// the [`RTSPStream`][crate::RTSPStream] with
263    /// control uri `control` or [`None`] when a stream with that control did
264    /// not exist.
265    #[doc(alias = "gst_rtsp_media_find_stream")]
266    fn find_stream(&self, control: &str) -> Option<RTSPStream> {
267        unsafe {
268            from_glib_none(ffi::gst_rtsp_media_find_stream(
269                self.as_ref().to_glib_none().0,
270                control.to_glib_none().0,
271            ))
272        }
273    }
274
275    /// Get the [`RTSPAddressPool`][crate::RTSPAddressPool] used as the address pool of `self`.
276    ///
277    /// # Returns
278    ///
279    /// the [`RTSPAddressPool`][crate::RTSPAddressPool] of `self`.
280    /// `g_object_unref()` after usage.
281    #[doc(alias = "gst_rtsp_media_get_address_pool")]
282    #[doc(alias = "get_address_pool")]
283    fn address_pool(&self) -> Option<RTSPAddressPool> {
284        unsafe {
285            from_glib_full(ffi::gst_rtsp_media_get_address_pool(
286                self.as_ref().to_glib_none().0,
287            ))
288        }
289    }
290
291    /// Get the base_time that is used by the pipeline in `self`.
292    ///
293    /// `self` must be prepared before this method returns a valid base_time.
294    ///
295    /// # Returns
296    ///
297    /// the base_time used by `self`.
298    #[doc(alias = "gst_rtsp_media_get_base_time")]
299    #[doc(alias = "get_base_time")]
300    fn base_time(&self) -> Option<gst::ClockTime> {
301        unsafe {
302            from_glib(ffi::gst_rtsp_media_get_base_time(
303                self.as_ref().to_glib_none().0,
304            ))
305        }
306    }
307
308    /// Get the kernel UDP buffer size.
309    ///
310    /// # Returns
311    ///
312    /// the kernel UDP buffer size.
313    #[doc(alias = "gst_rtsp_media_get_buffer_size")]
314    #[doc(alias = "get_buffer_size")]
315    #[doc(alias = "buffer-size")]
316    fn buffer_size(&self) -> u32 {
317        unsafe { ffi::gst_rtsp_media_get_buffer_size(self.as_ref().to_glib_none().0) }
318    }
319
320    /// Get the clock that is used by the pipeline in `self`.
321    ///
322    /// `self` must be prepared before this method returns a valid clock object.
323    ///
324    /// # Returns
325    ///
326    /// the [`gst::Clock`][crate::gst::Clock] used by `self`. unref after usage.
327    #[doc(alias = "gst_rtsp_media_get_clock")]
328    #[doc(alias = "get_clock")]
329    fn clock(&self) -> Option<gst::Clock> {
330        unsafe {
331            from_glib_full(ffi::gst_rtsp_media_get_clock(
332                self.as_ref().to_glib_none().0,
333            ))
334        }
335    }
336
337    ///
338    /// # Returns
339    ///
340    /// Whether retransmission requests will be sent
341    #[cfg(feature = "v1_16")]
342    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
343    #[doc(alias = "gst_rtsp_media_get_do_retransmission")]
344    #[doc(alias = "get_do_retransmission")]
345    fn does_retransmission(&self) -> bool {
346        unsafe {
347            from_glib(ffi::gst_rtsp_media_get_do_retransmission(
348                self.as_ref().to_glib_none().0,
349            ))
350        }
351    }
352
353    /// Get the configured DSCP QoS of attached media.
354    ///
355    /// # Returns
356    ///
357    /// the DSCP QoS value of attached streams or -1 if disabled.
358    #[cfg(feature = "v1_18")]
359    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
360    #[doc(alias = "gst_rtsp_media_get_dscp_qos")]
361    #[doc(alias = "get_dscp_qos")]
362    #[doc(alias = "dscp-qos")]
363    fn dscp_qos(&self) -> i32 {
364        unsafe { ffi::gst_rtsp_media_get_dscp_qos(self.as_ref().to_glib_none().0) }
365    }
366
367    /// Get the element that was used when constructing `self`.
368    ///
369    /// # Returns
370    ///
371    /// a [`gst::Element`][crate::gst::Element]. Unref after usage.
372    #[doc(alias = "gst_rtsp_media_get_element")]
373    #[doc(alias = "get_element")]
374    fn element(&self) -> gst::Element {
375        unsafe {
376            from_glib_full(ffi::gst_rtsp_media_get_element(
377                self.as_ref().to_glib_none().0,
378            ))
379        }
380    }
381
382    /// Get ensure-keyunit-on-start flag.
383    ///
384    /// # Returns
385    ///
386    /// The ensure-keyunit-on-start flag.
387    #[cfg(feature = "v1_24")]
388    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
389    #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start")]
390    #[doc(alias = "get_ensure_keyunit_on_start")]
391    #[doc(alias = "ensure-keyunit-on-start")]
392    fn is_ensure_keyunit_on_start(&self) -> bool {
393        unsafe {
394            from_glib(ffi::gst_rtsp_media_get_ensure_keyunit_on_start(
395                self.as_ref().to_glib_none().0,
396            ))
397        }
398    }
399
400    /// Get ensure-keyunit-on-start-timeout time.
401    ///
402    /// # Returns
403    ///
404    /// The ensure-keyunit-on-start-timeout time.
405    #[cfg(feature = "v1_24")]
406    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
407    #[doc(alias = "gst_rtsp_media_get_ensure_keyunit_on_start_timeout")]
408    #[doc(alias = "get_ensure_keyunit_on_start_timeout")]
409    #[doc(alias = "ensure-keyunit-on-start-timeout")]
410    fn ensure_keyunit_on_start_timeout(&self) -> u32 {
411        unsafe {
412            ffi::gst_rtsp_media_get_ensure_keyunit_on_start_timeout(self.as_ref().to_glib_none().0)
413        }
414    }
415
416    /// Get the latency that is used for receiving media.
417    ///
418    /// # Returns
419    ///
420    /// latency in milliseconds
421    #[doc(alias = "gst_rtsp_media_get_latency")]
422    #[doc(alias = "get_latency")]
423    fn latency(&self) -> u32 {
424        unsafe { ffi::gst_rtsp_media_get_latency(self.as_ref().to_glib_none().0) }
425    }
426
427    /// Get the the maximum time-to-live value of outgoing multicast packets.
428    ///
429    /// # Returns
430    ///
431    /// the maximum time-to-live value of outgoing multicast packets.
432    #[cfg(feature = "v1_16")]
433    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
434    #[doc(alias = "gst_rtsp_media_get_max_mcast_ttl")]
435    #[doc(alias = "get_max_mcast_ttl")]
436    #[doc(alias = "max-mcast-ttl")]
437    fn max_mcast_ttl(&self) -> u32 {
438        unsafe { ffi::gst_rtsp_media_get_max_mcast_ttl(self.as_ref().to_glib_none().0) }
439    }
440
441    /// Get the multicast interface used for `self`.
442    ///
443    /// # Returns
444    ///
445    /// the multicast interface for `self`.
446    /// `g_free()` after usage.
447    #[doc(alias = "gst_rtsp_media_get_multicast_iface")]
448    #[doc(alias = "get_multicast_iface")]
449    fn multicast_iface(&self) -> Option<glib::GString> {
450        unsafe {
451            from_glib_full(ffi::gst_rtsp_media_get_multicast_iface(
452                self.as_ref().to_glib_none().0,
453            ))
454        }
455    }
456
457    //#[doc(alias = "gst_rtsp_media_get_permissions")]
458    //#[doc(alias = "get_permissions")]
459    //fn permissions(&self) -> /*Ignored*/Option<RTSPPermissions> {
460    //    unsafe { TODO: call ffi:gst_rtsp_media_get_permissions() }
461    //}
462
463    /// Get the allowed profiles of `self`.
464    ///
465    /// # Returns
466    ///
467    /// a [`gst_rtsp::RTSPProfile`][crate::gst_rtsp::RTSPProfile]
468    #[doc(alias = "gst_rtsp_media_get_profiles")]
469    #[doc(alias = "get_profiles")]
470    fn profiles(&self) -> gst_rtsp::RTSPProfile {
471        unsafe {
472            from_glib(ffi::gst_rtsp_media_get_profiles(
473                self.as_ref().to_glib_none().0,
474            ))
475        }
476    }
477
478    /// Get the allowed protocols of `self`.
479    ///
480    /// # Returns
481    ///
482    /// a [`gst_rtsp::RTSPLowerTrans`][crate::gst_rtsp::RTSPLowerTrans]
483    #[doc(alias = "gst_rtsp_media_get_protocols")]
484    #[doc(alias = "get_protocols")]
485    fn protocols(&self) -> gst_rtsp::RTSPLowerTrans {
486        unsafe {
487            from_glib(ffi::gst_rtsp_media_get_protocols(
488                self.as_ref().to_glib_none().0,
489            ))
490        }
491    }
492
493    /// Gets if and how the media clock should be published according to RFC7273.
494    ///
495    /// # Returns
496    ///
497    /// The GstRTSPPublishClockMode
498    #[doc(alias = "gst_rtsp_media_get_publish_clock_mode")]
499    #[doc(alias = "get_publish_clock_mode")]
500    fn publish_clock_mode(&self) -> RTSPPublishClockMode {
501        unsafe {
502            from_glib(ffi::gst_rtsp_media_get_publish_clock_mode(
503                self.as_ref().to_glib_none().0,
504            ))
505        }
506    }
507
508    /// Get the current range as a string. `self` must be prepared with
509    /// gst_rtsp_media_prepare ().
510    /// ## `play`
511    /// for the PLAY request
512    /// ## `unit`
513    /// the unit to use for the string
514    ///
515    /// # Returns
516    ///
517    /// The range as a string, `g_free()` after usage.
518    #[doc(alias = "gst_rtsp_media_get_range_string")]
519    #[doc(alias = "get_range_string")]
520    fn range_string(&self, play: bool, unit: gst_rtsp::RTSPRangeUnit) -> Option<glib::GString> {
521        unsafe {
522            from_glib_full(ffi::gst_rtsp_media_get_range_string(
523                self.as_ref().to_glib_none().0,
524                play.into_glib(),
525                unit.into_glib(),
526            ))
527        }
528    }
529
530    ///
531    /// # Returns
532    ///
533    /// whether `self` will follow the Rate-Control=no behaviour as specified
534    /// in the ONVIF replay spec.
535    #[cfg(feature = "v1_18")]
536    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
537    #[doc(alias = "gst_rtsp_media_get_rate_control")]
538    #[doc(alias = "get_rate_control")]
539    fn is_rate_control(&self) -> bool {
540        unsafe {
541            from_glib(ffi::gst_rtsp_media_get_rate_control(
542                self.as_ref().to_glib_none().0,
543            ))
544        }
545    }
546
547    /// Get the rate and applied_rate of the current segment.
548    ///
549    /// # Returns
550    ///
551    /// [`false`] if looking up the rate and applied rate failed. Otherwise
552    /// [`true`] is returned and `rate` and `applied_rate` are set to the rate and
553    /// applied_rate of the current segment.
554    ///
555    /// ## `rate`
556    /// the rate of the current segment
557    ///
558    /// ## `applied_rate`
559    /// the applied_rate of the current segment
560    #[cfg(feature = "v1_18")]
561    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
562    #[doc(alias = "gst_rtsp_media_get_rates")]
563    #[doc(alias = "get_rates")]
564    fn rates(&self) -> Option<(f64, f64)> {
565        unsafe {
566            let mut rate = std::mem::MaybeUninit::uninit();
567            let mut applied_rate = std::mem::MaybeUninit::uninit();
568            let ret = from_glib(ffi::gst_rtsp_media_get_rates(
569                self.as_ref().to_glib_none().0,
570                rate.as_mut_ptr(),
571                applied_rate.as_mut_ptr(),
572            ));
573            if ret {
574                Some((rate.assume_init(), applied_rate.assume_init()))
575            } else {
576                None
577            }
578        }
579    }
580
581    /// Get the amount of time to store retransmission data.
582    ///
583    /// # Returns
584    ///
585    /// the amount of time to store retransmission data.
586    #[doc(alias = "gst_rtsp_media_get_retransmission_time")]
587    #[doc(alias = "get_retransmission_time")]
588    fn retransmission_time(&self) -> Option<gst::ClockTime> {
589        unsafe {
590            from_glib(ffi::gst_rtsp_media_get_retransmission_time(
591                self.as_ref().to_glib_none().0,
592            ))
593        }
594    }
595
596    /// Get the status of `self`. When `self` is busy preparing, this function waits
597    /// until `self` is prepared or in error.
598    ///
599    /// # Returns
600    ///
601    /// the status of `self`.
602    #[doc(alias = "gst_rtsp_media_get_status")]
603    #[doc(alias = "get_status")]
604    fn status(&self) -> RTSPMediaStatus {
605        unsafe {
606            from_glib(ffi::gst_rtsp_media_get_status(
607                self.as_ref().to_glib_none().0,
608            ))
609        }
610    }
611
612    /// Retrieve the stream with index `idx` from `self`.
613    /// ## `idx`
614    /// the stream index
615    ///
616    /// # Returns
617    ///
618    /// the [`RTSPStream`][crate::RTSPStream] at index
619    /// `idx` or [`None`] when a stream with that index did not exist.
620    #[doc(alias = "gst_rtsp_media_get_stream")]
621    #[doc(alias = "get_stream")]
622    fn stream(&self, idx: u32) -> Option<RTSPStream> {
623        unsafe {
624            from_glib_none(ffi::gst_rtsp_media_get_stream(
625                self.as_ref().to_glib_none().0,
626                idx,
627            ))
628        }
629    }
630
631    /// Get how `self` will be suspended.
632    ///
633    /// # Returns
634    ///
635    /// [`RTSPSuspendMode`][crate::RTSPSuspendMode].
636    #[doc(alias = "gst_rtsp_media_get_suspend_mode")]
637    #[doc(alias = "get_suspend_mode")]
638    #[doc(alias = "suspend-mode")]
639    fn suspend_mode(&self) -> RTSPSuspendMode {
640        unsafe {
641            from_glib(ffi::gst_rtsp_media_get_suspend_mode(
642                self.as_ref().to_glib_none().0,
643            ))
644        }
645    }
646
647    /// Get the [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] for the clock used by `self`. The time provider
648    /// will listen on `address` and `port` for client time requests.
649    /// ## `address`
650    /// an address or [`None`]
651    /// ## `port`
652    /// a port or 0
653    ///
654    /// # Returns
655    ///
656    /// the [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] of `self`.
657    #[doc(alias = "gst_rtsp_media_get_time_provider")]
658    #[doc(alias = "get_time_provider")]
659    #[doc(alias = "time-provider")]
660    fn time_provider(&self, address: Option<&str>, port: u16) -> Option<gst_net::NetTimeProvider> {
661        unsafe {
662            from_glib_full(ffi::gst_rtsp_media_get_time_provider(
663                self.as_ref().to_glib_none().0,
664                address.to_glib_none().0,
665                port,
666            ))
667        }
668    }
669
670    /// Check if the pipeline for `self` can be used for PLAY or RECORD methods.
671    ///
672    /// # Returns
673    ///
674    /// The transport mode.
675    #[doc(alias = "gst_rtsp_media_get_transport_mode")]
676    #[doc(alias = "get_transport_mode")]
677    #[doc(alias = "transport-mode")]
678    fn transport_mode(&self) -> RTSPTransportMode {
679        unsafe {
680            from_glib(ffi::gst_rtsp_media_get_transport_mode(
681                self.as_ref().to_glib_none().0,
682            ))
683        }
684    }
685
686    //#[doc(alias = "gst_rtsp_media_handle_sdp")]
687    //fn handle_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage) -> bool {
688    //    unsafe { TODO: call ffi:gst_rtsp_media_handle_sdp() }
689    //}
690
691    /// See [`RTSPStreamExt::is_complete()`][crate::prelude::RTSPStreamExt::is_complete()], [`RTSPStreamExt::is_sender()`][crate::prelude::RTSPStreamExt::is_sender()].
692    ///
693    /// # Returns
694    ///
695    /// whether `self` has at least one complete sender stream.
696    #[cfg(feature = "v1_18")]
697    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
698    #[doc(alias = "gst_rtsp_media_has_completed_sender")]
699    fn has_completed_sender(&self) -> bool {
700        unsafe {
701            from_glib(ffi::gst_rtsp_media_has_completed_sender(
702                self.as_ref().to_glib_none().0,
703            ))
704        }
705    }
706
707    /// Check if multicast sockets are configured to be bound to multicast addresses.
708    ///
709    /// # Returns
710    ///
711    /// [`true`] if multicast sockets are configured to be bound to multicast addresses.
712    #[cfg(feature = "v1_16")]
713    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
714    #[doc(alias = "gst_rtsp_media_is_bind_mcast_address")]
715    #[doc(alias = "bind-mcast-address")]
716    fn is_bind_mcast_address(&self) -> bool {
717        unsafe {
718            from_glib(ffi::gst_rtsp_media_is_bind_mcast_address(
719                self.as_ref().to_glib_none().0,
720            ))
721        }
722    }
723
724    /// Check if the pipeline for `self` will send an EOS down the pipeline before
725    /// unpreparing.
726    ///
727    /// # Returns
728    ///
729    /// [`true`] if the media will send EOS before unpreparing.
730    #[doc(alias = "gst_rtsp_media_is_eos_shutdown")]
731    #[doc(alias = "eos-shutdown")]
732    fn is_eos_shutdown(&self) -> bool {
733        unsafe {
734            from_glib(ffi::gst_rtsp_media_is_eos_shutdown(
735                self.as_ref().to_glib_none().0,
736            ))
737        }
738    }
739
740    ///
741    /// # Returns
742    ///
743    /// [`true`] if `self` is receive-only, [`false`] otherwise.
744    #[cfg(feature = "v1_18")]
745    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
746    #[doc(alias = "gst_rtsp_media_is_receive_only")]
747    fn is_receive_only(&self) -> bool {
748        unsafe {
749            from_glib(ffi::gst_rtsp_media_is_receive_only(
750                self.as_ref().to_glib_none().0,
751            ))
752        }
753    }
754
755    /// Check if the pipeline for `self` can be reused after an unprepare.
756    ///
757    /// # Returns
758    ///
759    /// [`true`] if the media can be reused
760    #[doc(alias = "gst_rtsp_media_is_reusable")]
761    #[doc(alias = "reusable")]
762    fn is_reusable(&self) -> bool {
763        unsafe {
764            from_glib(ffi::gst_rtsp_media_is_reusable(
765                self.as_ref().to_glib_none().0,
766            ))
767        }
768    }
769
770    /// Check if the pipeline for `self` can be shared between multiple clients in
771    /// theory. This simply returns the value set via [`set_shared()`][Self::set_shared()].
772    ///
773    /// To know if a media can be shared in practice, i.e. if it's shareable and
774    /// either reusable or was never unprepared before, use
775    /// [`can_be_shared()`][Self::can_be_shared()].
776    ///
777    /// # Returns
778    ///
779    /// [`true`] if the media can be shared between clients.
780    #[doc(alias = "gst_rtsp_media_is_shared")]
781    #[doc(alias = "shared")]
782    fn is_shared(&self) -> bool {
783        unsafe {
784            from_glib(ffi::gst_rtsp_media_is_shared(
785                self.as_ref().to_glib_none().0,
786            ))
787        }
788    }
789
790    /// Check if the pipeline for `self` will be stopped when a client disconnects
791    /// without sending TEARDOWN.
792    ///
793    /// # Returns
794    ///
795    /// [`true`] if the media will be stopped when a client disconnects
796    ///  without sending TEARDOWN.
797    #[doc(alias = "gst_rtsp_media_is_stop_on_disconnect")]
798    #[doc(alias = "stop-on-disconnect")]
799    fn is_stop_on_disconnect(&self) -> bool {
800        unsafe {
801            from_glib(ffi::gst_rtsp_media_is_stop_on_disconnect(
802                self.as_ref().to_glib_none().0,
803            ))
804        }
805    }
806
807    /// Check if `self` can provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] for its pipeline clock.
808    ///
809    /// Use [`time_provider()`][Self::time_provider()] to get the network clock.
810    ///
811    /// # Returns
812    ///
813    /// [`true`] if `self` can provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider].
814    #[doc(alias = "gst_rtsp_media_is_time_provider")]
815    #[doc(alias = "time-provider")]
816    fn is_time_provider(&self) -> bool {
817        unsafe {
818            from_glib(ffi::gst_rtsp_media_is_time_provider(
819                self.as_ref().to_glib_none().0,
820            ))
821        }
822    }
823
824    /// Lock the entire media. This is needed by callers such as rtsp_client to
825    /// protect the media when it is shared by many clients.
826    /// The lock prevents that concurrent clients alters the shared media,
827    /// while one client already is working with it.
828    /// Typically the lock is taken in external RTSP API calls that uses shared media
829    /// such as DESCRIBE, SETUP, ANNOUNCE, TEARDOWN, PLAY, PAUSE.
830    ///
831    /// As best practice take the lock as soon as the function get hold of a shared
832    /// media object. Release the lock right before the function returns.
833    #[cfg(feature = "v1_18")]
834    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
835    #[doc(alias = "gst_rtsp_media_lock")]
836    fn lock(&self) {
837        unsafe {
838            ffi::gst_rtsp_media_lock(self.as_ref().to_glib_none().0);
839        }
840    }
841
842    /// Get the number of streams in this media.
843    ///
844    /// # Returns
845    ///
846    /// The number of streams.
847    #[doc(alias = "gst_rtsp_media_n_streams")]
848    fn n_streams(&self) -> u32 {
849        unsafe { ffi::gst_rtsp_media_n_streams(self.as_ref().to_glib_none().0) }
850    }
851
852    /// Prepare `self` for streaming. This function will create the objects
853    /// to manage the streaming. A pipeline must have been set on `self` with
854    /// [`RTSPMediaExtManual::take_pipeline()`][crate::prelude::RTSPMediaExtManual::take_pipeline()].
855    ///
856    /// It will preroll the pipeline and collect vital information about the streams
857    /// such as the duration.
858    /// ## `thread`
859    /// a [`RTSPThread`][crate::RTSPThread] to run the
860    ///  bus handler or [`None`]
861    ///
862    /// # Returns
863    ///
864    /// [`true`] on success.
865    #[doc(alias = "gst_rtsp_media_prepare")]
866    fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), glib::error::BoolError> {
867        unsafe {
868            glib::result_from_gboolean!(
869                ffi::gst_rtsp_media_prepare(self.as_ref().to_glib_none().0, thread.into_glib_ptr()),
870                "Failed to prepare media"
871            )
872        }
873    }
874
875    //#[doc(alias = "gst_rtsp_media_seek")]
876    //fn seek(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange) -> bool {
877    //    unsafe { TODO: call ffi:gst_rtsp_media_seek() }
878    //}
879
880    //#[cfg(feature = "v1_18")]
881    //#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
882    //#[doc(alias = "gst_rtsp_media_seek_full")]
883    //fn seek_full(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange, flags: /*Ignored*/gst::SeekFlags) -> bool {
884    //    unsafe { TODO: call ffi:gst_rtsp_media_seek_full() }
885    //}
886
887    //#[cfg(feature = "v1_18")]
888    //#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
889    //#[doc(alias = "gst_rtsp_media_seek_trickmode")]
890    //fn seek_trickmode(&self, range: /*Ignored*/&mut gst_rtsp::RTSPTimeRange, flags: /*Ignored*/gst::SeekFlags, rate: f64, trickmode_interval: impl Into<Option<gst::ClockTime>>) -> bool {
891    //    unsafe { TODO: call ffi:gst_rtsp_media_seek_trickmode() }
892    //}
893
894    //#[doc(alias = "gst_rtsp_media_seekable")]
895    //fn seekable(&self) -> /*Ignored*/gst::ClockTimeDiff {
896    //    unsafe { TODO: call ffi:gst_rtsp_media_seekable() }
897    //}
898
899    /// configure `pool` to be used as the address pool of `self`.
900    /// ## `pool`
901    /// a [`RTSPAddressPool`][crate::RTSPAddressPool]
902    #[doc(alias = "gst_rtsp_media_set_address_pool")]
903    fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) {
904        unsafe {
905            ffi::gst_rtsp_media_set_address_pool(
906                self.as_ref().to_glib_none().0,
907                pool.map(|p| p.as_ref()).to_glib_none().0,
908            );
909        }
910    }
911
912    /// Decide whether the multicast socket should be bound to a multicast address or
913    /// INADDR_ANY.
914    /// ## `bind_mcast_addr`
915    /// the new value
916    #[cfg(feature = "v1_16")]
917    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
918    #[doc(alias = "gst_rtsp_media_set_bind_mcast_address")]
919    #[doc(alias = "bind-mcast-address")]
920    fn set_bind_mcast_address(&self, bind_mcast_addr: bool) {
921        unsafe {
922            ffi::gst_rtsp_media_set_bind_mcast_address(
923                self.as_ref().to_glib_none().0,
924                bind_mcast_addr.into_glib(),
925            );
926        }
927    }
928
929    /// Set the kernel UDP buffer size.
930    /// ## `size`
931    /// the new value
932    #[doc(alias = "gst_rtsp_media_set_buffer_size")]
933    #[doc(alias = "buffer-size")]
934    fn set_buffer_size(&self, size: u32) {
935        unsafe {
936            ffi::gst_rtsp_media_set_buffer_size(self.as_ref().to_glib_none().0, size);
937        }
938    }
939
940    /// Configure the clock used for the media.
941    /// ## `clock`
942    /// [`gst::Clock`][crate::gst::Clock] to be used
943    #[doc(alias = "gst_rtsp_media_set_clock")]
944    #[doc(alias = "clock")]
945    fn set_clock(&self, clock: Option<&impl IsA<gst::Clock>>) {
946        unsafe {
947            ffi::gst_rtsp_media_set_clock(
948                self.as_ref().to_glib_none().0,
949                clock.map(|p| p.as_ref()).to_glib_none().0,
950            );
951        }
952    }
953
954    /// Set whether retransmission requests will be sent
955    #[cfg(feature = "v1_16")]
956    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
957    #[doc(alias = "gst_rtsp_media_set_do_retransmission")]
958    fn set_do_retransmission(&self, do_retransmission: bool) {
959        unsafe {
960            ffi::gst_rtsp_media_set_do_retransmission(
961                self.as_ref().to_glib_none().0,
962                do_retransmission.into_glib(),
963            );
964        }
965    }
966
967    /// Configure the dscp qos of attached streams to `dscp_qos`.
968    /// ## `dscp_qos`
969    /// a new dscp qos value (0-63, or -1 to disable)
970    #[cfg(feature = "v1_18")]
971    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
972    #[doc(alias = "gst_rtsp_media_set_dscp_qos")]
973    #[doc(alias = "dscp-qos")]
974    fn set_dscp_qos(&self, dscp_qos: i32) {
975        unsafe {
976            ffi::gst_rtsp_media_set_dscp_qos(self.as_ref().to_glib_none().0, dscp_qos);
977        }
978    }
979
980    /// Set whether or not a keyunit should be ensured when a client connects. It
981    /// will also configure the streams to drop delta units to ensure that they start
982    /// on a keyunit.
983    ///
984    /// Note that this will only affect non-shared medias for now.
985    /// ## `ensure_keyunit_on_start`
986    /// the new value
987    #[cfg(feature = "v1_24")]
988    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
989    #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start")]
990    #[doc(alias = "ensure-keyunit-on-start")]
991    fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) {
992        unsafe {
993            ffi::gst_rtsp_media_set_ensure_keyunit_on_start(
994                self.as_ref().to_glib_none().0,
995                ensure_keyunit_on_start.into_glib(),
996            );
997        }
998    }
999
1000    /// Sets the maximum allowed time before the first keyunit is considered
1001    /// expired.
1002    ///
1003    /// Note that this will only have an effect when ensure-keyunit-on-start is
1004    /// enabled.
1005    /// ## `timeout`
1006    /// the new value
1007    #[cfg(feature = "v1_24")]
1008    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1009    #[doc(alias = "gst_rtsp_media_set_ensure_keyunit_on_start_timeout")]
1010    #[doc(alias = "ensure-keyunit-on-start-timeout")]
1011    fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) {
1012        unsafe {
1013            ffi::gst_rtsp_media_set_ensure_keyunit_on_start_timeout(
1014                self.as_ref().to_glib_none().0,
1015                timeout,
1016            );
1017        }
1018    }
1019
1020    /// Set or unset if an EOS event will be sent to the pipeline for `self` before
1021    /// it is unprepared.
1022    /// ## `eos_shutdown`
1023    /// the new value
1024    #[doc(alias = "gst_rtsp_media_set_eos_shutdown")]
1025    #[doc(alias = "eos-shutdown")]
1026    fn set_eos_shutdown(&self, eos_shutdown: bool) {
1027        unsafe {
1028            ffi::gst_rtsp_media_set_eos_shutdown(
1029                self.as_ref().to_glib_none().0,
1030                eos_shutdown.into_glib(),
1031            );
1032        }
1033    }
1034
1035    /// Configure the latency used for receiving media.
1036    /// ## `latency`
1037    /// latency in milliseconds
1038    #[doc(alias = "gst_rtsp_media_set_latency")]
1039    #[doc(alias = "latency")]
1040    fn set_latency(&self, latency: u32) {
1041        unsafe {
1042            ffi::gst_rtsp_media_set_latency(self.as_ref().to_glib_none().0, latency);
1043        }
1044    }
1045
1046    /// Set the maximum time-to-live value of outgoing multicast packets.
1047    /// ## `ttl`
1048    /// the new multicast ttl value
1049    ///
1050    /// # Returns
1051    ///
1052    /// [`true`] if the requested ttl has been set successfully.
1053    #[cfg(feature = "v1_16")]
1054    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1055    #[doc(alias = "gst_rtsp_media_set_max_mcast_ttl")]
1056    #[doc(alias = "max-mcast-ttl")]
1057    fn set_max_mcast_ttl(&self, ttl: u32) -> bool {
1058        unsafe {
1059            from_glib(ffi::gst_rtsp_media_set_max_mcast_ttl(
1060                self.as_ref().to_glib_none().0,
1061                ttl,
1062            ))
1063        }
1064    }
1065
1066    /// configure `multicast_iface` to be used for `self`.
1067    /// ## `multicast_iface`
1068    /// a multicast interface name
1069    #[doc(alias = "gst_rtsp_media_set_multicast_iface")]
1070    fn set_multicast_iface(&self, multicast_iface: Option<&str>) {
1071        unsafe {
1072            ffi::gst_rtsp_media_set_multicast_iface(
1073                self.as_ref().to_glib_none().0,
1074                multicast_iface.to_glib_none().0,
1075            );
1076        }
1077    }
1078
1079    //#[doc(alias = "gst_rtsp_media_set_permissions")]
1080    //fn set_permissions(&self, permissions: /*Ignored*/Option<&mut RTSPPermissions>) {
1081    //    unsafe { TODO: call ffi:gst_rtsp_media_set_permissions() }
1082    //}
1083
1084    /// Set the state of the pipeline managed by `self` to `state`
1085    /// ## `state`
1086    /// the target state of the pipeline
1087    #[doc(alias = "gst_rtsp_media_set_pipeline_state")]
1088    fn set_pipeline_state(&self, state: gst::State) {
1089        unsafe {
1090            ffi::gst_rtsp_media_set_pipeline_state(
1091                self.as_ref().to_glib_none().0,
1092                state.into_glib(),
1093            );
1094        }
1095    }
1096
1097    /// Configure the allowed lower transport for `self`.
1098    /// ## `profiles`
1099    /// the new flags
1100    #[doc(alias = "gst_rtsp_media_set_profiles")]
1101    #[doc(alias = "profiles")]
1102    fn set_profiles(&self, profiles: gst_rtsp::RTSPProfile) {
1103        unsafe {
1104            ffi::gst_rtsp_media_set_profiles(self.as_ref().to_glib_none().0, profiles.into_glib());
1105        }
1106    }
1107
1108    /// Configure the allowed lower transport for `self`.
1109    /// ## `protocols`
1110    /// the new flags
1111    #[doc(alias = "gst_rtsp_media_set_protocols")]
1112    #[doc(alias = "protocols")]
1113    fn set_protocols(&self, protocols: gst_rtsp::RTSPLowerTrans) {
1114        unsafe {
1115            ffi::gst_rtsp_media_set_protocols(
1116                self.as_ref().to_glib_none().0,
1117                protocols.into_glib(),
1118            );
1119        }
1120    }
1121
1122    /// Sets if and how the media clock should be published according to RFC7273.
1123    /// ## `mode`
1124    /// the clock publish mode
1125    #[doc(alias = "gst_rtsp_media_set_publish_clock_mode")]
1126    fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) {
1127        unsafe {
1128            ffi::gst_rtsp_media_set_publish_clock_mode(
1129                self.as_ref().to_glib_none().0,
1130                mode.into_glib(),
1131            );
1132        }
1133    }
1134
1135    /// Define whether `self` will follow the Rate-Control=no behaviour as specified
1136    /// in the ONVIF replay spec.
1137    #[cfg(feature = "v1_18")]
1138    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1139    #[doc(alias = "gst_rtsp_media_set_rate_control")]
1140    fn set_rate_control(&self, enabled: bool) {
1141        unsafe {
1142            ffi::gst_rtsp_media_set_rate_control(
1143                self.as_ref().to_glib_none().0,
1144                enabled.into_glib(),
1145            );
1146        }
1147    }
1148
1149    /// Set the amount of time to store retransmission packets.
1150    /// ## `time`
1151    /// the new value
1152    #[doc(alias = "gst_rtsp_media_set_retransmission_time")]
1153    fn set_retransmission_time(&self, time: impl Into<Option<gst::ClockTime>>) {
1154        unsafe {
1155            ffi::gst_rtsp_media_set_retransmission_time(
1156                self.as_ref().to_glib_none().0,
1157                time.into().into_glib(),
1158            );
1159        }
1160    }
1161
1162    /// Set or unset if the pipeline for `self` can be reused after the pipeline has
1163    /// been unprepared.
1164    /// ## `reusable`
1165    /// the new value
1166    #[doc(alias = "gst_rtsp_media_set_reusable")]
1167    #[doc(alias = "reusable")]
1168    fn set_reusable(&self, reusable: bool) {
1169        unsafe {
1170            ffi::gst_rtsp_media_set_reusable(self.as_ref().to_glib_none().0, reusable.into_glib());
1171        }
1172    }
1173
1174    /// Set or unset if the pipeline for `self` can be shared will multiple clients.
1175    /// When `shared` is [`true`], client requests for this media will share the media
1176    /// pipeline.
1177    /// ## `shared`
1178    /// the new value
1179    #[doc(alias = "gst_rtsp_media_set_shared")]
1180    #[doc(alias = "shared")]
1181    fn set_shared(&self, shared: bool) {
1182        unsafe {
1183            ffi::gst_rtsp_media_set_shared(self.as_ref().to_glib_none().0, shared.into_glib());
1184        }
1185    }
1186
1187    /// Set the state of `self` to `state` and for the transports in `transports`.
1188    ///
1189    /// `self` must be prepared with [`prepare()`][Self::prepare()];
1190    /// ## `state`
1191    /// the target state of the media
1192    /// ## `transports`
1193    ///
1194    /// a `GPtrArray` of [`RTSPStreamTransport`][crate::RTSPStreamTransport] pointers
1195    ///
1196    /// # Returns
1197    ///
1198    /// [`true`] on success.
1199    #[doc(alias = "gst_rtsp_media_set_state")]
1200    fn set_state(&self, state: gst::State, transports: &[RTSPStreamTransport]) -> bool {
1201        unsafe {
1202            from_glib(ffi::gst_rtsp_media_set_state(
1203                self.as_ref().to_glib_none().0,
1204                state.into_glib(),
1205                transports.to_glib_none().0,
1206            ))
1207        }
1208    }
1209
1210    /// Set or unset if the pipeline for `self` should be stopped when a
1211    /// client disconnects without sending TEARDOWN.
1212    /// ## `stop_on_disconnect`
1213    /// the new value
1214    #[doc(alias = "gst_rtsp_media_set_stop_on_disconnect")]
1215    #[doc(alias = "stop-on-disconnect")]
1216    fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) {
1217        unsafe {
1218            ffi::gst_rtsp_media_set_stop_on_disconnect(
1219                self.as_ref().to_glib_none().0,
1220                stop_on_disconnect.into_glib(),
1221            );
1222        }
1223    }
1224
1225    /// Control how @ media will be suspended after the SDP has been generated and
1226    /// after a PAUSE request has been performed.
1227    ///
1228    /// Media must be unprepared when setting the suspend mode.
1229    /// ## `mode`
1230    /// the new [`RTSPSuspendMode`][crate::RTSPSuspendMode]
1231    #[doc(alias = "gst_rtsp_media_set_suspend_mode")]
1232    #[doc(alias = "suspend-mode")]
1233    fn set_suspend_mode(&self, mode: RTSPSuspendMode) {
1234        unsafe {
1235            ffi::gst_rtsp_media_set_suspend_mode(self.as_ref().to_glib_none().0, mode.into_glib());
1236        }
1237    }
1238
1239    /// Sets if the media pipeline can work in PLAY or RECORD mode
1240    /// ## `mode`
1241    /// the new value
1242    #[doc(alias = "gst_rtsp_media_set_transport_mode")]
1243    #[doc(alias = "transport-mode")]
1244    fn set_transport_mode(&self, mode: RTSPTransportMode) {
1245        unsafe {
1246            ffi::gst_rtsp_media_set_transport_mode(
1247                self.as_ref().to_glib_none().0,
1248                mode.into_glib(),
1249            );
1250        }
1251    }
1252
1253    //#[doc(alias = "gst_rtsp_media_setup_sdp")]
1254    //fn setup_sdp(&self, sdp: /*Ignored*/&mut gst_sdp::SDPMessage, info: /*Ignored*/&mut SDPInfo) -> bool {
1255    //    unsafe { TODO: call ffi:gst_rtsp_media_setup_sdp() }
1256    //}
1257
1258    /// Suspend `self`. The state of the pipeline managed by `self` is set to
1259    /// GST_STATE_NULL but all streams are kept. `self` can be prepared again
1260    /// with [`unsuspend()`][Self::unsuspend()]
1261    ///
1262    /// `self` must be prepared with [`prepare()`][Self::prepare()];
1263    ///
1264    /// # Returns
1265    ///
1266    /// [`true`] on success.
1267    #[doc(alias = "gst_rtsp_media_suspend")]
1268    fn suspend(&self) -> Result<(), glib::error::BoolError> {
1269        unsafe {
1270            glib::result_from_gboolean!(
1271                ffi::gst_rtsp_media_suspend(self.as_ref().to_glib_none().0),
1272                "Failed to suspend media"
1273            )
1274        }
1275    }
1276
1277    /// Unlock the media.
1278    #[cfg(feature = "v1_18")]
1279    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1280    #[doc(alias = "gst_rtsp_media_unlock")]
1281    fn unlock(&self) {
1282        unsafe {
1283            ffi::gst_rtsp_media_unlock(self.as_ref().to_glib_none().0);
1284        }
1285    }
1286
1287    /// Unprepare `self`. After this call, the media should be prepared again before
1288    /// it can be used again. If the media is set to be non-reusable, a new instance
1289    /// must be created.
1290    ///
1291    /// # Returns
1292    ///
1293    /// [`true`] on success.
1294    #[doc(alias = "gst_rtsp_media_unprepare")]
1295    fn unprepare(&self) -> Result<(), glib::error::BoolError> {
1296        unsafe {
1297            glib::result_from_gboolean!(
1298                ffi::gst_rtsp_media_unprepare(self.as_ref().to_glib_none().0),
1299                "Failed to unprepare media"
1300            )
1301        }
1302    }
1303
1304    /// Unsuspend `self` if it was in a suspended state. This method does nothing
1305    /// when the media was not in the suspended state.
1306    ///
1307    /// # Returns
1308    ///
1309    /// [`true`] on success.
1310    #[doc(alias = "gst_rtsp_media_unsuspend")]
1311    fn unsuspend(&self) -> Result<(), glib::error::BoolError> {
1312        unsafe {
1313            glib::result_from_gboolean!(
1314                ffi::gst_rtsp_media_unsuspend(self.as_ref().to_glib_none().0),
1315                "Failed to unsuspend media"
1316            )
1317        }
1318    }
1319
1320    /// Set `self` to provide a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider].
1321    /// ## `time_provider`
1322    /// if a [`gst_net::NetTimeProvider`][crate::gst_net::NetTimeProvider] should be used
1323    #[doc(alias = "gst_rtsp_media_use_time_provider")]
1324    fn use_time_provider(&self, time_provider: bool) {
1325        unsafe {
1326            ffi::gst_rtsp_media_use_time_provider(
1327                self.as_ref().to_glib_none().0,
1328                time_provider.into_glib(),
1329            );
1330        }
1331    }
1332
1333    #[cfg(not(feature = "v1_16"))]
1334    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1335    #[doc(alias = "bind-mcast-address")]
1336    fn is_bind_mcast_address(&self) -> bool {
1337        ObjectExt::property(self.as_ref(), "bind-mcast-address")
1338    }
1339
1340    #[cfg(not(feature = "v1_16"))]
1341    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1342    #[doc(alias = "bind-mcast-address")]
1343    fn set_bind_mcast_address(&self, bind_mcast_address: bool) {
1344        ObjectExt::set_property(self.as_ref(), "bind-mcast-address", bind_mcast_address)
1345    }
1346
1347    #[cfg(not(feature = "v1_18"))]
1348    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1349    #[doc(alias = "dscp-qos")]
1350    fn dscp_qos(&self) -> i32 {
1351        ObjectExt::property(self.as_ref(), "dscp-qos")
1352    }
1353
1354    #[cfg(not(feature = "v1_18"))]
1355    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_18"))))]
1356    #[doc(alias = "dscp-qos")]
1357    fn set_dscp_qos(&self, dscp_qos: i32) {
1358        ObjectExt::set_property(self.as_ref(), "dscp-qos", dscp_qos)
1359    }
1360
1361    #[cfg(not(feature = "v1_16"))]
1362    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1363    #[doc(alias = "max-mcast-ttl")]
1364    fn max_mcast_ttl(&self) -> u32 {
1365        ObjectExt::property(self.as_ref(), "max-mcast-ttl")
1366    }
1367
1368    #[cfg(not(feature = "v1_16"))]
1369    #[cfg_attr(docsrs, doc(cfg(not(feature = "v1_16"))))]
1370    #[doc(alias = "max-mcast-ttl")]
1371    fn set_max_mcast_ttl(&self, max_mcast_ttl: u32) {
1372        ObjectExt::set_property(self.as_ref(), "max-mcast-ttl", max_mcast_ttl)
1373    }
1374
1375    #[doc(alias = "time-provider")]
1376    fn set_time_provider(&self, time_provider: bool) {
1377        ObjectExt::set_property(self.as_ref(), "time-provider", time_provider)
1378    }
1379
1380    /// Will be emitted when a message appears on the pipeline bus.
1381    /// ## `message`
1382    /// a [`gst::Message`][crate::gst::Message]
1383    ///
1384    /// # Returns
1385    ///
1386    /// a `gboolean` indicating if the call was successful or not.
1387    #[cfg(feature = "v1_22")]
1388    #[cfg_attr(docsrs, doc(cfg(feature = "v1_22")))]
1389    #[doc(alias = "handle-message")]
1390    fn connect_handle_message<F: Fn(&Self, &gst::Message) -> bool + Send + Sync + 'static>(
1391        &self,
1392        detail: Option<&str>,
1393        f: F,
1394    ) -> SignalHandlerId {
1395        unsafe extern "C" fn handle_message_trampoline<
1396            P: IsA<RTSPMedia>,
1397            F: Fn(&P, &gst::Message) -> bool + Send + Sync + 'static,
1398        >(
1399            this: *mut ffi::GstRTSPMedia,
1400            message: *mut gst::ffi::GstMessage,
1401            f: glib::ffi::gpointer,
1402        ) -> glib::ffi::gboolean {
1403            let f: &F = &*(f as *const F);
1404            f(
1405                RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1406                &from_glib_borrow(message),
1407            )
1408            .into_glib()
1409        }
1410        unsafe {
1411            let f: Box_<F> = Box_::new(f);
1412            let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
1413            let signal_name: &[u8] = detailed_signal_name
1414                .as_ref()
1415                .map_or(&b"handle-message\0"[..], |n| n.as_bytes());
1416            connect_raw(
1417                self.as_ptr() as *mut _,
1418                signal_name.as_ptr() as *const _,
1419                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1420                    handle_message_trampoline::<Self, F> as *const (),
1421                )),
1422                Box_::into_raw(f),
1423            )
1424        }
1425    }
1426
1427    #[doc(alias = "new-state")]
1428    fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1429        &self,
1430        f: F,
1431    ) -> SignalHandlerId {
1432        unsafe extern "C" fn new_state_trampoline<
1433            P: IsA<RTSPMedia>,
1434            F: Fn(&P, i32) + Send + Sync + 'static,
1435        >(
1436            this: *mut ffi::GstRTSPMedia,
1437            object: std::ffi::c_int,
1438            f: glib::ffi::gpointer,
1439        ) {
1440            let f: &F = &*(f as *const F);
1441            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1442        }
1443        unsafe {
1444            let f: Box_<F> = Box_::new(f);
1445            connect_raw(
1446                self.as_ptr() as *mut _,
1447                b"new-state\0".as_ptr() as *const _,
1448                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1449                    new_state_trampoline::<Self, F> as *const (),
1450                )),
1451                Box_::into_raw(f),
1452            )
1453        }
1454    }
1455
1456    #[doc(alias = "new-stream")]
1457    fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1458        &self,
1459        f: F,
1460    ) -> SignalHandlerId {
1461        unsafe extern "C" fn new_stream_trampoline<
1462            P: IsA<RTSPMedia>,
1463            F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1464        >(
1465            this: *mut ffi::GstRTSPMedia,
1466            object: *mut ffi::GstRTSPStream,
1467            f: glib::ffi::gpointer,
1468        ) {
1469            let f: &F = &*(f as *const F);
1470            f(
1471                RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1472                &from_glib_borrow(object),
1473            )
1474        }
1475        unsafe {
1476            let f: Box_<F> = Box_::new(f);
1477            connect_raw(
1478                self.as_ptr() as *mut _,
1479                b"new-stream\0".as_ptr() as *const _,
1480                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1481                    new_stream_trampoline::<Self, F> as *const (),
1482                )),
1483                Box_::into_raw(f),
1484            )
1485        }
1486    }
1487
1488    #[doc(alias = "prepared")]
1489    fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1490        unsafe extern "C" fn prepared_trampoline<
1491            P: IsA<RTSPMedia>,
1492            F: Fn(&P) + Send + Sync + 'static,
1493        >(
1494            this: *mut ffi::GstRTSPMedia,
1495            f: glib::ffi::gpointer,
1496        ) {
1497            let f: &F = &*(f as *const F);
1498            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1499        }
1500        unsafe {
1501            let f: Box_<F> = Box_::new(f);
1502            connect_raw(
1503                self.as_ptr() as *mut _,
1504                b"prepared\0".as_ptr() as *const _,
1505                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1506                    prepared_trampoline::<Self, F> as *const (),
1507                )),
1508                Box_::into_raw(f),
1509            )
1510        }
1511    }
1512
1513    #[doc(alias = "removed-stream")]
1514    fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1515        &self,
1516        f: F,
1517    ) -> SignalHandlerId {
1518        unsafe extern "C" fn removed_stream_trampoline<
1519            P: IsA<RTSPMedia>,
1520            F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1521        >(
1522            this: *mut ffi::GstRTSPMedia,
1523            object: *mut ffi::GstRTSPStream,
1524            f: glib::ffi::gpointer,
1525        ) {
1526            let f: &F = &*(f as *const F);
1527            f(
1528                RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1529                &from_glib_borrow(object),
1530            )
1531        }
1532        unsafe {
1533            let f: Box_<F> = Box_::new(f);
1534            connect_raw(
1535                self.as_ptr() as *mut _,
1536                b"removed-stream\0".as_ptr() as *const _,
1537                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1538                    removed_stream_trampoline::<Self, F> as *const (),
1539                )),
1540                Box_::into_raw(f),
1541            )
1542        }
1543    }
1544
1545    #[doc(alias = "target-state")]
1546    fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1547        &self,
1548        f: F,
1549    ) -> SignalHandlerId {
1550        unsafe extern "C" fn target_state_trampoline<
1551            P: IsA<RTSPMedia>,
1552            F: Fn(&P, i32) + Send + Sync + 'static,
1553        >(
1554            this: *mut ffi::GstRTSPMedia,
1555            object: std::ffi::c_int,
1556            f: glib::ffi::gpointer,
1557        ) {
1558            let f: &F = &*(f as *const F);
1559            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1560        }
1561        unsafe {
1562            let f: Box_<F> = Box_::new(f);
1563            connect_raw(
1564                self.as_ptr() as *mut _,
1565                b"target-state\0".as_ptr() as *const _,
1566                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1567                    target_state_trampoline::<Self, F> as *const (),
1568                )),
1569                Box_::into_raw(f),
1570            )
1571        }
1572    }
1573
1574    #[doc(alias = "unprepared")]
1575    fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1576        unsafe extern "C" fn unprepared_trampoline<
1577            P: IsA<RTSPMedia>,
1578            F: Fn(&P) + Send + Sync + 'static,
1579        >(
1580            this: *mut ffi::GstRTSPMedia,
1581            f: glib::ffi::gpointer,
1582        ) {
1583            let f: &F = &*(f as *const F);
1584            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1585        }
1586        unsafe {
1587            let f: Box_<F> = Box_::new(f);
1588            connect_raw(
1589                self.as_ptr() as *mut _,
1590                b"unprepared\0".as_ptr() as *const _,
1591                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1592                    unprepared_trampoline::<Self, F> as *const (),
1593                )),
1594                Box_::into_raw(f),
1595            )
1596        }
1597    }
1598
1599    #[doc(alias = "bind-mcast-address")]
1600    fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1601        &self,
1602        f: F,
1603    ) -> SignalHandlerId {
1604        unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1605            P: IsA<RTSPMedia>,
1606            F: Fn(&P) + Send + Sync + 'static,
1607        >(
1608            this: *mut ffi::GstRTSPMedia,
1609            _param_spec: glib::ffi::gpointer,
1610            f: glib::ffi::gpointer,
1611        ) {
1612            let f: &F = &*(f as *const F);
1613            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1614        }
1615        unsafe {
1616            let f: Box_<F> = Box_::new(f);
1617            connect_raw(
1618                self.as_ptr() as *mut _,
1619                b"notify::bind-mcast-address\0".as_ptr() as *const _,
1620                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1621                    notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1622                )),
1623                Box_::into_raw(f),
1624            )
1625        }
1626    }
1627
1628    #[doc(alias = "buffer-size")]
1629    fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1630        &self,
1631        f: F,
1632    ) -> SignalHandlerId {
1633        unsafe extern "C" fn notify_buffer_size_trampoline<
1634            P: IsA<RTSPMedia>,
1635            F: Fn(&P) + Send + Sync + 'static,
1636        >(
1637            this: *mut ffi::GstRTSPMedia,
1638            _param_spec: glib::ffi::gpointer,
1639            f: glib::ffi::gpointer,
1640        ) {
1641            let f: &F = &*(f as *const F);
1642            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1643        }
1644        unsafe {
1645            let f: Box_<F> = Box_::new(f);
1646            connect_raw(
1647                self.as_ptr() as *mut _,
1648                b"notify::buffer-size\0".as_ptr() as *const _,
1649                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1650                    notify_buffer_size_trampoline::<Self, F> as *const (),
1651                )),
1652                Box_::into_raw(f),
1653            )
1654        }
1655    }
1656
1657    #[doc(alias = "clock")]
1658    fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1659        unsafe extern "C" fn notify_clock_trampoline<
1660            P: IsA<RTSPMedia>,
1661            F: Fn(&P) + Send + Sync + 'static,
1662        >(
1663            this: *mut ffi::GstRTSPMedia,
1664            _param_spec: glib::ffi::gpointer,
1665            f: glib::ffi::gpointer,
1666        ) {
1667            let f: &F = &*(f as *const F);
1668            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1669        }
1670        unsafe {
1671            let f: Box_<F> = Box_::new(f);
1672            connect_raw(
1673                self.as_ptr() as *mut _,
1674                b"notify::clock\0".as_ptr() as *const _,
1675                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1676                    notify_clock_trampoline::<Self, F> as *const (),
1677                )),
1678                Box_::into_raw(f),
1679            )
1680        }
1681    }
1682
1683    #[doc(alias = "dscp-qos")]
1684    fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1685        &self,
1686        f: F,
1687    ) -> SignalHandlerId {
1688        unsafe extern "C" fn notify_dscp_qos_trampoline<
1689            P: IsA<RTSPMedia>,
1690            F: Fn(&P) + Send + Sync + 'static,
1691        >(
1692            this: *mut ffi::GstRTSPMedia,
1693            _param_spec: glib::ffi::gpointer,
1694            f: glib::ffi::gpointer,
1695        ) {
1696            let f: &F = &*(f as *const F);
1697            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1698        }
1699        unsafe {
1700            let f: Box_<F> = Box_::new(f);
1701            connect_raw(
1702                self.as_ptr() as *mut _,
1703                b"notify::dscp-qos\0".as_ptr() as *const _,
1704                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1705                    notify_dscp_qos_trampoline::<Self, F> as *const (),
1706                )),
1707                Box_::into_raw(f),
1708            )
1709        }
1710    }
1711
1712    #[cfg(feature = "v1_24")]
1713    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1714    #[doc(alias = "ensure-keyunit-on-start")]
1715    fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1716        &self,
1717        f: F,
1718    ) -> SignalHandlerId {
1719        unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1720            P: IsA<RTSPMedia>,
1721            F: Fn(&P) + Send + Sync + 'static,
1722        >(
1723            this: *mut ffi::GstRTSPMedia,
1724            _param_spec: glib::ffi::gpointer,
1725            f: glib::ffi::gpointer,
1726        ) {
1727            let f: &F = &*(f as *const F);
1728            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1729        }
1730        unsafe {
1731            let f: Box_<F> = Box_::new(f);
1732            connect_raw(
1733                self.as_ptr() as *mut _,
1734                b"notify::ensure-keyunit-on-start\0".as_ptr() as *const _,
1735                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1736                    notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1737                )),
1738                Box_::into_raw(f),
1739            )
1740        }
1741    }
1742
1743    #[cfg(feature = "v1_24")]
1744    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1745    #[doc(alias = "ensure-keyunit-on-start-timeout")]
1746    fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1747        &self,
1748        f: F,
1749    ) -> SignalHandlerId {
1750        unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1751            P: IsA<RTSPMedia>,
1752            F: Fn(&P) + Send + Sync + 'static,
1753        >(
1754            this: *mut ffi::GstRTSPMedia,
1755            _param_spec: glib::ffi::gpointer,
1756            f: glib::ffi::gpointer,
1757        ) {
1758            let f: &F = &*(f as *const F);
1759            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1760        }
1761        unsafe {
1762            let f: Box_<F> = Box_::new(f);
1763            connect_raw(
1764                self.as_ptr() as *mut _,
1765                b"notify::ensure-keyunit-on-start-timeout\0".as_ptr() as *const _,
1766                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1767                    notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1768                )),
1769                Box_::into_raw(f),
1770            )
1771        }
1772    }
1773
1774    #[doc(alias = "eos-shutdown")]
1775    fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1776        &self,
1777        f: F,
1778    ) -> SignalHandlerId {
1779        unsafe extern "C" fn notify_eos_shutdown_trampoline<
1780            P: IsA<RTSPMedia>,
1781            F: Fn(&P) + Send + Sync + 'static,
1782        >(
1783            this: *mut ffi::GstRTSPMedia,
1784            _param_spec: glib::ffi::gpointer,
1785            f: glib::ffi::gpointer,
1786        ) {
1787            let f: &F = &*(f as *const F);
1788            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1789        }
1790        unsafe {
1791            let f: Box_<F> = Box_::new(f);
1792            connect_raw(
1793                self.as_ptr() as *mut _,
1794                b"notify::eos-shutdown\0".as_ptr() as *const _,
1795                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1796                    notify_eos_shutdown_trampoline::<Self, F> as *const (),
1797                )),
1798                Box_::into_raw(f),
1799            )
1800        }
1801    }
1802
1803    #[doc(alias = "latency")]
1804    fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1805        &self,
1806        f: F,
1807    ) -> SignalHandlerId {
1808        unsafe extern "C" fn notify_latency_trampoline<
1809            P: IsA<RTSPMedia>,
1810            F: Fn(&P) + Send + Sync + 'static,
1811        >(
1812            this: *mut ffi::GstRTSPMedia,
1813            _param_spec: glib::ffi::gpointer,
1814            f: glib::ffi::gpointer,
1815        ) {
1816            let f: &F = &*(f as *const F);
1817            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1818        }
1819        unsafe {
1820            let f: Box_<F> = Box_::new(f);
1821            connect_raw(
1822                self.as_ptr() as *mut _,
1823                b"notify::latency\0".as_ptr() as *const _,
1824                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1825                    notify_latency_trampoline::<Self, F> as *const (),
1826                )),
1827                Box_::into_raw(f),
1828            )
1829        }
1830    }
1831
1832    #[doc(alias = "max-mcast-ttl")]
1833    fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1834        &self,
1835        f: F,
1836    ) -> SignalHandlerId {
1837        unsafe extern "C" fn notify_max_mcast_ttl_trampoline<
1838            P: IsA<RTSPMedia>,
1839            F: Fn(&P) + Send + Sync + 'static,
1840        >(
1841            this: *mut ffi::GstRTSPMedia,
1842            _param_spec: glib::ffi::gpointer,
1843            f: glib::ffi::gpointer,
1844        ) {
1845            let f: &F = &*(f as *const F);
1846            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1847        }
1848        unsafe {
1849            let f: Box_<F> = Box_::new(f);
1850            connect_raw(
1851                self.as_ptr() as *mut _,
1852                b"notify::max-mcast-ttl\0".as_ptr() as *const _,
1853                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1854                    notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1855                )),
1856                Box_::into_raw(f),
1857            )
1858        }
1859    }
1860
1861    #[doc(alias = "profiles")]
1862    fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1863        &self,
1864        f: F,
1865    ) -> SignalHandlerId {
1866        unsafe extern "C" fn notify_profiles_trampoline<
1867            P: IsA<RTSPMedia>,
1868            F: Fn(&P) + Send + Sync + 'static,
1869        >(
1870            this: *mut ffi::GstRTSPMedia,
1871            _param_spec: glib::ffi::gpointer,
1872            f: glib::ffi::gpointer,
1873        ) {
1874            let f: &F = &*(f as *const F);
1875            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1876        }
1877        unsafe {
1878            let f: Box_<F> = Box_::new(f);
1879            connect_raw(
1880                self.as_ptr() as *mut _,
1881                b"notify::profiles\0".as_ptr() as *const _,
1882                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1883                    notify_profiles_trampoline::<Self, F> as *const (),
1884                )),
1885                Box_::into_raw(f),
1886            )
1887        }
1888    }
1889
1890    #[doc(alias = "protocols")]
1891    fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1892        &self,
1893        f: F,
1894    ) -> SignalHandlerId {
1895        unsafe extern "C" fn notify_protocols_trampoline<
1896            P: IsA<RTSPMedia>,
1897            F: Fn(&P) + Send + Sync + 'static,
1898        >(
1899            this: *mut ffi::GstRTSPMedia,
1900            _param_spec: glib::ffi::gpointer,
1901            f: glib::ffi::gpointer,
1902        ) {
1903            let f: &F = &*(f as *const F);
1904            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1905        }
1906        unsafe {
1907            let f: Box_<F> = Box_::new(f);
1908            connect_raw(
1909                self.as_ptr() as *mut _,
1910                b"notify::protocols\0".as_ptr() as *const _,
1911                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1912                    notify_protocols_trampoline::<Self, F> as *const (),
1913                )),
1914                Box_::into_raw(f),
1915            )
1916        }
1917    }
1918
1919    #[doc(alias = "reusable")]
1920    fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1921        &self,
1922        f: F,
1923    ) -> SignalHandlerId {
1924        unsafe extern "C" fn notify_reusable_trampoline<
1925            P: IsA<RTSPMedia>,
1926            F: Fn(&P) + Send + Sync + 'static,
1927        >(
1928            this: *mut ffi::GstRTSPMedia,
1929            _param_spec: glib::ffi::gpointer,
1930            f: glib::ffi::gpointer,
1931        ) {
1932            let f: &F = &*(f as *const F);
1933            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1934        }
1935        unsafe {
1936            let f: Box_<F> = Box_::new(f);
1937            connect_raw(
1938                self.as_ptr() as *mut _,
1939                b"notify::reusable\0".as_ptr() as *const _,
1940                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1941                    notify_reusable_trampoline::<Self, F> as *const (),
1942                )),
1943                Box_::into_raw(f),
1944            )
1945        }
1946    }
1947
1948    #[doc(alias = "shared")]
1949    fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1950        unsafe extern "C" fn notify_shared_trampoline<
1951            P: IsA<RTSPMedia>,
1952            F: Fn(&P) + Send + Sync + 'static,
1953        >(
1954            this: *mut ffi::GstRTSPMedia,
1955            _param_spec: glib::ffi::gpointer,
1956            f: glib::ffi::gpointer,
1957        ) {
1958            let f: &F = &*(f as *const F);
1959            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1960        }
1961        unsafe {
1962            let f: Box_<F> = Box_::new(f);
1963            connect_raw(
1964                self.as_ptr() as *mut _,
1965                b"notify::shared\0".as_ptr() as *const _,
1966                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1967                    notify_shared_trampoline::<Self, F> as *const (),
1968                )),
1969                Box_::into_raw(f),
1970            )
1971        }
1972    }
1973
1974    #[doc(alias = "stop-on-disconnect")]
1975    fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1976        &self,
1977        f: F,
1978    ) -> SignalHandlerId {
1979        unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1980            P: IsA<RTSPMedia>,
1981            F: Fn(&P) + Send + Sync + 'static,
1982        >(
1983            this: *mut ffi::GstRTSPMedia,
1984            _param_spec: glib::ffi::gpointer,
1985            f: glib::ffi::gpointer,
1986        ) {
1987            let f: &F = &*(f as *const F);
1988            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1989        }
1990        unsafe {
1991            let f: Box_<F> = Box_::new(f);
1992            connect_raw(
1993                self.as_ptr() as *mut _,
1994                b"notify::stop-on-disconnect\0".as_ptr() as *const _,
1995                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1996                    notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1997                )),
1998                Box_::into_raw(f),
1999            )
2000        }
2001    }
2002
2003    #[doc(alias = "suspend-mode")]
2004    fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2005        &self,
2006        f: F,
2007    ) -> SignalHandlerId {
2008        unsafe extern "C" fn notify_suspend_mode_trampoline<
2009            P: IsA<RTSPMedia>,
2010            F: Fn(&P) + Send + Sync + 'static,
2011        >(
2012            this: *mut ffi::GstRTSPMedia,
2013            _param_spec: glib::ffi::gpointer,
2014            f: glib::ffi::gpointer,
2015        ) {
2016            let f: &F = &*(f as *const F);
2017            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2018        }
2019        unsafe {
2020            let f: Box_<F> = Box_::new(f);
2021            connect_raw(
2022                self.as_ptr() as *mut _,
2023                b"notify::suspend-mode\0".as_ptr() as *const _,
2024                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2025                    notify_suspend_mode_trampoline::<Self, F> as *const (),
2026                )),
2027                Box_::into_raw(f),
2028            )
2029        }
2030    }
2031
2032    #[doc(alias = "time-provider")]
2033    fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
2034        &self,
2035        f: F,
2036    ) -> SignalHandlerId {
2037        unsafe extern "C" fn notify_time_provider_trampoline<
2038            P: IsA<RTSPMedia>,
2039            F: Fn(&P) + Send + Sync + 'static,
2040        >(
2041            this: *mut ffi::GstRTSPMedia,
2042            _param_spec: glib::ffi::gpointer,
2043            f: glib::ffi::gpointer,
2044        ) {
2045            let f: &F = &*(f as *const F);
2046            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2047        }
2048        unsafe {
2049            let f: Box_<F> = Box_::new(f);
2050            connect_raw(
2051                self.as_ptr() as *mut _,
2052                b"notify::time-provider\0".as_ptr() as *const _,
2053                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2054                    notify_time_provider_trampoline::<Self, F> as *const (),
2055                )),
2056                Box_::into_raw(f),
2057            )
2058        }
2059    }
2060
2061    #[doc(alias = "transport-mode")]
2062    fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2063        &self,
2064        f: F,
2065    ) -> SignalHandlerId {
2066        unsafe extern "C" fn notify_transport_mode_trampoline<
2067            P: IsA<RTSPMedia>,
2068            F: Fn(&P) + Send + Sync + 'static,
2069        >(
2070            this: *mut ffi::GstRTSPMedia,
2071            _param_spec: glib::ffi::gpointer,
2072            f: glib::ffi::gpointer,
2073        ) {
2074            let f: &F = &*(f as *const F);
2075            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2076        }
2077        unsafe {
2078            let f: Box_<F> = Box_::new(f);
2079            connect_raw(
2080                self.as_ptr() as *mut _,
2081                b"notify::transport-mode\0".as_ptr() as *const _,
2082                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2083                    notify_transport_mode_trampoline::<Self, F> as *const (),
2084                )),
2085                Box_::into_raw(f),
2086            )
2087        }
2088    }
2089}
2090
2091impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}