Skip to main content

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
6#[cfg(feature = "v1_20")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
8use crate::RTPHeaderExtension;
9use crate::ffi;
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::{SignalHandlerId, connect_raw},
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            unsafe {
494                let f: &F = &*(f as *const F);
495                f(
496                    RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(),
497                    &from_glib_full(ext),
498                )
499            }
500        }
501        unsafe {
502            let f: Box_<F> = Box_::new(f);
503            connect_raw(
504                self.as_ptr() as *mut _,
505                c"add-extension".as_ptr(),
506                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
507                    add_extension_trampoline::<Self, F> as *const (),
508                )),
509                Box_::into_raw(f),
510            )
511        }
512    }
513
514    #[cfg(feature = "v1_20")]
515    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
516    fn emit_add_extension(&self, ext: &RTPHeaderExtension) {
517        self.emit_by_name::<()>("add-extension", &[&ext]);
518    }
519
520    /// Clear all RTP header extensions used by this depayloader.
521    #[cfg(feature = "v1_20")]
522    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
523    #[doc(alias = "clear-extensions")]
524    fn connect_clear_extensions<F: Fn(&Self) + Send + Sync + 'static>(
525        &self,
526        f: F,
527    ) -> SignalHandlerId {
528        unsafe extern "C" fn clear_extensions_trampoline<
529            P: IsA<RTPBaseDepayload>,
530            F: Fn(&P) + Send + Sync + 'static,
531        >(
532            this: *mut ffi::GstRTPBaseDepayload,
533            f: glib::ffi::gpointer,
534        ) {
535            unsafe {
536                let f: &F = &*(f as *const F);
537                f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
538            }
539        }
540        unsafe {
541            let f: Box_<F> = Box_::new(f);
542            connect_raw(
543                self.as_ptr() as *mut _,
544                c"clear-extensions".as_ptr(),
545                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
546                    clear_extensions_trampoline::<Self, F> as *const (),
547                )),
548                Box_::into_raw(f),
549            )
550        }
551    }
552
553    #[cfg(feature = "v1_20")]
554    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
555    fn emit_clear_extensions(&self) {
556        self.emit_by_name::<()>("clear-extensions", &[]);
557    }
558
559    /// The returned `ext` must be configured with the correct `ext_id` and with the
560    /// necessary attributes as required by the extension implementation.
561    /// ## `ext_id`
562    /// the extension id being requested
563    /// ## `ext_uri`
564    /// the extension URI being requested
565    ///
566    /// # Returns
567    ///
568    /// the [`RTPHeaderExtension`][crate::RTPHeaderExtension] for `ext_id`, or [`None`]
569    #[cfg(feature = "v1_20")]
570    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
571    #[doc(alias = "request-extension")]
572    fn connect_request_extension<
573        F: Fn(&Self, u32, Option<&str>) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
574    >(
575        &self,
576        f: F,
577    ) -> SignalHandlerId {
578        unsafe extern "C" fn request_extension_trampoline<
579            P: IsA<RTPBaseDepayload>,
580            F: Fn(&P, u32, Option<&str>) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
581        >(
582            this: *mut ffi::GstRTPBaseDepayload,
583            ext_id: std::ffi::c_uint,
584            ext_uri: *mut std::ffi::c_char,
585            f: glib::ffi::gpointer,
586        ) -> *mut ffi::GstRTPHeaderExtension {
587            unsafe {
588                let f: &F = &*(f as *const F);
589                f(
590                    RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(),
591                    ext_id,
592                    Option::<glib::GString>::from_glib_borrow(ext_uri)
593                        .as_ref()
594                        .as_ref()
595                        .map(|s| s.as_str()),
596                )
597                .to_glib_full()
598            }
599        }
600        unsafe {
601            let f: Box_<F> = Box_::new(f);
602            connect_raw(
603                self.as_ptr() as *mut _,
604                c"request-extension".as_ptr(),
605                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
606                    request_extension_trampoline::<Self, F> as *const (),
607                )),
608                Box_::into_raw(f),
609            )
610        }
611    }
612
613    #[cfg(feature = "v1_20")]
614    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
615    #[doc(alias = "auto-header-extension")]
616    fn connect_auto_header_extension_notify<F: Fn(&Self) + Send + Sync + 'static>(
617        &self,
618        f: F,
619    ) -> SignalHandlerId {
620        unsafe extern "C" fn notify_auto_header_extension_trampoline<
621            P: IsA<RTPBaseDepayload>,
622            F: Fn(&P) + Send + Sync + 'static,
623        >(
624            this: *mut ffi::GstRTPBaseDepayload,
625            _param_spec: glib::ffi::gpointer,
626            f: glib::ffi::gpointer,
627        ) {
628            unsafe {
629                let f: &F = &*(f as *const F);
630                f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
631            }
632        }
633        unsafe {
634            let f: Box_<F> = Box_::new(f);
635            connect_raw(
636                self.as_ptr() as *mut _,
637                c"notify::auto-header-extension".as_ptr(),
638                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
639                    notify_auto_header_extension_trampoline::<Self, F> as *const (),
640                )),
641                Box_::into_raw(f),
642            )
643        }
644    }
645
646    #[cfg(feature = "v1_18")]
647    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
648    #[doc(alias = "max-reorder")]
649    fn connect_max_reorder_notify<F: Fn(&Self) + Send + Sync + 'static>(
650        &self,
651        f: F,
652    ) -> SignalHandlerId {
653        unsafe extern "C" fn notify_max_reorder_trampoline<
654            P: IsA<RTPBaseDepayload>,
655            F: Fn(&P) + Send + Sync + 'static,
656        >(
657            this: *mut ffi::GstRTPBaseDepayload,
658            _param_spec: glib::ffi::gpointer,
659            f: glib::ffi::gpointer,
660        ) {
661            unsafe {
662                let f: &F = &*(f as *const F);
663                f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
664            }
665        }
666        unsafe {
667            let f: Box_<F> = Box_::new(f);
668            connect_raw(
669                self.as_ptr() as *mut _,
670                c"notify::max-reorder".as_ptr(),
671                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
672                    notify_max_reorder_trampoline::<Self, F> as *const (),
673                )),
674                Box_::into_raw(f),
675            )
676        }
677    }
678
679    #[cfg(feature = "v1_16")]
680    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
681    #[doc(alias = "source-info")]
682    fn connect_source_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
683        &self,
684        f: F,
685    ) -> SignalHandlerId {
686        unsafe extern "C" fn notify_source_info_trampoline<
687            P: IsA<RTPBaseDepayload>,
688            F: Fn(&P) + Send + Sync + 'static,
689        >(
690            this: *mut ffi::GstRTPBaseDepayload,
691            _param_spec: glib::ffi::gpointer,
692            f: glib::ffi::gpointer,
693        ) {
694            unsafe {
695                let f: &F = &*(f as *const F);
696                f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
697            }
698        }
699        unsafe {
700            let f: Box_<F> = Box_::new(f);
701            connect_raw(
702                self.as_ptr() as *mut _,
703                c"notify::source-info".as_ptr(),
704                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
705                    notify_source_info_trampoline::<Self, F> as *const (),
706                )),
707                Box_::into_raw(f),
708            )
709        }
710    }
711
712    #[doc(alias = "stats")]
713    fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
714        unsafe extern "C" fn notify_stats_trampoline<
715            P: IsA<RTPBaseDepayload>,
716            F: Fn(&P) + Send + Sync + 'static,
717        >(
718            this: *mut ffi::GstRTPBaseDepayload,
719            _param_spec: glib::ffi::gpointer,
720            f: glib::ffi::gpointer,
721        ) {
722            unsafe {
723                let f: &F = &*(f as *const F);
724                f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref())
725            }
726        }
727        unsafe {
728            let f: Box_<F> = Box_::new(f);
729            connect_raw(
730                self.as_ptr() as *mut _,
731                c"notify::stats".as_ptr(),
732                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
733                    notify_stats_trampoline::<Self, F> as *const (),
734                )),
735                Box_::into_raw(f),
736            )
737        }
738    }
739}
740
741impl<O: IsA<RTPBaseDepayload>> RTPBaseDepayloadExt for O {}