gstreamer_rtsp_server/auto/
rtsp_media.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{
7    ffi, RTSPAddressPool, RTSPMediaStatus, RTSPPublishClockMode, RTSPStream, RTSPStreamTransport,
8    RTSPSuspendMode, RTSPThread, RTSPTransportMode,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{connect_raw, SignalHandlerId},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// A class that contains the GStreamer element along with a list of
20    /// [`RTSPStream`][crate::RTSPStream] objects that can produce data.
21    ///
22    /// This object is usually created from a [`RTSPMediaFactory`][crate::RTSPMediaFactory].
23    ///
24    /// ## Properties
25    ///
26    ///
27    /// #### `bind-mcast-address`
28    ///  Readable | Writeable
29    ///
30    ///
31    /// #### `buffer-size`
32    ///  Readable | Writeable
33    ///
34    ///
35    /// #### `clock`
36    ///  Readable | Writeable
37    ///
38    ///
39    /// #### `dscp-qos`
40    ///  Readable | Writeable
41    ///
42    ///
43    /// #### `element`
44    ///  Readable | Writeable | Construct Only
45    ///
46    ///
47    /// #### `ensure-keyunit-on-start`
48    ///  Whether or not a keyunit should be ensured when a client connects. It
49    /// will also configure the streams to drop delta units to ensure that they start
50    /// on a keyunit.
51    ///
52    /// Note that this will only affect non-shared medias for now.
53    ///
54    /// Readable | Writeable
55    ///
56    ///
57    /// #### `ensure-keyunit-on-start-timeout`
58    ///  The maximum allowed time before the first keyunit is considered
59    /// expired.
60    ///
61    /// Note that this will only have an effect when ensure-keyunit-on-start is
62    /// enabled.
63    ///
64    /// Readable | Writeable
65    ///
66    ///
67    /// #### `eos-shutdown`
68    ///  Readable | Writeable
69    ///
70    ///
71    /// #### `latency`
72    ///  Readable | Writeable
73    ///
74    ///
75    /// #### `max-mcast-ttl`
76    ///  Readable | Writeable
77    ///
78    ///
79    /// #### `profiles`
80    ///  Readable | Writeable
81    ///
82    ///
83    /// #### `protocols`
84    ///  Readable | Writeable
85    ///
86    ///
87    /// #### `reusable`
88    ///  Readable | Writeable
89    ///
90    ///
91    /// #### `shared`
92    ///  Readable | Writeable
93    ///
94    ///
95    /// #### `stop-on-disconnect`
96    ///  Readable | Writeable
97    ///
98    ///
99    /// #### `suspend-mode`
100    ///  Readable | Writeable
101    ///
102    ///
103    /// #### `time-provider`
104    ///  Readable | Writeable
105    ///
106    ///
107    /// #### `transport-mode`
108    ///  Readable | Writeable
109    ///
110    /// ## Signals
111    ///
112    ///
113    /// #### `handle-message`
114    ///  Will be emitted when a message appears on the pipeline bus.
115    ///
116    /// Detailed
117    ///
118    ///
119    /// #### `new-state`
120    ///
121    ///
122    ///
123    /// #### `new-stream`
124    ///
125    ///
126    ///
127    /// #### `prepared`
128    ///
129    ///
130    ///
131    /// #### `removed-stream`
132    ///
133    ///
134    ///
135    /// #### `target-state`
136    ///
137    ///
138    ///
139    /// #### `unprepared`
140    ///
141    ///
142    /// # Implements
143    ///
144    /// [`RTSPMediaExt`][trait@crate::prelude::RTSPMediaExt], [`trait@glib::ObjectExt`], [`RTSPMediaExtManual`][trait@crate::prelude::RTSPMediaExtManual]
145    #[doc(alias = "GstRTSPMedia")]
146    pub struct RTSPMedia(Object<ffi::GstRTSPMedia, ffi::GstRTSPMediaClass>);
147
148    match fn {
149        type_ => || ffi::gst_rtsp_media_get_type(),
150    }
151}
152
153impl RTSPMedia {
154    pub const NONE: Option<&'static RTSPMedia> = None;
155
156    /// Create a new [`RTSPMedia`][crate::RTSPMedia] instance. `element` is the bin element that
157    /// provides the different streams. The [`RTSPMedia`][crate::RTSPMedia] object contains the
158    /// element to produce RTP data for one or more related (audio/video/..)
159    /// streams.
160    ///
161    /// Ownership is taken of `element`.
162    /// ## `element`
163    /// a [`gst::Element`][crate::gst::Element]
164    ///
165    /// # Returns
166    ///
167    /// a new [`RTSPMedia`][crate::RTSPMedia] object.
168    #[doc(alias = "gst_rtsp_media_new")]
169    pub fn new(element: impl IsA<gst::Element>) -> RTSPMedia {
170        assert_initialized_main_thread!();
171        unsafe { from_glib_full(ffi::gst_rtsp_media_new(element.upcast().into_glib_ptr())) }
172    }
173}
174
175unsafe impl Send for RTSPMedia {}
176unsafe impl Sync for RTSPMedia {}
177
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            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        unsafe {
1406            let f: Box_<F> = Box_::new(f);
1407            let detailed_signal_name = detail.map(|name| format!("handle-message::{name}\0"));
1408            let signal_name: &[u8] = detailed_signal_name
1409                .as_ref()
1410                .map_or(c"handle-message".to_bytes(), |n| n.as_bytes());
1411            connect_raw(
1412                self.as_ptr() as *mut _,
1413                signal_name.as_ptr() as *const _,
1414                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1415                    handle_message_trampoline::<Self, F> as *const (),
1416                )),
1417                Box_::into_raw(f),
1418            )
1419        }
1420    }
1421
1422    #[doc(alias = "new-state")]
1423    fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1424        &self,
1425        f: F,
1426    ) -> SignalHandlerId {
1427        unsafe extern "C" fn new_state_trampoline<
1428            P: IsA<RTSPMedia>,
1429            F: Fn(&P, i32) + Send + Sync + 'static,
1430        >(
1431            this: *mut ffi::GstRTSPMedia,
1432            object: std::ffi::c_int,
1433            f: glib::ffi::gpointer,
1434        ) {
1435            let f: &F = &*(f as *const F);
1436            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1437        }
1438        unsafe {
1439            let f: Box_<F> = Box_::new(f);
1440            connect_raw(
1441                self.as_ptr() as *mut _,
1442                c"new-state".as_ptr() as *const _,
1443                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1444                    new_state_trampoline::<Self, F> as *const (),
1445                )),
1446                Box_::into_raw(f),
1447            )
1448        }
1449    }
1450
1451    #[doc(alias = "new-stream")]
1452    fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1453        &self,
1454        f: F,
1455    ) -> SignalHandlerId {
1456        unsafe extern "C" fn new_stream_trampoline<
1457            P: IsA<RTSPMedia>,
1458            F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1459        >(
1460            this: *mut ffi::GstRTSPMedia,
1461            object: *mut ffi::GstRTSPStream,
1462            f: glib::ffi::gpointer,
1463        ) {
1464            let f: &F = &*(f as *const F);
1465            f(
1466                RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1467                &from_glib_borrow(object),
1468            )
1469        }
1470        unsafe {
1471            let f: Box_<F> = Box_::new(f);
1472            connect_raw(
1473                self.as_ptr() as *mut _,
1474                c"new-stream".as_ptr() as *const _,
1475                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1476                    new_stream_trampoline::<Self, F> as *const (),
1477                )),
1478                Box_::into_raw(f),
1479            )
1480        }
1481    }
1482
1483    #[doc(alias = "prepared")]
1484    fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1485        unsafe extern "C" fn prepared_trampoline<
1486            P: IsA<RTSPMedia>,
1487            F: Fn(&P) + Send + Sync + 'static,
1488        >(
1489            this: *mut ffi::GstRTSPMedia,
1490            f: glib::ffi::gpointer,
1491        ) {
1492            let f: &F = &*(f as *const F);
1493            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1494        }
1495        unsafe {
1496            let f: Box_<F> = Box_::new(f);
1497            connect_raw(
1498                self.as_ptr() as *mut _,
1499                c"prepared".as_ptr() as *const _,
1500                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1501                    prepared_trampoline::<Self, F> as *const (),
1502                )),
1503                Box_::into_raw(f),
1504            )
1505        }
1506    }
1507
1508    #[doc(alias = "removed-stream")]
1509    fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
1510        &self,
1511        f: F,
1512    ) -> SignalHandlerId {
1513        unsafe extern "C" fn removed_stream_trampoline<
1514            P: IsA<RTSPMedia>,
1515            F: Fn(&P, &RTSPStream) + Send + Sync + 'static,
1516        >(
1517            this: *mut ffi::GstRTSPMedia,
1518            object: *mut ffi::GstRTSPStream,
1519            f: glib::ffi::gpointer,
1520        ) {
1521            let f: &F = &*(f as *const F);
1522            f(
1523                RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(),
1524                &from_glib_borrow(object),
1525            )
1526        }
1527        unsafe {
1528            let f: Box_<F> = Box_::new(f);
1529            connect_raw(
1530                self.as_ptr() as *mut _,
1531                c"removed-stream".as_ptr() as *const _,
1532                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1533                    removed_stream_trampoline::<Self, F> as *const (),
1534                )),
1535                Box_::into_raw(f),
1536            )
1537        }
1538    }
1539
1540    #[doc(alias = "target-state")]
1541    fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
1542        &self,
1543        f: F,
1544    ) -> SignalHandlerId {
1545        unsafe extern "C" fn target_state_trampoline<
1546            P: IsA<RTSPMedia>,
1547            F: Fn(&P, i32) + Send + Sync + 'static,
1548        >(
1549            this: *mut ffi::GstRTSPMedia,
1550            object: std::ffi::c_int,
1551            f: glib::ffi::gpointer,
1552        ) {
1553            let f: &F = &*(f as *const F);
1554            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref(), object)
1555        }
1556        unsafe {
1557            let f: Box_<F> = Box_::new(f);
1558            connect_raw(
1559                self.as_ptr() as *mut _,
1560                c"target-state".as_ptr() as *const _,
1561                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1562                    target_state_trampoline::<Self, F> as *const (),
1563                )),
1564                Box_::into_raw(f),
1565            )
1566        }
1567    }
1568
1569    #[doc(alias = "unprepared")]
1570    fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1571        unsafe extern "C" fn unprepared_trampoline<
1572            P: IsA<RTSPMedia>,
1573            F: Fn(&P) + Send + Sync + 'static,
1574        >(
1575            this: *mut ffi::GstRTSPMedia,
1576            f: glib::ffi::gpointer,
1577        ) {
1578            let f: &F = &*(f as *const F);
1579            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1580        }
1581        unsafe {
1582            let f: Box_<F> = Box_::new(f);
1583            connect_raw(
1584                self.as_ptr() as *mut _,
1585                c"unprepared".as_ptr() as *const _,
1586                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1587                    unprepared_trampoline::<Self, F> as *const (),
1588                )),
1589                Box_::into_raw(f),
1590            )
1591        }
1592    }
1593
1594    #[doc(alias = "bind-mcast-address")]
1595    fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
1596        &self,
1597        f: F,
1598    ) -> SignalHandlerId {
1599        unsafe extern "C" fn notify_bind_mcast_address_trampoline<
1600            P: IsA<RTSPMedia>,
1601            F: Fn(&P) + Send + Sync + 'static,
1602        >(
1603            this: *mut ffi::GstRTSPMedia,
1604            _param_spec: glib::ffi::gpointer,
1605            f: glib::ffi::gpointer,
1606        ) {
1607            let f: &F = &*(f as *const F);
1608            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1609        }
1610        unsafe {
1611            let f: Box_<F> = Box_::new(f);
1612            connect_raw(
1613                self.as_ptr() as *mut _,
1614                c"notify::bind-mcast-address".as_ptr() as *const _,
1615                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1616                    notify_bind_mcast_address_trampoline::<Self, F> as *const (),
1617                )),
1618                Box_::into_raw(f),
1619            )
1620        }
1621    }
1622
1623    #[doc(alias = "buffer-size")]
1624    fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
1625        &self,
1626        f: F,
1627    ) -> SignalHandlerId {
1628        unsafe extern "C" fn notify_buffer_size_trampoline<
1629            P: IsA<RTSPMedia>,
1630            F: Fn(&P) + Send + Sync + 'static,
1631        >(
1632            this: *mut ffi::GstRTSPMedia,
1633            _param_spec: glib::ffi::gpointer,
1634            f: glib::ffi::gpointer,
1635        ) {
1636            let f: &F = &*(f as *const F);
1637            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1638        }
1639        unsafe {
1640            let f: Box_<F> = Box_::new(f);
1641            connect_raw(
1642                self.as_ptr() as *mut _,
1643                c"notify::buffer-size".as_ptr() as *const _,
1644                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1645                    notify_buffer_size_trampoline::<Self, F> as *const (),
1646                )),
1647                Box_::into_raw(f),
1648            )
1649        }
1650    }
1651
1652    #[doc(alias = "clock")]
1653    fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1654        unsafe extern "C" fn notify_clock_trampoline<
1655            P: IsA<RTSPMedia>,
1656            F: Fn(&P) + Send + Sync + 'static,
1657        >(
1658            this: *mut ffi::GstRTSPMedia,
1659            _param_spec: glib::ffi::gpointer,
1660            f: glib::ffi::gpointer,
1661        ) {
1662            let f: &F = &*(f as *const F);
1663            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1664        }
1665        unsafe {
1666            let f: Box_<F> = Box_::new(f);
1667            connect_raw(
1668                self.as_ptr() as *mut _,
1669                c"notify::clock".as_ptr() as *const _,
1670                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1671                    notify_clock_trampoline::<Self, F> as *const (),
1672                )),
1673                Box_::into_raw(f),
1674            )
1675        }
1676    }
1677
1678    #[doc(alias = "dscp-qos")]
1679    fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
1680        &self,
1681        f: F,
1682    ) -> SignalHandlerId {
1683        unsafe extern "C" fn notify_dscp_qos_trampoline<
1684            P: IsA<RTSPMedia>,
1685            F: Fn(&P) + Send + Sync + 'static,
1686        >(
1687            this: *mut ffi::GstRTSPMedia,
1688            _param_spec: glib::ffi::gpointer,
1689            f: glib::ffi::gpointer,
1690        ) {
1691            let f: &F = &*(f as *const F);
1692            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1693        }
1694        unsafe {
1695            let f: Box_<F> = Box_::new(f);
1696            connect_raw(
1697                self.as_ptr() as *mut _,
1698                c"notify::dscp-qos".as_ptr() as *const _,
1699                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1700                    notify_dscp_qos_trampoline::<Self, F> as *const (),
1701                )),
1702                Box_::into_raw(f),
1703            )
1704        }
1705    }
1706
1707    #[cfg(feature = "v1_24")]
1708    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1709    #[doc(alias = "ensure-keyunit-on-start")]
1710    fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
1711        &self,
1712        f: F,
1713    ) -> SignalHandlerId {
1714        unsafe extern "C" fn notify_ensure_keyunit_on_start_trampoline<
1715            P: IsA<RTSPMedia>,
1716            F: Fn(&P) + Send + Sync + 'static,
1717        >(
1718            this: *mut ffi::GstRTSPMedia,
1719            _param_spec: glib::ffi::gpointer,
1720            f: glib::ffi::gpointer,
1721        ) {
1722            let f: &F = &*(f as *const F);
1723            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1724        }
1725        unsafe {
1726            let f: Box_<F> = Box_::new(f);
1727            connect_raw(
1728                self.as_ptr() as *mut _,
1729                c"notify::ensure-keyunit-on-start".as_ptr() as *const _,
1730                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1731                    notify_ensure_keyunit_on_start_trampoline::<Self, F> as *const (),
1732                )),
1733                Box_::into_raw(f),
1734            )
1735        }
1736    }
1737
1738    #[cfg(feature = "v1_24")]
1739    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
1740    #[doc(alias = "ensure-keyunit-on-start-timeout")]
1741    fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
1742        &self,
1743        f: F,
1744    ) -> SignalHandlerId {
1745        unsafe extern "C" fn notify_ensure_keyunit_on_start_timeout_trampoline<
1746            P: IsA<RTSPMedia>,
1747            F: Fn(&P) + Send + Sync + 'static,
1748        >(
1749            this: *mut ffi::GstRTSPMedia,
1750            _param_spec: glib::ffi::gpointer,
1751            f: glib::ffi::gpointer,
1752        ) {
1753            let f: &F = &*(f as *const F);
1754            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1755        }
1756        unsafe {
1757            let f: Box_<F> = Box_::new(f);
1758            connect_raw(
1759                self.as_ptr() as *mut _,
1760                c"notify::ensure-keyunit-on-start-timeout".as_ptr() as *const _,
1761                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1762                    notify_ensure_keyunit_on_start_timeout_trampoline::<Self, F> as *const (),
1763                )),
1764                Box_::into_raw(f),
1765            )
1766        }
1767    }
1768
1769    #[doc(alias = "eos-shutdown")]
1770    fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
1771        &self,
1772        f: F,
1773    ) -> SignalHandlerId {
1774        unsafe extern "C" fn notify_eos_shutdown_trampoline<
1775            P: IsA<RTSPMedia>,
1776            F: Fn(&P) + Send + Sync + 'static,
1777        >(
1778            this: *mut ffi::GstRTSPMedia,
1779            _param_spec: glib::ffi::gpointer,
1780            f: glib::ffi::gpointer,
1781        ) {
1782            let f: &F = &*(f as *const F);
1783            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1784        }
1785        unsafe {
1786            let f: Box_<F> = Box_::new(f);
1787            connect_raw(
1788                self.as_ptr() as *mut _,
1789                c"notify::eos-shutdown".as_ptr() as *const _,
1790                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1791                    notify_eos_shutdown_trampoline::<Self, F> as *const (),
1792                )),
1793                Box_::into_raw(f),
1794            )
1795        }
1796    }
1797
1798    #[doc(alias = "latency")]
1799    fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
1800        &self,
1801        f: F,
1802    ) -> SignalHandlerId {
1803        unsafe extern "C" fn notify_latency_trampoline<
1804            P: IsA<RTSPMedia>,
1805            F: Fn(&P) + Send + Sync + 'static,
1806        >(
1807            this: *mut ffi::GstRTSPMedia,
1808            _param_spec: glib::ffi::gpointer,
1809            f: glib::ffi::gpointer,
1810        ) {
1811            let f: &F = &*(f as *const F);
1812            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1813        }
1814        unsafe {
1815            let f: Box_<F> = Box_::new(f);
1816            connect_raw(
1817                self.as_ptr() as *mut _,
1818                c"notify::latency".as_ptr() as *const _,
1819                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1820                    notify_latency_trampoline::<Self, F> as *const (),
1821                )),
1822                Box_::into_raw(f),
1823            )
1824        }
1825    }
1826
1827    #[doc(alias = "max-mcast-ttl")]
1828    fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
1829        &self,
1830        f: F,
1831    ) -> SignalHandlerId {
1832        unsafe extern "C" fn notify_max_mcast_ttl_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            let f: &F = &*(f as *const F);
1841            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1842        }
1843        unsafe {
1844            let f: Box_<F> = Box_::new(f);
1845            connect_raw(
1846                self.as_ptr() as *mut _,
1847                c"notify::max-mcast-ttl".as_ptr() as *const _,
1848                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1849                    notify_max_mcast_ttl_trampoline::<Self, F> as *const (),
1850                )),
1851                Box_::into_raw(f),
1852            )
1853        }
1854    }
1855
1856    #[doc(alias = "profiles")]
1857    fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
1858        &self,
1859        f: F,
1860    ) -> SignalHandlerId {
1861        unsafe extern "C" fn notify_profiles_trampoline<
1862            P: IsA<RTSPMedia>,
1863            F: Fn(&P) + Send + Sync + 'static,
1864        >(
1865            this: *mut ffi::GstRTSPMedia,
1866            _param_spec: glib::ffi::gpointer,
1867            f: glib::ffi::gpointer,
1868        ) {
1869            let f: &F = &*(f as *const F);
1870            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1871        }
1872        unsafe {
1873            let f: Box_<F> = Box_::new(f);
1874            connect_raw(
1875                self.as_ptr() as *mut _,
1876                c"notify::profiles".as_ptr() as *const _,
1877                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1878                    notify_profiles_trampoline::<Self, F> as *const (),
1879                )),
1880                Box_::into_raw(f),
1881            )
1882        }
1883    }
1884
1885    #[doc(alias = "protocols")]
1886    fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
1887        &self,
1888        f: F,
1889    ) -> SignalHandlerId {
1890        unsafe extern "C" fn notify_protocols_trampoline<
1891            P: IsA<RTSPMedia>,
1892            F: Fn(&P) + Send + Sync + 'static,
1893        >(
1894            this: *mut ffi::GstRTSPMedia,
1895            _param_spec: glib::ffi::gpointer,
1896            f: glib::ffi::gpointer,
1897        ) {
1898            let f: &F = &*(f as *const F);
1899            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1900        }
1901        unsafe {
1902            let f: Box_<F> = Box_::new(f);
1903            connect_raw(
1904                self.as_ptr() as *mut _,
1905                c"notify::protocols".as_ptr() as *const _,
1906                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1907                    notify_protocols_trampoline::<Self, F> as *const (),
1908                )),
1909                Box_::into_raw(f),
1910            )
1911        }
1912    }
1913
1914    #[doc(alias = "reusable")]
1915    fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
1916        &self,
1917        f: F,
1918    ) -> SignalHandlerId {
1919        unsafe extern "C" fn notify_reusable_trampoline<
1920            P: IsA<RTSPMedia>,
1921            F: Fn(&P) + Send + Sync + 'static,
1922        >(
1923            this: *mut ffi::GstRTSPMedia,
1924            _param_spec: glib::ffi::gpointer,
1925            f: glib::ffi::gpointer,
1926        ) {
1927            let f: &F = &*(f as *const F);
1928            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1929        }
1930        unsafe {
1931            let f: Box_<F> = Box_::new(f);
1932            connect_raw(
1933                self.as_ptr() as *mut _,
1934                c"notify::reusable".as_ptr() as *const _,
1935                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1936                    notify_reusable_trampoline::<Self, F> as *const (),
1937                )),
1938                Box_::into_raw(f),
1939            )
1940        }
1941    }
1942
1943    #[doc(alias = "shared")]
1944    fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1945        unsafe extern "C" fn notify_shared_trampoline<
1946            P: IsA<RTSPMedia>,
1947            F: Fn(&P) + Send + Sync + 'static,
1948        >(
1949            this: *mut ffi::GstRTSPMedia,
1950            _param_spec: glib::ffi::gpointer,
1951            f: glib::ffi::gpointer,
1952        ) {
1953            let f: &F = &*(f as *const F);
1954            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1955        }
1956        unsafe {
1957            let f: Box_<F> = Box_::new(f);
1958            connect_raw(
1959                self.as_ptr() as *mut _,
1960                c"notify::shared".as_ptr() as *const _,
1961                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1962                    notify_shared_trampoline::<Self, F> as *const (),
1963                )),
1964                Box_::into_raw(f),
1965            )
1966        }
1967    }
1968
1969    #[doc(alias = "stop-on-disconnect")]
1970    fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
1971        &self,
1972        f: F,
1973    ) -> SignalHandlerId {
1974        unsafe extern "C" fn notify_stop_on_disconnect_trampoline<
1975            P: IsA<RTSPMedia>,
1976            F: Fn(&P) + Send + Sync + 'static,
1977        >(
1978            this: *mut ffi::GstRTSPMedia,
1979            _param_spec: glib::ffi::gpointer,
1980            f: glib::ffi::gpointer,
1981        ) {
1982            let f: &F = &*(f as *const F);
1983            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
1984        }
1985        unsafe {
1986            let f: Box_<F> = Box_::new(f);
1987            connect_raw(
1988                self.as_ptr() as *mut _,
1989                c"notify::stop-on-disconnect".as_ptr() as *const _,
1990                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1991                    notify_stop_on_disconnect_trampoline::<Self, F> as *const (),
1992                )),
1993                Box_::into_raw(f),
1994            )
1995        }
1996    }
1997
1998    #[doc(alias = "suspend-mode")]
1999    fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2000        &self,
2001        f: F,
2002    ) -> SignalHandlerId {
2003        unsafe extern "C" fn notify_suspend_mode_trampoline<
2004            P: IsA<RTSPMedia>,
2005            F: Fn(&P) + Send + Sync + 'static,
2006        >(
2007            this: *mut ffi::GstRTSPMedia,
2008            _param_spec: glib::ffi::gpointer,
2009            f: glib::ffi::gpointer,
2010        ) {
2011            let f: &F = &*(f as *const F);
2012            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2013        }
2014        unsafe {
2015            let f: Box_<F> = Box_::new(f);
2016            connect_raw(
2017                self.as_ptr() as *mut _,
2018                c"notify::suspend-mode".as_ptr() as *const _,
2019                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2020                    notify_suspend_mode_trampoline::<Self, F> as *const (),
2021                )),
2022                Box_::into_raw(f),
2023            )
2024        }
2025    }
2026
2027    #[doc(alias = "time-provider")]
2028    fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
2029        &self,
2030        f: F,
2031    ) -> SignalHandlerId {
2032        unsafe extern "C" fn notify_time_provider_trampoline<
2033            P: IsA<RTSPMedia>,
2034            F: Fn(&P) + Send + Sync + 'static,
2035        >(
2036            this: *mut ffi::GstRTSPMedia,
2037            _param_spec: glib::ffi::gpointer,
2038            f: glib::ffi::gpointer,
2039        ) {
2040            let f: &F = &*(f as *const F);
2041            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2042        }
2043        unsafe {
2044            let f: Box_<F> = Box_::new(f);
2045            connect_raw(
2046                self.as_ptr() as *mut _,
2047                c"notify::time-provider".as_ptr() as *const _,
2048                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2049                    notify_time_provider_trampoline::<Self, F> as *const (),
2050                )),
2051                Box_::into_raw(f),
2052            )
2053        }
2054    }
2055
2056    #[doc(alias = "transport-mode")]
2057    fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
2058        &self,
2059        f: F,
2060    ) -> SignalHandlerId {
2061        unsafe extern "C" fn notify_transport_mode_trampoline<
2062            P: IsA<RTSPMedia>,
2063            F: Fn(&P) + Send + Sync + 'static,
2064        >(
2065            this: *mut ffi::GstRTSPMedia,
2066            _param_spec: glib::ffi::gpointer,
2067            f: glib::ffi::gpointer,
2068        ) {
2069            let f: &F = &*(f as *const F);
2070            f(RTSPMedia::from_glib_borrow(this).unsafe_cast_ref())
2071        }
2072        unsafe {
2073            let f: Box_<F> = Box_::new(f);
2074            connect_raw(
2075                self.as_ptr() as *mut _,
2076                c"notify::transport-mode".as_ptr() as *const _,
2077                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2078                    notify_transport_mode_trampoline::<Self, F> as *const (),
2079                )),
2080                Box_::into_raw(f),
2081            )
2082        }
2083    }
2084}
2085
2086impl<O: IsA<RTSPMedia>> RTSPMediaExt for O {}