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