Skip to main content

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