gstreamer_rtp/auto/
rtp_base_depayload.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::ffi;
7#[cfg(feature = "v1_20")]
8#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
9use crate::RTPHeaderExtension;
10#[cfg(feature = "v1_20")]
11#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
12use glib::object::ObjectType as _;
13use glib::{
14    prelude::*,
15    signal::{connect_raw, SignalHandlerId},
16    translate::*,
17};
18use std::boxed::Box as Box_;
19
20glib::wrapper! {
21    /// Provides a base class for RTP depayloaders
22    ///
23    /// In order to handle RTP header extensions correctly if the
24    /// depayloader aggregates multiple RTP packet payloads into one output
25    /// buffer this class provides the function
26    /// [`RTPBaseDepayloadExt::set_aggregate_hdrext_enabled()`][crate::prelude::RTPBaseDepayloadExt::set_aggregate_hdrext_enabled()]. If the
27    /// aggregation is enabled the virtual functions
28    /// [`RTPBaseDepayload`][crate::RTPBaseDepayload] or
29    /// [`RTPBaseDepayload`][crate::RTPBaseDepayload] must tell the base class
30    /// what happens to the current RTP packet. By default the base class
31    /// assumes that the packet payload is used with the next output
32    /// buffer.
33    ///
34    /// If the RTP packet will not be used with an output buffer
35    /// [`RTPBaseDepayloadExt::dropped()`][crate::prelude::RTPBaseDepayloadExt::dropped()] must be called. A typical
36    /// situation would be if we are waiting for a keyframe.
37    ///
38    /// If the RTP packet will be used but not with the current output
39    /// buffer but with the next one [`RTPBaseDepayloadExt::delayed()`][crate::prelude::RTPBaseDepayloadExt::delayed()] must
40    /// be called. This may happen if the current RTP packet signals the
41    /// start of a new output buffer and the currently processed output
42    /// buffer will be pushed first. The undelay happens implicitly once
43    /// the current buffer has been pushed or
44    /// [`RTPBaseDepayloadExt::flush()`][crate::prelude::RTPBaseDepayloadExt::flush()] has been called.
45    ///
46    /// If [`RTPBaseDepayloadExt::flush()`][crate::prelude::RTPBaseDepayloadExt::flush()] is called all RTP packets that
47    /// have not been dropped since the last output buffer are dropped,
48    /// e.g. if an output buffer is discarded due to malformed data. This
49    /// may or may not include the current RTP packet depending on the 2nd
50    /// parameter `keep_current`.
51    ///
52    /// Be aware that in case [`RTPBaseDepayloadExt::push_list()`][crate::prelude::RTPBaseDepayloadExt::push_list()] is used
53    /// each buffer will see the same list of RTP header extensions.
54    ///
55    /// This is an Abstract Base Class, you cannot instantiate it.
56    ///
57    /// ## Properties
58    ///
59    ///
60    /// #### `auto-header-extension`
61    ///  If enabled, the depayloader will automatically try to enable all the
62    /// RTP header extensions provided in the sink caps, saving the application
63    /// the need to handle these extensions manually using the
64    /// GstRTPBaseDepayload::request-extension: signal.
65    ///
66    /// Readable | Writeable
67    ///
68    ///
69    /// #### `extensions`
70    ///  A list of already enabled RTP header extensions. This may be useful for finding
71    /// out which extensions are already enabled (with add-extension signal) and picking a non-conflicting
72    /// ID for a new extension that needs to be added on top of the existing ones.
73    ///
74    /// Note that the value returned by reading this property is not dynamically updated when the set of
75    /// enabled extensions changes by any of existing action signals. Rather, it represents the current state
76    /// at the time the property is read.
77    ///
78    /// Dynamic updates of this property can be received by subscribing to its corresponding "notify" signal, i.e.
79    /// "notify::extensions".
80    ///
81    /// Readable
82    ///
83    ///
84    /// #### `max-reorder`
85    ///  Max seqnum reorder before the sender is assumed to have restarted.
86    ///
87    /// When max-reorder is set to 0 all reordered/duplicate packets are
88    /// considered coming from a restarted sender.
89    ///
90    /// Readable | Writeable
91    ///
92    ///
93    /// #### `source-info`
94    ///  Add RTP source information found in RTP header as meta to output buffer.
95    ///
96    /// Readable | Writeable
97    ///
98    ///
99    /// #### `stats`
100    ///  Various depayloader statistics retrieved atomically (and are therefore
101    /// synchroized with each other). This property return a GstStructure named
102    /// application/x-rtp-depayload-stats containing the following fields relating to
103    /// the last processed buffer and current state of the stream being depayloaded:
104    ///
105    ///  * `clock-rate`: `G_TYPE_UINT`, clock-rate of the stream
106    ///  * `npt-start`: `G_TYPE_UINT64`, time of playback start
107    ///  * `npt-stop`: `G_TYPE_UINT64`, time of playback stop
108    ///  * `play-speed`: `G_TYPE_DOUBLE`, the playback speed
109    ///  * `play-scale`: `G_TYPE_DOUBLE`, the playback scale
110    ///  * `running-time-dts`: `G_TYPE_UINT64`, the last running-time of the
111    ///  last DTS
112    ///  * `running-time-pts`: `G_TYPE_UINT64`, the last running-time of the
113    ///  last PTS
114    ///  * `seqnum`: `G_TYPE_UINT`, the last seen seqnum
115    ///  * `timestamp`: `G_TYPE_UINT`, the last seen RTP timestamp
116    ///
117    /// Readable
118    /// <details><summary><h4>Object</h4></summary>
119    ///
120    ///
121    /// #### `name`
122    ///  Readable | Writeable | Construct
123    ///
124    ///
125    /// #### `parent`
126    ///  The parent of the object. Please note, that when changing the 'parent'
127    /// property, we don't emit `GObject::notify` and [`deep-notify`][struct@crate::gst::Object#deep-notify]
128    /// signals due to locking issues. In some cases one can use
129    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
130    /// achieve a similar effect.
131    ///
132    /// Readable | Writeable
133    /// </details>
134    ///
135    /// ## Signals
136    ///
137    ///
138    /// #### `add-extension`
139    ///  Add `ext` as an extension for reading part of an RTP header extension from
140    /// incoming RTP packets.
141    ///
142    /// Action
143    ///
144    ///
145    /// #### `clear-extensions`
146    ///  Clear all RTP header extensions used by this depayloader.
147    ///
148    /// Action
149    ///
150    ///
151    /// #### `request-extension`
152    ///  The returned `ext` must be configured with the correct `ext_id` and with the
153    /// necessary attributes as required by the extension implementation.
154    ///
155    ///
156    /// <details><summary><h4>Element</h4></summary>
157    ///
158    ///
159    /// #### `no-more-pads`
160    ///  This signals that the element will not generate more dynamic pads.
161    /// Note that this signal will usually be emitted from the context of
162    /// the streaming thread.
163    ///
164    ///
165    ///
166    ///
167    /// #### `pad-added`
168    ///  a new `GstPad` has been added to the element. Note that this signal will
169    /// usually be emitted from the context of the streaming thread. Also keep in
170    /// mind that if you add new elements to the pipeline in the signal handler
171    /// you will need to set them to the desired target state with
172    /// [`ElementExtManual::set_state()`][crate::gst::prelude::ElementExtManual::set_state()] or [`ElementExtManual::sync_state_with_parent()`][crate::gst::prelude::ElementExtManual::sync_state_with_parent()].
173    ///
174    ///
175    ///
176    ///
177    /// #### `pad-removed`
178    ///  a `GstPad` has been removed from the element
179    ///
180    ///
181    /// </details>
182    /// <details><summary><h4>Object</h4></summary>
183    ///
184    ///
185    /// #### `deep-notify`
186    ///  The deep notify signal is used to be notified of property changes. It is
187    /// typically attached to the toplevel bin to receive notifications from all
188    /// the elements contained in that bin.
189    ///
190    /// Detailed
191    /// </details>
192    ///
193    /// # Implements
194    ///
195    /// [`RTPBaseDepayloadExt`][trait@crate::prelude::RTPBaseDepayloadExt], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`RTPBaseDepayloadExtManual`][trait@crate::prelude::RTPBaseDepayloadExtManual]
196    #[doc(alias = "GstRTPBaseDepayload")]
197    pub struct RTPBaseDepayload(Object<ffi::GstRTPBaseDepayload, ffi::GstRTPBaseDepayloadClass>) @extends gst::Element, gst::Object;
198
199    match fn {
200        type_ => || ffi::gst_rtp_base_depayload_get_type(),
201    }
202}
203
204impl RTPBaseDepayload {
205    pub const NONE: Option<&'static RTPBaseDepayload> = None;
206}
207
208unsafe impl Send for RTPBaseDepayload {}
209unsafe impl Sync for RTPBaseDepayload {}
210
211/// Trait containing all [`struct@RTPBaseDepayload`] methods.
212///
213/// # Implementors
214///
215/// [`RTPBaseDepayload`][struct@crate::RTPBaseDepayload]
216pub trait RTPBaseDepayloadExt: IsA<RTPBaseDepayload> + 'static {
217    /// Called from [`RTPBaseDepayload`][crate::RTPBaseDepayload] or
218    /// [`RTPBaseDepayload`][crate::RTPBaseDepayload] when the depayloader needs
219    /// to keep the current input RTP header for use with the next output
220    /// buffer.
221    ///
222    /// The delayed buffer will remain until the end of processing the
223    /// current output buffer and then enqueued for processing with the
224    /// next output buffer.
225    ///
226    /// A typical use-case is when the depayloader implementation will
227    /// start a new output buffer for the current input RTP buffer but push
228    /// the current output buffer first.
229    ///
230    /// Must be called with the stream lock held.
231    #[cfg(feature = "v1_24")]
232    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
233    #[doc(alias = "gst_rtp_base_depayload_delayed")]
234    fn delayed(&self) {
235        unsafe {
236            ffi::gst_rtp_base_depayload_delayed(self.as_ref().to_glib_none().0);
237        }
238    }
239
240    /// Called from [`RTPBaseDepayload`][crate::RTPBaseDepayload] or
241    /// [`RTPBaseDepayload`][crate::RTPBaseDepayload] if the depayloader does not
242    /// use the current buffer for the output buffer. This will either drop
243    /// the delayed buffer or the last buffer from the header extension
244    /// cache.
245    ///
246    /// A typical use-case is when the depayloader implementation is
247    /// dropping an input RTP buffer while waiting for the first keyframe.
248    ///
249    /// Must be called with the stream lock held.
250    #[cfg(feature = "v1_24")]
251    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
252    #[doc(alias = "gst_rtp_base_depayload_dropped")]
253    fn dropped(&self) {
254        unsafe {
255            ffi::gst_rtp_base_depayload_dropped(self.as_ref().to_glib_none().0);
256        }
257    }
258
259    /// If [`RTPBaseDepayload`][crate::RTPBaseDepayload] or
260    /// [`RTPBaseDepayload`][crate::RTPBaseDepayload] drop an output buffer this
261    /// function tells the base class to flush header extension cache as
262    /// well.
263    ///
264    /// This will not drop an input RTP header marked as delayed from
265    /// [`delayed()`][Self::delayed()].
266    ///
267    /// If `keep_current` is [`true`] the current input RTP header will be kept
268    /// and enqueued after flushing the previous input RTP headers.
269    ///
270    /// A typical use-case for `keep_current` is when the depayloader
271    /// implementation invalidates the current output buffer and starts a
272    /// new one with the current RTP input buffer.
273    ///
274    /// Must be called with the stream lock held.
275    /// ## `keep_current`
276    /// if the current RTP buffer shall be kept
277    #[cfg(feature = "v1_24")]
278    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
279    #[doc(alias = "gst_rtp_base_depayload_flush")]
280    fn flush(&self, keep_current: bool) {
281        unsafe {
282            ffi::gst_rtp_base_depayload_flush(
283                self.as_ref().to_glib_none().0,
284                keep_current.into_glib(),
285            );
286        }
287    }
288
289    /// Queries whether header extensions will be aggregated per depayloaded buffers.
290    ///
291    /// # Returns
292    ///
293    /// [`true`] if aggregate-header-extension is enabled.
294    #[cfg(feature = "v1_24")]
295    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
296    #[doc(alias = "gst_rtp_base_depayload_is_aggregate_hdrext_enabled")]
297    fn is_aggregate_hdrext_enabled(&self) -> bool {
298        unsafe {
299            from_glib(ffi::gst_rtp_base_depayload_is_aggregate_hdrext_enabled(
300                self.as_ref().to_glib_none().0,
301            ))
302        }
303    }
304
305    /// Queries whether `GstRTPSourceMeta` will be added to depayloaded buffers.
306    ///
307    /// # Returns
308    ///
309    /// [`true`] if source-info is enabled.
310    #[cfg(feature = "v1_16")]
311    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
312    #[doc(alias = "gst_rtp_base_depayload_is_source_info_enabled")]
313    fn is_source_info_enabled(&self) -> bool {
314        unsafe {
315            from_glib(ffi::gst_rtp_base_depayload_is_source_info_enabled(
316                self.as_ref().to_glib_none().0,
317            ))
318        }
319    }
320
321    /// Push `out_buf` to the peer of `self`. This function takes ownership of
322    /// `out_buf`.
323    ///
324    /// This function will by default apply the last incoming timestamp on
325    /// the outgoing buffer when it didn't have a timestamp already.
326    /// ## `out_buf`
327    /// a [`gst::Buffer`][crate::gst::Buffer]
328    ///
329    /// # Returns
330    ///
331    /// a [`gst::FlowReturn`][crate::gst::FlowReturn].
332    #[doc(alias = "gst_rtp_base_depayload_push")]
333    fn push(&self, out_buf: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
334        unsafe {
335            try_from_glib(ffi::gst_rtp_base_depayload_push(
336                self.as_ref().to_glib_none().0,
337                out_buf.into_glib_ptr(),
338            ))
339        }
340    }
341
342    /// Push `out_list` to the peer of `self`. This function takes ownership of
343    /// `out_list`.
344    /// ## `out_list`
345    /// a [`gst::BufferList`][crate::gst::BufferList]
346    ///
347    /// # Returns
348    ///
349    /// a [`gst::FlowReturn`][crate::gst::FlowReturn].
350    #[doc(alias = "gst_rtp_base_depayload_push_list")]
351    fn push_list(&self, out_list: gst::BufferList) -> Result<gst::FlowSuccess, gst::FlowError> {
352        unsafe {
353            try_from_glib(ffi::gst_rtp_base_depayload_push_list(
354                self.as_ref().to_glib_none().0,
355                out_list.into_glib_ptr(),
356            ))
357        }
358    }
359
360    /// Enable or disable aggregating header extensions.
361    /// ## `enable`
362    /// whether to aggregate header extensions per output buffer
363    #[cfg(feature = "v1_24")]
364    #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
365    #[doc(alias = "gst_rtp_base_depayload_set_aggregate_hdrext_enabled")]
366    fn set_aggregate_hdrext_enabled(&self, enable: bool) {
367        unsafe {
368            ffi::gst_rtp_base_depayload_set_aggregate_hdrext_enabled(
369                self.as_ref().to_glib_none().0,
370                enable.into_glib(),
371            );
372        }
373    }
374
375    /// Enable or disable adding `GstRTPSourceMeta` to depayloaded buffers.
376    /// ## `enable`
377    /// whether to add meta about RTP sources to buffer
378    #[cfg(feature = "v1_16")]
379    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
380    #[doc(alias = "gst_rtp_base_depayload_set_source_info_enabled")]
381    fn set_source_info_enabled(&self, enable: bool) {
382        unsafe {
383            ffi::gst_rtp_base_depayload_set_source_info_enabled(
384                self.as_ref().to_glib_none().0,
385                enable.into_glib(),
386            );
387        }
388    }
389
390    /// If enabled, the depayloader will automatically try to enable all the
391    /// RTP header extensions provided in the sink caps, saving the application
392    /// the need to handle these extensions manually using the
393    /// GstRTPBaseDepayload::request-extension: signal.
394    #[cfg(feature = "v1_20")]
395    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
396    #[doc(alias = "auto-header-extension")]
397    fn is_auto_header_extension(&self) -> bool {
398        ObjectExt::property(self.as_ref(), "auto-header-extension")
399    }
400
401    /// If enabled, the depayloader will automatically try to enable all the
402    /// RTP header extensions provided in the sink caps, saving the application
403    /// the need to handle these extensions manually using the
404    /// GstRTPBaseDepayload::request-extension: signal.
405    #[cfg(feature = "v1_20")]
406    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
407    #[doc(alias = "auto-header-extension")]
408    fn set_auto_header_extension(&self, auto_header_extension: bool) {
409        ObjectExt::set_property(
410            self.as_ref(),
411            "auto-header-extension",
412            auto_header_extension,
413        )
414    }
415
416    /// Max seqnum reorder before the sender is assumed to have restarted.
417    ///
418    /// When max-reorder is set to 0 all reordered/duplicate packets are
419    /// considered coming from a restarted sender.
420    #[cfg(feature = "v1_18")]
421    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
422    #[doc(alias = "max-reorder")]
423    fn max_reorder(&self) -> i32 {
424        ObjectExt::property(self.as_ref(), "max-reorder")
425    }
426
427    /// Max seqnum reorder before the sender is assumed to have restarted.
428    ///
429    /// When max-reorder is set to 0 all reordered/duplicate packets are
430    /// considered coming from a restarted sender.
431    #[cfg(feature = "v1_18")]
432    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
433    #[doc(alias = "max-reorder")]
434    fn set_max_reorder(&self, max_reorder: i32) {
435        ObjectExt::set_property(self.as_ref(), "max-reorder", max_reorder)
436    }
437
438    /// Add RTP source information found in RTP header as meta to output buffer.
439    #[cfg(feature = "v1_16")]
440    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
441    #[doc(alias = "source-info")]
442    fn is_source_info(&self) -> bool {
443        ObjectExt::property(self.as_ref(), "source-info")
444    }
445
446    /// Add RTP source information found in RTP header as meta to output buffer.
447    #[cfg(feature = "v1_16")]
448    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
449    #[doc(alias = "source-info")]
450    fn set_source_info(&self, source_info: bool) {
451        ObjectExt::set_property(self.as_ref(), "source-info", source_info)
452    }
453
454    /// Various depayloader statistics retrieved atomically (and are therefore
455    /// synchroized with each other). This property return a GstStructure named
456    /// application/x-rtp-depayload-stats containing the following fields relating to
457    /// the last processed buffer and current state of the stream being depayloaded:
458    ///
459    ///  * `clock-rate`: `G_TYPE_UINT`, clock-rate of the stream
460    ///  * `npt-start`: `G_TYPE_UINT64`, time of playback start
461    ///  * `npt-stop`: `G_TYPE_UINT64`, time of playback stop
462    ///  * `play-speed`: `G_TYPE_DOUBLE`, the playback speed
463    ///  * `play-scale`: `G_TYPE_DOUBLE`, the playback scale
464    ///  * `running-time-dts`: `G_TYPE_UINT64`, the last running-time of the
465    ///  last DTS
466    ///  * `running-time-pts`: `G_TYPE_UINT64`, the last running-time of the
467    ///  last PTS
468    ///  * `seqnum`: `G_TYPE_UINT`, the last seen seqnum
469    ///  * `timestamp`: `G_TYPE_UINT`, the last seen RTP timestamp
470    fn stats(&self) -> Option<gst::Structure> {
471        ObjectExt::property(self.as_ref(), "stats")
472    }
473
474    /// Add `ext` as an extension for reading part of an RTP header extension from
475    /// incoming RTP packets.
476    /// ## `ext`
477    /// the [`RTPHeaderExtension`][crate::RTPHeaderExtension]
478    #[cfg(feature = "v1_20")]
479    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
480    #[doc(alias = "add-extension")]
481    fn connect_add_extension<F: Fn(&Self, &RTPHeaderExtension) + Send + Sync + 'static>(
482        &self,
483        f: F,
484    ) -> SignalHandlerId {
485        unsafe extern "C" fn add_extension_trampoline<
486            P: IsA<RTPBaseDepayload>,
487            F: Fn(&P, &RTPHeaderExtension) + Send + Sync + 'static,
488        >(
489            this: *mut ffi::GstRTPBaseDepayload,
490            ext: *mut ffi::GstRTPHeaderExtension,
491            f: glib::ffi::gpointer,
492        ) {
493            let f: &F = &*(f as *const F);
494            f(
495                RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(),
496                &from_glib_full(ext),
497            )
498        }
499        unsafe {
500            let f: Box_<F> = Box_::new(f);
501            connect_raw(
502                self.as_ptr() as *mut _,
503                c"add-extension".as_ptr() as *const _,
504                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
505                    add_extension_trampoline::<Self, F> as *const (),
506                )),
507                Box_::into_raw(f),
508            )
509        }
510    }
511
512    #[cfg(feature = "v1_20")]
513    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
514    fn emit_add_extension(&self, ext: &RTPHeaderExtension) {
515        self.emit_by_name::<()>("add-extension", &[&ext]);
516    }
517
518    /// Clear all RTP header extensions used by this depayloader.
519    #[cfg(feature = "v1_20")]
520    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
521    #[doc(alias = "clear-extensions")]
522    fn connect_clear_extensions<F: Fn(&Self) + Send + Sync + 'static>(
523        &self,
524        f: F,
525    ) -> SignalHandlerId {
526        unsafe extern "C" fn clear_extensions_trampoline<
527            P: IsA<RTPBaseDepayload>,
528            F: Fn(&P) + Send + Sync + 'static,
529        >(
530            this: *mut ffi::GstRTPBaseDepayload,
531            f: glib::ffi::gpointer,
532        ) {
533            let f: &F = &*(f as *const F);
534            f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
535        }
536        unsafe {
537            let f: Box_<F> = Box_::new(f);
538            connect_raw(
539                self.as_ptr() as *mut _,
540                c"clear-extensions".as_ptr() as *const _,
541                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
542                    clear_extensions_trampoline::<Self, F> as *const (),
543                )),
544                Box_::into_raw(f),
545            )
546        }
547    }
548
549    #[cfg(feature = "v1_20")]
550    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
551    fn emit_clear_extensions(&self) {
552        self.emit_by_name::<()>("clear-extensions", &[]);
553    }
554
555    /// The returned `ext` must be configured with the correct `ext_id` and with the
556    /// necessary attributes as required by the extension implementation.
557    /// ## `ext_id`
558    /// the extension id being requested
559    /// ## `ext_uri`
560    /// the extension URI being requested
561    ///
562    /// # Returns
563    ///
564    /// the [`RTPHeaderExtension`][crate::RTPHeaderExtension] for `ext_id`, or [`None`]
565    #[cfg(feature = "v1_20")]
566    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
567    #[doc(alias = "request-extension")]
568    fn connect_request_extension<
569        F: Fn(&Self, u32, Option<&str>) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
570    >(
571        &self,
572        f: F,
573    ) -> SignalHandlerId {
574        unsafe extern "C" fn request_extension_trampoline<
575            P: IsA<RTPBaseDepayload>,
576            F: Fn(&P, u32, Option<&str>) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
577        >(
578            this: *mut ffi::GstRTPBaseDepayload,
579            ext_id: std::ffi::c_uint,
580            ext_uri: *mut std::ffi::c_char,
581            f: glib::ffi::gpointer,
582        ) -> *mut ffi::GstRTPHeaderExtension {
583            let f: &F = &*(f as *const F);
584            f(
585                RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(),
586                ext_id,
587                Option::<glib::GString>::from_glib_borrow(ext_uri)
588                    .as_ref()
589                    .as_ref()
590                    .map(|s| s.as_str()),
591            )
592            .to_glib_full()
593        }
594        unsafe {
595            let f: Box_<F> = Box_::new(f);
596            connect_raw(
597                self.as_ptr() as *mut _,
598                c"request-extension".as_ptr() as *const _,
599                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
600                    request_extension_trampoline::<Self, F> as *const (),
601                )),
602                Box_::into_raw(f),
603            )
604        }
605    }
606
607    #[cfg(feature = "v1_20")]
608    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
609    #[doc(alias = "auto-header-extension")]
610    fn connect_auto_header_extension_notify<F: Fn(&Self) + Send + Sync + 'static>(
611        &self,
612        f: F,
613    ) -> SignalHandlerId {
614        unsafe extern "C" fn notify_auto_header_extension_trampoline<
615            P: IsA<RTPBaseDepayload>,
616            F: Fn(&P) + Send + Sync + 'static,
617        >(
618            this: *mut ffi::GstRTPBaseDepayload,
619            _param_spec: glib::ffi::gpointer,
620            f: glib::ffi::gpointer,
621        ) {
622            let f: &F = &*(f as *const F);
623            f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
624        }
625        unsafe {
626            let f: Box_<F> = Box_::new(f);
627            connect_raw(
628                self.as_ptr() as *mut _,
629                c"notify::auto-header-extension".as_ptr() as *const _,
630                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
631                    notify_auto_header_extension_trampoline::<Self, F> as *const (),
632                )),
633                Box_::into_raw(f),
634            )
635        }
636    }
637
638    #[cfg(feature = "v1_18")]
639    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
640    #[doc(alias = "max-reorder")]
641    fn connect_max_reorder_notify<F: Fn(&Self) + Send + Sync + 'static>(
642        &self,
643        f: F,
644    ) -> SignalHandlerId {
645        unsafe extern "C" fn notify_max_reorder_trampoline<
646            P: IsA<RTPBaseDepayload>,
647            F: Fn(&P) + Send + Sync + 'static,
648        >(
649            this: *mut ffi::GstRTPBaseDepayload,
650            _param_spec: glib::ffi::gpointer,
651            f: glib::ffi::gpointer,
652        ) {
653            let f: &F = &*(f as *const F);
654            f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
655        }
656        unsafe {
657            let f: Box_<F> = Box_::new(f);
658            connect_raw(
659                self.as_ptr() as *mut _,
660                c"notify::max-reorder".as_ptr() as *const _,
661                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
662                    notify_max_reorder_trampoline::<Self, F> as *const (),
663                )),
664                Box_::into_raw(f),
665            )
666        }
667    }
668
669    #[cfg(feature = "v1_16")]
670    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
671    #[doc(alias = "source-info")]
672    fn connect_source_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
673        &self,
674        f: F,
675    ) -> SignalHandlerId {
676        unsafe extern "C" fn notify_source_info_trampoline<
677            P: IsA<RTPBaseDepayload>,
678            F: Fn(&P) + Send + Sync + 'static,
679        >(
680            this: *mut ffi::GstRTPBaseDepayload,
681            _param_spec: glib::ffi::gpointer,
682            f: glib::ffi::gpointer,
683        ) {
684            let f: &F = &*(f as *const F);
685            f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
686        }
687        unsafe {
688            let f: Box_<F> = Box_::new(f);
689            connect_raw(
690                self.as_ptr() as *mut _,
691                c"notify::source-info".as_ptr() as *const _,
692                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
693                    notify_source_info_trampoline::<Self, F> as *const (),
694                )),
695                Box_::into_raw(f),
696            )
697        }
698    }
699
700    #[doc(alias = "stats")]
701    fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
702        unsafe extern "C" fn notify_stats_trampoline<
703            P: IsA<RTPBaseDepayload>,
704            F: Fn(&P) + Send + Sync + 'static,
705        >(
706            this: *mut ffi::GstRTPBaseDepayload,
707            _param_spec: glib::ffi::gpointer,
708            f: glib::ffi::gpointer,
709        ) {
710            let f: &F = &*(f as *const F);
711            f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
712        }
713        unsafe {
714            let f: Box_<F> = Box_::new(f);
715            connect_raw(
716                self.as_ptr() as *mut _,
717                c"notify::stats".as_ptr() as *const _,
718                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
719                    notify_stats_trampoline::<Self, F> as *const (),
720                )),
721                Box_::into_raw(f),
722            )
723        }
724    }
725}
726
727impl<O: IsA<RTPBaseDepayload>> RTPBaseDepayloadExt for O {}