Skip to main content

gstreamer_rtp/auto/
rtp_base_payload.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 payloaders
22    ///
23    /// This is an Abstract Base Class, you cannot instantiate it.
24    ///
25    /// ## Properties
26    ///
27    ///
28    /// #### `auto-header-extension`
29    ///  If enabled, the payloader will automatically try to enable all the
30    /// RTP header extensions provided in the src caps, saving the application
31    /// the need to handle these extensions manually using the
32    /// GstRTPBasePayload::request-extension: signal.
33    ///
34    /// Readable | Writeable
35    ///
36    ///
37    /// #### `extensions`
38    ///  A list of already enabled RTP header extensions. This may be useful for finding
39    /// out which extensions are already enabled (with add-extension signal) and picking a non-conflicting
40    /// ID for a new extension that needs to be added on top of the existing ones.
41    ///
42    /// Note that the value returned by reading this property is not dynamically updated when the set of
43    /// enabled extensions changes by any of existing action signals. Rather, it represents the current state
44    /// at the time the property is read.
45    ///
46    /// Dynamic updates of this property can be received by subscribing to its corresponding "notify" signal, i.e.
47    /// "notify::extensions".
48    ///
49    /// Readable
50    ///
51    ///
52    /// #### `max-ptime`
53    ///  Readable | Writeable
54    ///
55    ///
56    /// #### `min-ptime`
57    ///  Minimum duration of the packet data in ns (can't go above MTU)
58    ///
59    /// Readable | Writeable
60    ///
61    ///
62    /// #### `mtu`
63    ///  Readable | Writeable
64    ///
65    ///
66    /// #### `onvif-no-rate-control`
67    ///  Make the payloader timestamp packets according to the Rate-Control=no
68    /// behaviour specified in the ONVIF replay spec.
69    ///
70    /// Readable | Writeable
71    ///
72    ///
73    /// #### `perfect-rtptime`
74    ///  Try to use the offset fields to generate perfect RTP timestamps. When this
75    /// option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of
76    /// each payloaded buffer. The PTSes of buffers may not necessarily increment
77    /// with the amount of data in each input buffer, consider e.g. the case where
78    /// the buffer arrives from a network which means that the PTS is unrelated to
79    /// the amount of data. Because the RTP timestamps are generated from
80    /// GST_BUFFER_PTS this can result in RTP timestamps that also don't increment
81    /// with the amount of data in the payloaded packet. To circumvent this it is
82    /// possible to set the perfect rtptime option enabled. When this option is
83    /// enabled the payloader will increment the RTP timestamps based on
84    /// GST_BUFFER_OFFSET which relates to the amount of data in each packet
85    /// rather than the GST_BUFFER_PTS of each buffer and therefore the RTP
86    /// timestamps will more closely correlate with the amount of data in each
87    /// buffer. Currently GstRTPBasePayload is limited to handling perfect RTP
88    /// timestamps for audio streams.
89    ///
90    /// Readable | Writeable
91    ///
92    ///
93    /// #### `pt`
94    ///  Readable | Writeable
95    ///
96    ///
97    /// #### `ptime-multiple`
98    ///  Force buffers to be multiples of this duration in ns (0 disables)
99    ///
100    /// Readable | Writeable
101    ///
102    ///
103    /// #### `scale-rtptime`
104    ///  Make the RTP packets' timestamps be scaled with the segment's rate
105    /// (corresponding to RTSP speed parameter). Disabling this property means
106    /// the timestamps will not be affected by the set delivery speed (RTSP speed).
107    ///
108    /// Example: A server wants to allow streaming a recorded video in double
109    /// speed but still have the timestamps correspond to the position in the
110    /// video. This is achieved by the client setting RTSP Speed to 2 while the
111    /// server has this property disabled.
112    ///
113    /// Readable | Writeable
114    ///
115    ///
116    /// #### `seqnum`
117    ///  Readable
118    ///
119    ///
120    /// #### `seqnum-offset`
121    ///  Readable | Writeable
122    ///
123    ///
124    /// #### `source-info`
125    ///  Enable writing the CSRC field in allocated RTP header based on RTP source
126    /// information found in the input buffer's `GstRTPSourceMeta`.
127    ///
128    /// Readable | Writeable
129    ///
130    ///
131    /// #### `ssrc`
132    ///  Readable | Writeable
133    ///
134    ///
135    /// #### `stats`
136    ///  Various payloader statistics retrieved atomically (and are therefore
137    /// synchroized with each other), these can be used e.g. to generate an
138    /// RTP-Info header. This property return a GstStructure named
139    /// application/x-rtp-payload-stats containing the following fields relating to
140    /// the last processed buffer and current state of the stream being payloaded:
141    ///
142    ///  * `clock-rate` :`G_TYPE_UINT`, clock-rate of the stream
143    ///  * `running-time` :`G_TYPE_UINT64`, running time
144    ///  * `seqnum` :`G_TYPE_UINT`, sequence number, same as [`seqnum`][struct@crate::RTPBasePayload#seqnum]
145    ///  * `timestamp` :`G_TYPE_UINT`, RTP timestamp, same as [`timestamp`][struct@crate::RTPBasePayload#timestamp]
146    ///  * `ssrc` :`G_TYPE_UINT`, The SSRC in use
147    ///  * `pt` :`G_TYPE_UINT`, The Payload type in use, same as [`pt`][struct@crate::RTPBasePayload#pt]
148    ///  * `seqnum-offset` :`G_TYPE_UINT`, The current offset added to the seqnum
149    ///  * `timestamp-offset` :`G_TYPE_UINT`, The current offset added to the timestamp
150    ///
151    /// Readable
152    ///
153    ///
154    /// #### `timestamp`
155    ///  Readable
156    ///
157    ///
158    /// #### `timestamp-offset`
159    ///  Readable | Writeable
160    /// <details><summary><h4>Object</h4></summary>
161    ///
162    ///
163    /// #### `name`
164    ///  Readable | Writeable | Construct
165    ///
166    ///
167    /// #### `parent`
168    ///  The parent of the object. Please note, that when changing the 'parent'
169    /// property, we don't emit `GObject::notify` and [`deep-notify`][struct@crate::gst::Object#deep-notify]
170    /// signals due to locking issues. In some cases one can use
171    /// `GstBin::element-added` or `GstBin::element-removed` signals on the parent to
172    /// achieve a similar effect.
173    ///
174    /// Readable | Writeable
175    /// </details>
176    ///
177    /// ## Signals
178    ///
179    ///
180    /// #### `add-extension`
181    ///  Add `ext` as an extension for writing part of an RTP header extension onto
182    /// outgoing RTP packets.
183    ///
184    /// Action
185    ///
186    ///
187    /// #### `clear-extensions`
188    ///  Clear all RTP header extensions used by this payloader.
189    ///
190    /// Action
191    ///
192    ///
193    /// #### `request-extension`
194    ///  The returned `ext` must be configured with the correct `ext_id` and with the
195    /// necessary attributes as required by the extension implementation.
196    ///
197    ///
198    /// <details><summary><h4>Element</h4></summary>
199    ///
200    ///
201    /// #### `no-more-pads`
202    ///  This signals that the element will not generate more dynamic pads.
203    /// Note that this signal will usually be emitted from the context of
204    /// the streaming thread.
205    ///
206    ///
207    ///
208    ///
209    /// #### `pad-added`
210    ///  a new `GstPad` has been added to the element. Note that this signal will
211    /// usually be emitted from the context of the streaming thread. Also keep in
212    /// mind that if you add new elements to the pipeline in the signal handler
213    /// you will need to set them to the desired target state with
214    /// [`ElementExtManual::set_state()`][crate::gst::prelude::ElementExtManual::set_state()] or [`ElementExtManual::sync_state_with_parent()`][crate::gst::prelude::ElementExtManual::sync_state_with_parent()].
215    ///
216    ///
217    ///
218    ///
219    /// #### `pad-removed`
220    ///  a `GstPad` has been removed from the element
221    ///
222    ///
223    /// </details>
224    /// <details><summary><h4>Object</h4></summary>
225    ///
226    ///
227    /// #### `deep-notify`
228    ///  The deep notify signal is used to be notified of property changes. It is
229    /// typically attached to the toplevel bin to receive notifications from all
230    /// the elements contained in that bin.
231    ///
232    /// Detailed
233    /// </details>
234    ///
235    /// # Implements
236    ///
237    /// [`RTPBasePayloadExt`][trait@crate::prelude::RTPBasePayloadExt], [`trait@gst::prelude::ElementExt`], [`trait@gst::prelude::ObjectExt`], [`RTPBasePayloadExtManual`][trait@crate::prelude::RTPBasePayloadExtManual]
238    #[doc(alias = "GstRTPBasePayload")]
239    pub struct RTPBasePayload(Object<ffi::GstRTPBasePayload, ffi::GstRTPBasePayloadClass>) @extends gst::Element, gst::Object;
240
241    match fn {
242        type_ => || ffi::gst_rtp_base_payload_get_type(),
243    }
244}
245
246impl RTPBasePayload {
247    pub const NONE: Option<&'static RTPBasePayload> = None;
248}
249
250unsafe impl Send for RTPBasePayload {}
251unsafe impl Sync for RTPBasePayload {}
252
253/// Trait containing all [`struct@RTPBasePayload`] methods.
254///
255/// # Implementors
256///
257/// [`RTPBasePayload`][struct@crate::RTPBasePayload]
258pub trait RTPBasePayloadExt: IsA<RTPBasePayload> + 'static {
259    /// Allocate a new [`gst::Buffer`][crate::gst::Buffer] with enough data to hold an RTP packet with
260    /// minimum `csrc_count` CSRCs, a payload length of `payload_len` and padding of
261    /// `pad_len`. If `self` has [`source-info`][struct@crate::RTPBasePayload#source-info] [`true`] additional
262    /// CSRCs may be allocated and filled with RTP source information.
263    /// ## `payload_len`
264    /// the length of the payload
265    /// ## `pad_len`
266    /// the amount of padding
267    /// ## `csrc_count`
268    /// the minimum number of CSRC entries
269    ///
270    /// # Returns
271    ///
272    /// A newly allocated buffer that can hold an RTP packet with given
273    /// parameters.
274    #[cfg(feature = "v1_16")]
275    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
276    #[doc(alias = "gst_rtp_base_payload_allocate_output_buffer")]
277    fn allocate_output_buffer(&self, payload_len: u32, pad_len: u8, csrc_count: u8) -> gst::Buffer {
278        unsafe {
279            from_glib_full(ffi::gst_rtp_base_payload_allocate_output_buffer(
280                self.as_ref().to_glib_none().0,
281                payload_len,
282                pad_len,
283                csrc_count,
284            ))
285        }
286    }
287
288    /// Count the total number of RTP sources found in the meta of `buffer`, which
289    /// will be automically added by [`allocate_output_buffer()`][Self::allocate_output_buffer()].
290    /// If [`source-info`][struct@crate::RTPBasePayload#source-info] is [`false`] the count will be 0.
291    /// ## `buffer`
292    /// a [`gst::Buffer`][crate::gst::Buffer], typically the buffer to payload
293    ///
294    /// # Returns
295    ///
296    /// The number of sources.
297    #[cfg(feature = "v1_16")]
298    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
299    #[doc(alias = "gst_rtp_base_payload_get_source_count")]
300    #[doc(alias = "get_source_count")]
301    fn source_count(&self, buffer: &gst::Buffer) -> u32 {
302        unsafe {
303            ffi::gst_rtp_base_payload_get_source_count(
304                self.as_ref().to_glib_none().0,
305                buffer.to_glib_none().0,
306            )
307        }
308    }
309
310    /// Check if the packet with `size` and `duration` would exceed the configured
311    /// maximum size.
312    /// ## `size`
313    /// the size of the packet
314    /// ## `duration`
315    /// the duration of the packet
316    ///
317    /// # Returns
318    ///
319    /// [`true`] if the packet of `size` and `duration` would exceed the
320    /// configured MTU or max_ptime.
321    #[doc(alias = "gst_rtp_base_payload_is_filled")]
322    fn is_filled(&self, size: u32, duration: impl Into<Option<gst::ClockTime>>) -> bool {
323        unsafe {
324            from_glib(ffi::gst_rtp_base_payload_is_filled(
325                self.as_ref().to_glib_none().0,
326                size,
327                duration.into().into_glib(),
328            ))
329        }
330    }
331
332    /// Queries whether the payloader will add contributing sources (CSRCs) to the
333    /// RTP header from `GstRTPSourceMeta`.
334    ///
335    /// # Returns
336    ///
337    /// [`true`] if source-info is enabled.
338    #[cfg(feature = "v1_16")]
339    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
340    #[doc(alias = "gst_rtp_base_payload_is_source_info_enabled")]
341    fn is_source_info_enabled(&self) -> bool {
342        unsafe {
343            from_glib(ffi::gst_rtp_base_payload_is_source_info_enabled(
344                self.as_ref().to_glib_none().0,
345            ))
346        }
347    }
348
349    /// Push `buffer` to the peer element of the payloader. The SSRC, payload type,
350    /// seqnum and timestamp of the RTP buffer will be updated first.
351    ///
352    /// This function takes ownership of `buffer`.
353    /// ## `buffer`
354    /// a [`gst::Buffer`][crate::gst::Buffer]
355    ///
356    /// # Returns
357    ///
358    /// a [`gst::FlowReturn`][crate::gst::FlowReturn].
359    #[doc(alias = "gst_rtp_base_payload_push")]
360    fn push(&self, buffer: gst::Buffer) -> Result<gst::FlowSuccess, gst::FlowError> {
361        unsafe {
362            try_from_glib(ffi::gst_rtp_base_payload_push(
363                self.as_ref().to_glib_none().0,
364                buffer.into_glib_ptr(),
365            ))
366        }
367    }
368
369    /// Push `list` to the peer element of the payloader. The SSRC, payload type,
370    /// seqnum and timestamp of the RTP buffer will be updated first.
371    ///
372    /// This function takes ownership of `list`.
373    /// ## `list`
374    /// a [`gst::BufferList`][crate::gst::BufferList]
375    ///
376    /// # Returns
377    ///
378    /// a [`gst::FlowReturn`][crate::gst::FlowReturn].
379    #[doc(alias = "gst_rtp_base_payload_push_list")]
380    fn push_list(&self, list: gst::BufferList) -> Result<gst::FlowSuccess, gst::FlowError> {
381        unsafe {
382            try_from_glib(ffi::gst_rtp_base_payload_push_list(
383                self.as_ref().to_glib_none().0,
384                list.into_glib_ptr(),
385            ))
386        }
387    }
388
389    /// Set the rtp options of the payloader. These options will be set in the caps
390    /// of the payloader. Subclasses must call this method before calling
391    /// [`push()`][Self::push()] or `gst_rtp_base_payload_set_outcaps()`.
392    /// ## `media`
393    /// the media type (typically "audio" or "video")
394    /// ## `dynamic`
395    /// if the payload type is dynamic
396    /// ## `encoding_name`
397    /// the encoding name
398    /// ## `clock_rate`
399    /// the clock rate of the media
400    #[doc(alias = "gst_rtp_base_payload_set_options")]
401    fn set_options(&self, media: &str, dynamic: bool, encoding_name: &str, clock_rate: u32) {
402        unsafe {
403            ffi::gst_rtp_base_payload_set_options(
404                self.as_ref().to_glib_none().0,
405                media.to_glib_none().0,
406                dynamic.into_glib(),
407                encoding_name.to_glib_none().0,
408                clock_rate,
409            );
410        }
411    }
412
413    /// Enable or disable adding contributing sources to RTP packets from
414    /// `GstRTPSourceMeta`.
415    /// ## `enable`
416    /// whether to add contributing sources to RTP packets
417    #[cfg(feature = "v1_16")]
418    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
419    #[doc(alias = "gst_rtp_base_payload_set_source_info_enabled")]
420    fn set_source_info_enabled(&self, enable: bool) {
421        unsafe {
422            ffi::gst_rtp_base_payload_set_source_info_enabled(
423                self.as_ref().to_glib_none().0,
424                enable.into_glib(),
425            );
426        }
427    }
428
429    /// If enabled, the payloader will automatically try to enable all the
430    /// RTP header extensions provided in the src caps, saving the application
431    /// the need to handle these extensions manually using the
432    /// GstRTPBasePayload::request-extension: signal.
433    #[cfg(feature = "v1_20")]
434    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
435    #[doc(alias = "auto-header-extension")]
436    fn is_auto_header_extension(&self) -> bool {
437        ObjectExt::property(self.as_ref(), "auto-header-extension")
438    }
439
440    /// If enabled, the payloader will automatically try to enable all the
441    /// RTP header extensions provided in the src caps, saving the application
442    /// the need to handle these extensions manually using the
443    /// GstRTPBasePayload::request-extension: signal.
444    #[cfg(feature = "v1_20")]
445    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
446    #[doc(alias = "auto-header-extension")]
447    fn set_auto_header_extension(&self, auto_header_extension: bool) {
448        ObjectExt::set_property(
449            self.as_ref(),
450            "auto-header-extension",
451            auto_header_extension,
452        )
453    }
454
455    #[doc(alias = "max-ptime")]
456    fn max_ptime(&self) -> i64 {
457        ObjectExt::property(self.as_ref(), "max-ptime")
458    }
459
460    #[doc(alias = "max-ptime")]
461    fn set_max_ptime(&self, max_ptime: i64) {
462        ObjectExt::set_property(self.as_ref(), "max-ptime", max_ptime)
463    }
464
465    /// Minimum duration of the packet data in ns (can't go above MTU)
466    #[doc(alias = "min-ptime")]
467    fn min_ptime(&self) -> i64 {
468        ObjectExt::property(self.as_ref(), "min-ptime")
469    }
470
471    /// Minimum duration of the packet data in ns (can't go above MTU)
472    #[doc(alias = "min-ptime")]
473    fn set_min_ptime(&self, min_ptime: i64) {
474        ObjectExt::set_property(self.as_ref(), "min-ptime", min_ptime)
475    }
476
477    fn mtu(&self) -> u32 {
478        ObjectExt::property(self.as_ref(), "mtu")
479    }
480
481    fn set_mtu(&self, mtu: u32) {
482        ObjectExt::set_property(self.as_ref(), "mtu", mtu)
483    }
484
485    /// Make the payloader timestamp packets according to the Rate-Control=no
486    /// behaviour specified in the ONVIF replay spec.
487    #[cfg(feature = "v1_16")]
488    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
489    #[doc(alias = "onvif-no-rate-control")]
490    fn is_onvif_no_rate_control(&self) -> bool {
491        ObjectExt::property(self.as_ref(), "onvif-no-rate-control")
492    }
493
494    /// Make the payloader timestamp packets according to the Rate-Control=no
495    /// behaviour specified in the ONVIF replay spec.
496    #[cfg(feature = "v1_16")]
497    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
498    #[doc(alias = "onvif-no-rate-control")]
499    fn set_onvif_no_rate_control(&self, onvif_no_rate_control: bool) {
500        ObjectExt::set_property(
501            self.as_ref(),
502            "onvif-no-rate-control",
503            onvif_no_rate_control,
504        )
505    }
506
507    /// Try to use the offset fields to generate perfect RTP timestamps. When this
508    /// option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of
509    /// each payloaded buffer. The PTSes of buffers may not necessarily increment
510    /// with the amount of data in each input buffer, consider e.g. the case where
511    /// the buffer arrives from a network which means that the PTS is unrelated to
512    /// the amount of data. Because the RTP timestamps are generated from
513    /// GST_BUFFER_PTS this can result in RTP timestamps that also don't increment
514    /// with the amount of data in the payloaded packet. To circumvent this it is
515    /// possible to set the perfect rtptime option enabled. When this option is
516    /// enabled the payloader will increment the RTP timestamps based on
517    /// GST_BUFFER_OFFSET which relates to the amount of data in each packet
518    /// rather than the GST_BUFFER_PTS of each buffer and therefore the RTP
519    /// timestamps will more closely correlate with the amount of data in each
520    /// buffer. Currently GstRTPBasePayload is limited to handling perfect RTP
521    /// timestamps for audio streams.
522    #[doc(alias = "perfect-rtptime")]
523    fn is_perfect_rtptime(&self) -> bool {
524        ObjectExt::property(self.as_ref(), "perfect-rtptime")
525    }
526
527    /// Try to use the offset fields to generate perfect RTP timestamps. When this
528    /// option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of
529    /// each payloaded buffer. The PTSes of buffers may not necessarily increment
530    /// with the amount of data in each input buffer, consider e.g. the case where
531    /// the buffer arrives from a network which means that the PTS is unrelated to
532    /// the amount of data. Because the RTP timestamps are generated from
533    /// GST_BUFFER_PTS this can result in RTP timestamps that also don't increment
534    /// with the amount of data in the payloaded packet. To circumvent this it is
535    /// possible to set the perfect rtptime option enabled. When this option is
536    /// enabled the payloader will increment the RTP timestamps based on
537    /// GST_BUFFER_OFFSET which relates to the amount of data in each packet
538    /// rather than the GST_BUFFER_PTS of each buffer and therefore the RTP
539    /// timestamps will more closely correlate with the amount of data in each
540    /// buffer. Currently GstRTPBasePayload is limited to handling perfect RTP
541    /// timestamps for audio streams.
542    #[doc(alias = "perfect-rtptime")]
543    fn set_perfect_rtptime(&self, perfect_rtptime: bool) {
544        ObjectExt::set_property(self.as_ref(), "perfect-rtptime", perfect_rtptime)
545    }
546
547    fn pt(&self) -> u32 {
548        ObjectExt::property(self.as_ref(), "pt")
549    }
550
551    fn set_pt(&self, pt: u32) {
552        ObjectExt::set_property(self.as_ref(), "pt", pt)
553    }
554
555    /// Force buffers to be multiples of this duration in ns (0 disables)
556    #[doc(alias = "ptime-multiple")]
557    fn ptime_multiple(&self) -> i64 {
558        ObjectExt::property(self.as_ref(), "ptime-multiple")
559    }
560
561    /// Force buffers to be multiples of this duration in ns (0 disables)
562    #[doc(alias = "ptime-multiple")]
563    fn set_ptime_multiple(&self, ptime_multiple: i64) {
564        ObjectExt::set_property(self.as_ref(), "ptime-multiple", ptime_multiple)
565    }
566
567    /// Make the RTP packets' timestamps be scaled with the segment's rate
568    /// (corresponding to RTSP speed parameter). Disabling this property means
569    /// the timestamps will not be affected by the set delivery speed (RTSP speed).
570    ///
571    /// Example: A server wants to allow streaming a recorded video in double
572    /// speed but still have the timestamps correspond to the position in the
573    /// video. This is achieved by the client setting RTSP Speed to 2 while the
574    /// server has this property disabled.
575    #[cfg(feature = "v1_18")]
576    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
577    #[doc(alias = "scale-rtptime")]
578    fn is_scale_rtptime(&self) -> bool {
579        ObjectExt::property(self.as_ref(), "scale-rtptime")
580    }
581
582    /// Make the RTP packets' timestamps be scaled with the segment's rate
583    /// (corresponding to RTSP speed parameter). Disabling this property means
584    /// the timestamps will not be affected by the set delivery speed (RTSP speed).
585    ///
586    /// Example: A server wants to allow streaming a recorded video in double
587    /// speed but still have the timestamps correspond to the position in the
588    /// video. This is achieved by the client setting RTSP Speed to 2 while the
589    /// server has this property disabled.
590    #[cfg(feature = "v1_18")]
591    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
592    #[doc(alias = "scale-rtptime")]
593    fn set_scale_rtptime(&self, scale_rtptime: bool) {
594        ObjectExt::set_property(self.as_ref(), "scale-rtptime", scale_rtptime)
595    }
596
597    fn seqnum(&self) -> u32 {
598        ObjectExt::property(self.as_ref(), "seqnum")
599    }
600
601    #[doc(alias = "seqnum-offset")]
602    fn seqnum_offset(&self) -> i32 {
603        ObjectExt::property(self.as_ref(), "seqnum-offset")
604    }
605
606    #[doc(alias = "seqnum-offset")]
607    fn set_seqnum_offset(&self, seqnum_offset: i32) {
608        ObjectExt::set_property(self.as_ref(), "seqnum-offset", seqnum_offset)
609    }
610
611    /// Enable writing the CSRC field in allocated RTP header based on RTP source
612    /// information found in the input buffer's `GstRTPSourceMeta`.
613    #[cfg(feature = "v1_16")]
614    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
615    #[doc(alias = "source-info")]
616    fn is_source_info(&self) -> bool {
617        ObjectExt::property(self.as_ref(), "source-info")
618    }
619
620    /// Enable writing the CSRC field in allocated RTP header based on RTP source
621    /// information found in the input buffer's `GstRTPSourceMeta`.
622    #[cfg(feature = "v1_16")]
623    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
624    #[doc(alias = "source-info")]
625    fn set_source_info(&self, source_info: bool) {
626        ObjectExt::set_property(self.as_ref(), "source-info", source_info)
627    }
628
629    fn ssrc(&self) -> u32 {
630        ObjectExt::property(self.as_ref(), "ssrc")
631    }
632
633    fn set_ssrc(&self, ssrc: u32) {
634        ObjectExt::set_property(self.as_ref(), "ssrc", ssrc)
635    }
636
637    /// Various payloader statistics retrieved atomically (and are therefore
638    /// synchroized with each other), these can be used e.g. to generate an
639    /// RTP-Info header. This property return a GstStructure named
640    /// application/x-rtp-payload-stats containing the following fields relating to
641    /// the last processed buffer and current state of the stream being payloaded:
642    ///
643    ///  * `clock-rate` :`G_TYPE_UINT`, clock-rate of the stream
644    ///  * `running-time` :`G_TYPE_UINT64`, running time
645    ///  * `seqnum` :`G_TYPE_UINT`, sequence number, same as [`seqnum`][struct@crate::RTPBasePayload#seqnum]
646    ///  * `timestamp` :`G_TYPE_UINT`, RTP timestamp, same as [`timestamp`][struct@crate::RTPBasePayload#timestamp]
647    ///  * `ssrc` :`G_TYPE_UINT`, The SSRC in use
648    ///  * `pt` :`G_TYPE_UINT`, The Payload type in use, same as [`pt`][struct@crate::RTPBasePayload#pt]
649    ///  * `seqnum-offset` :`G_TYPE_UINT`, The current offset added to the seqnum
650    ///  * `timestamp-offset` :`G_TYPE_UINT`, The current offset added to the timestamp
651    fn stats(&self) -> Option<gst::Structure> {
652        ObjectExt::property(self.as_ref(), "stats")
653    }
654
655    fn timestamp(&self) -> u32 {
656        ObjectExt::property(self.as_ref(), "timestamp")
657    }
658
659    #[doc(alias = "timestamp-offset")]
660    fn timestamp_offset(&self) -> u32 {
661        ObjectExt::property(self.as_ref(), "timestamp-offset")
662    }
663
664    #[doc(alias = "timestamp-offset")]
665    fn set_timestamp_offset(&self, timestamp_offset: u32) {
666        ObjectExt::set_property(self.as_ref(), "timestamp-offset", timestamp_offset)
667    }
668
669    /// Add `ext` as an extension for writing part of an RTP header extension onto
670    /// outgoing RTP packets.
671    /// ## `ext`
672    /// the [`RTPHeaderExtension`][crate::RTPHeaderExtension]
673    #[cfg(feature = "v1_20")]
674    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
675    #[doc(alias = "add-extension")]
676    fn connect_add_extension<F: Fn(&Self, &RTPHeaderExtension) + Send + Sync + 'static>(
677        &self,
678        f: F,
679    ) -> SignalHandlerId {
680        unsafe extern "C" fn add_extension_trampoline<
681            P: IsA<RTPBasePayload>,
682            F: Fn(&P, &RTPHeaderExtension) + Send + Sync + 'static,
683        >(
684            this: *mut ffi::GstRTPBasePayload,
685            ext: *mut ffi::GstRTPHeaderExtension,
686            f: glib::ffi::gpointer,
687        ) {
688            unsafe {
689                let f: &F = &*(f as *const F);
690                f(
691                    RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref(),
692                    &from_glib_full(ext),
693                )
694            }
695        }
696        unsafe {
697            let f: Box_<F> = Box_::new(f);
698            connect_raw(
699                self.as_ptr() as *mut _,
700                c"add-extension".as_ptr(),
701                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
702                    add_extension_trampoline::<Self, F> as *const (),
703                )),
704                Box_::into_raw(f),
705            )
706        }
707    }
708
709    #[cfg(feature = "v1_20")]
710    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
711    fn emit_add_extension(&self, ext: &RTPHeaderExtension) {
712        self.emit_by_name::<()>("add-extension", &[&ext]);
713    }
714
715    /// Clear all RTP header extensions used by this payloader.
716    #[cfg(feature = "v1_20")]
717    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
718    #[doc(alias = "clear-extensions")]
719    fn connect_clear_extensions<F: Fn(&Self) + Send + Sync + 'static>(
720        &self,
721        f: F,
722    ) -> SignalHandlerId {
723        unsafe extern "C" fn clear_extensions_trampoline<
724            P: IsA<RTPBasePayload>,
725            F: Fn(&P) + Send + Sync + 'static,
726        >(
727            this: *mut ffi::GstRTPBasePayload,
728            f: glib::ffi::gpointer,
729        ) {
730            unsafe {
731                let f: &F = &*(f as *const F);
732                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
733            }
734        }
735        unsafe {
736            let f: Box_<F> = Box_::new(f);
737            connect_raw(
738                self.as_ptr() as *mut _,
739                c"clear-extensions".as_ptr(),
740                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
741                    clear_extensions_trampoline::<Self, F> as *const (),
742                )),
743                Box_::into_raw(f),
744            )
745        }
746    }
747
748    #[cfg(feature = "v1_20")]
749    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
750    fn emit_clear_extensions(&self) {
751        self.emit_by_name::<()>("clear-extensions", &[]);
752    }
753
754    /// The returned `ext` must be configured with the correct `ext_id` and with the
755    /// necessary attributes as required by the extension implementation.
756    /// ## `ext_id`
757    /// the extension id being requested
758    /// ## `ext_uri`
759    /// the extension URI being requested
760    ///
761    /// # Returns
762    ///
763    /// the [`RTPHeaderExtension`][crate::RTPHeaderExtension] for `ext_id`, or [`None`]
764    #[cfg(feature = "v1_20")]
765    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
766    #[doc(alias = "request-extension")]
767    fn connect_request_extension<
768        F: Fn(&Self, u32, &str) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
769    >(
770        &self,
771        f: F,
772    ) -> SignalHandlerId {
773        unsafe extern "C" fn request_extension_trampoline<
774            P: IsA<RTPBasePayload>,
775            F: Fn(&P, u32, &str) -> Option<RTPHeaderExtension> + Send + Sync + 'static,
776        >(
777            this: *mut ffi::GstRTPBasePayload,
778            ext_id: std::ffi::c_uint,
779            ext_uri: *mut std::ffi::c_char,
780            f: glib::ffi::gpointer,
781        ) -> *mut ffi::GstRTPHeaderExtension {
782            unsafe {
783                let f: &F = &*(f as *const F);
784                f(
785                    RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref(),
786                    ext_id,
787                    &glib::GString::from_glib_borrow(ext_uri),
788                )
789                .to_glib_full()
790            }
791        }
792        unsafe {
793            let f: Box_<F> = Box_::new(f);
794            connect_raw(
795                self.as_ptr() as *mut _,
796                c"request-extension".as_ptr(),
797                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
798                    request_extension_trampoline::<Self, F> as *const (),
799                )),
800                Box_::into_raw(f),
801            )
802        }
803    }
804
805    #[cfg(feature = "v1_20")]
806    #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))]
807    #[doc(alias = "auto-header-extension")]
808    fn connect_auto_header_extension_notify<F: Fn(&Self) + Send + Sync + 'static>(
809        &self,
810        f: F,
811    ) -> SignalHandlerId {
812        unsafe extern "C" fn notify_auto_header_extension_trampoline<
813            P: IsA<RTPBasePayload>,
814            F: Fn(&P) + Send + Sync + 'static,
815        >(
816            this: *mut ffi::GstRTPBasePayload,
817            _param_spec: glib::ffi::gpointer,
818            f: glib::ffi::gpointer,
819        ) {
820            unsafe {
821                let f: &F = &*(f as *const F);
822                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
823            }
824        }
825        unsafe {
826            let f: Box_<F> = Box_::new(f);
827            connect_raw(
828                self.as_ptr() as *mut _,
829                c"notify::auto-header-extension".as_ptr(),
830                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
831                    notify_auto_header_extension_trampoline::<Self, F> as *const (),
832                )),
833                Box_::into_raw(f),
834            )
835        }
836    }
837
838    #[doc(alias = "max-ptime")]
839    fn connect_max_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>(
840        &self,
841        f: F,
842    ) -> SignalHandlerId {
843        unsafe extern "C" fn notify_max_ptime_trampoline<
844            P: IsA<RTPBasePayload>,
845            F: Fn(&P) + Send + Sync + 'static,
846        >(
847            this: *mut ffi::GstRTPBasePayload,
848            _param_spec: glib::ffi::gpointer,
849            f: glib::ffi::gpointer,
850        ) {
851            unsafe {
852                let f: &F = &*(f as *const F);
853                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
854            }
855        }
856        unsafe {
857            let f: Box_<F> = Box_::new(f);
858            connect_raw(
859                self.as_ptr() as *mut _,
860                c"notify::max-ptime".as_ptr(),
861                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
862                    notify_max_ptime_trampoline::<Self, F> as *const (),
863                )),
864                Box_::into_raw(f),
865            )
866        }
867    }
868
869    #[doc(alias = "min-ptime")]
870    fn connect_min_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>(
871        &self,
872        f: F,
873    ) -> SignalHandlerId {
874        unsafe extern "C" fn notify_min_ptime_trampoline<
875            P: IsA<RTPBasePayload>,
876            F: Fn(&P) + Send + Sync + 'static,
877        >(
878            this: *mut ffi::GstRTPBasePayload,
879            _param_spec: glib::ffi::gpointer,
880            f: glib::ffi::gpointer,
881        ) {
882            unsafe {
883                let f: &F = &*(f as *const F);
884                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
885            }
886        }
887        unsafe {
888            let f: Box_<F> = Box_::new(f);
889            connect_raw(
890                self.as_ptr() as *mut _,
891                c"notify::min-ptime".as_ptr(),
892                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
893                    notify_min_ptime_trampoline::<Self, F> as *const (),
894                )),
895                Box_::into_raw(f),
896            )
897        }
898    }
899
900    #[doc(alias = "mtu")]
901    fn connect_mtu_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
902        unsafe extern "C" fn notify_mtu_trampoline<
903            P: IsA<RTPBasePayload>,
904            F: Fn(&P) + Send + Sync + 'static,
905        >(
906            this: *mut ffi::GstRTPBasePayload,
907            _param_spec: glib::ffi::gpointer,
908            f: glib::ffi::gpointer,
909        ) {
910            unsafe {
911                let f: &F = &*(f as *const F);
912                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
913            }
914        }
915        unsafe {
916            let f: Box_<F> = Box_::new(f);
917            connect_raw(
918                self.as_ptr() as *mut _,
919                c"notify::mtu".as_ptr(),
920                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
921                    notify_mtu_trampoline::<Self, F> as *const (),
922                )),
923                Box_::into_raw(f),
924            )
925        }
926    }
927
928    #[cfg(feature = "v1_16")]
929    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
930    #[doc(alias = "onvif-no-rate-control")]
931    fn connect_onvif_no_rate_control_notify<F: Fn(&Self) + Send + Sync + 'static>(
932        &self,
933        f: F,
934    ) -> SignalHandlerId {
935        unsafe extern "C" fn notify_onvif_no_rate_control_trampoline<
936            P: IsA<RTPBasePayload>,
937            F: Fn(&P) + Send + Sync + 'static,
938        >(
939            this: *mut ffi::GstRTPBasePayload,
940            _param_spec: glib::ffi::gpointer,
941            f: glib::ffi::gpointer,
942        ) {
943            unsafe {
944                let f: &F = &*(f as *const F);
945                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
946            }
947        }
948        unsafe {
949            let f: Box_<F> = Box_::new(f);
950            connect_raw(
951                self.as_ptr() as *mut _,
952                c"notify::onvif-no-rate-control".as_ptr(),
953                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
954                    notify_onvif_no_rate_control_trampoline::<Self, F> as *const (),
955                )),
956                Box_::into_raw(f),
957            )
958        }
959    }
960
961    #[doc(alias = "perfect-rtptime")]
962    fn connect_perfect_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>(
963        &self,
964        f: F,
965    ) -> SignalHandlerId {
966        unsafe extern "C" fn notify_perfect_rtptime_trampoline<
967            P: IsA<RTPBasePayload>,
968            F: Fn(&P) + Send + Sync + 'static,
969        >(
970            this: *mut ffi::GstRTPBasePayload,
971            _param_spec: glib::ffi::gpointer,
972            f: glib::ffi::gpointer,
973        ) {
974            unsafe {
975                let f: &F = &*(f as *const F);
976                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
977            }
978        }
979        unsafe {
980            let f: Box_<F> = Box_::new(f);
981            connect_raw(
982                self.as_ptr() as *mut _,
983                c"notify::perfect-rtptime".as_ptr(),
984                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
985                    notify_perfect_rtptime_trampoline::<Self, F> as *const (),
986                )),
987                Box_::into_raw(f),
988            )
989        }
990    }
991
992    #[doc(alias = "pt")]
993    fn connect_pt_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
994        unsafe extern "C" fn notify_pt_trampoline<
995            P: IsA<RTPBasePayload>,
996            F: Fn(&P) + Send + Sync + 'static,
997        >(
998            this: *mut ffi::GstRTPBasePayload,
999            _param_spec: glib::ffi::gpointer,
1000            f: glib::ffi::gpointer,
1001        ) {
1002            unsafe {
1003                let f: &F = &*(f as *const F);
1004                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1005            }
1006        }
1007        unsafe {
1008            let f: Box_<F> = Box_::new(f);
1009            connect_raw(
1010                self.as_ptr() as *mut _,
1011                c"notify::pt".as_ptr(),
1012                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1013                    notify_pt_trampoline::<Self, F> as *const (),
1014                )),
1015                Box_::into_raw(f),
1016            )
1017        }
1018    }
1019
1020    #[doc(alias = "ptime-multiple")]
1021    fn connect_ptime_multiple_notify<F: Fn(&Self) + Send + Sync + 'static>(
1022        &self,
1023        f: F,
1024    ) -> SignalHandlerId {
1025        unsafe extern "C" fn notify_ptime_multiple_trampoline<
1026            P: IsA<RTPBasePayload>,
1027            F: Fn(&P) + Send + Sync + 'static,
1028        >(
1029            this: *mut ffi::GstRTPBasePayload,
1030            _param_spec: glib::ffi::gpointer,
1031            f: glib::ffi::gpointer,
1032        ) {
1033            unsafe {
1034                let f: &F = &*(f as *const F);
1035                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1036            }
1037        }
1038        unsafe {
1039            let f: Box_<F> = Box_::new(f);
1040            connect_raw(
1041                self.as_ptr() as *mut _,
1042                c"notify::ptime-multiple".as_ptr(),
1043                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1044                    notify_ptime_multiple_trampoline::<Self, F> as *const (),
1045                )),
1046                Box_::into_raw(f),
1047            )
1048        }
1049    }
1050
1051    #[cfg(feature = "v1_18")]
1052    #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1053    #[doc(alias = "scale-rtptime")]
1054    fn connect_scale_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>(
1055        &self,
1056        f: F,
1057    ) -> SignalHandlerId {
1058        unsafe extern "C" fn notify_scale_rtptime_trampoline<
1059            P: IsA<RTPBasePayload>,
1060            F: Fn(&P) + Send + Sync + 'static,
1061        >(
1062            this: *mut ffi::GstRTPBasePayload,
1063            _param_spec: glib::ffi::gpointer,
1064            f: glib::ffi::gpointer,
1065        ) {
1066            unsafe {
1067                let f: &F = &*(f as *const F);
1068                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1069            }
1070        }
1071        unsafe {
1072            let f: Box_<F> = Box_::new(f);
1073            connect_raw(
1074                self.as_ptr() as *mut _,
1075                c"notify::scale-rtptime".as_ptr(),
1076                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1077                    notify_scale_rtptime_trampoline::<Self, F> as *const (),
1078                )),
1079                Box_::into_raw(f),
1080            )
1081        }
1082    }
1083
1084    #[doc(alias = "seqnum")]
1085    fn connect_seqnum_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1086        unsafe extern "C" fn notify_seqnum_trampoline<
1087            P: IsA<RTPBasePayload>,
1088            F: Fn(&P) + Send + Sync + 'static,
1089        >(
1090            this: *mut ffi::GstRTPBasePayload,
1091            _param_spec: glib::ffi::gpointer,
1092            f: glib::ffi::gpointer,
1093        ) {
1094            unsafe {
1095                let f: &F = &*(f as *const F);
1096                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1097            }
1098        }
1099        unsafe {
1100            let f: Box_<F> = Box_::new(f);
1101            connect_raw(
1102                self.as_ptr() as *mut _,
1103                c"notify::seqnum".as_ptr(),
1104                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1105                    notify_seqnum_trampoline::<Self, F> as *const (),
1106                )),
1107                Box_::into_raw(f),
1108            )
1109        }
1110    }
1111
1112    #[doc(alias = "seqnum-offset")]
1113    fn connect_seqnum_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1114        &self,
1115        f: F,
1116    ) -> SignalHandlerId {
1117        unsafe extern "C" fn notify_seqnum_offset_trampoline<
1118            P: IsA<RTPBasePayload>,
1119            F: Fn(&P) + Send + Sync + 'static,
1120        >(
1121            this: *mut ffi::GstRTPBasePayload,
1122            _param_spec: glib::ffi::gpointer,
1123            f: glib::ffi::gpointer,
1124        ) {
1125            unsafe {
1126                let f: &F = &*(f as *const F);
1127                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1128            }
1129        }
1130        unsafe {
1131            let f: Box_<F> = Box_::new(f);
1132            connect_raw(
1133                self.as_ptr() as *mut _,
1134                c"notify::seqnum-offset".as_ptr(),
1135                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1136                    notify_seqnum_offset_trampoline::<Self, F> as *const (),
1137                )),
1138                Box_::into_raw(f),
1139            )
1140        }
1141    }
1142
1143    #[cfg(feature = "v1_16")]
1144    #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
1145    #[doc(alias = "source-info")]
1146    fn connect_source_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
1147        &self,
1148        f: F,
1149    ) -> SignalHandlerId {
1150        unsafe extern "C" fn notify_source_info_trampoline<
1151            P: IsA<RTPBasePayload>,
1152            F: Fn(&P) + Send + Sync + 'static,
1153        >(
1154            this: *mut ffi::GstRTPBasePayload,
1155            _param_spec: glib::ffi::gpointer,
1156            f: glib::ffi::gpointer,
1157        ) {
1158            unsafe {
1159                let f: &F = &*(f as *const F);
1160                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1161            }
1162        }
1163        unsafe {
1164            let f: Box_<F> = Box_::new(f);
1165            connect_raw(
1166                self.as_ptr() as *mut _,
1167                c"notify::source-info".as_ptr(),
1168                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1169                    notify_source_info_trampoline::<Self, F> as *const (),
1170                )),
1171                Box_::into_raw(f),
1172            )
1173        }
1174    }
1175
1176    #[doc(alias = "ssrc")]
1177    fn connect_ssrc_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1178        unsafe extern "C" fn notify_ssrc_trampoline<
1179            P: IsA<RTPBasePayload>,
1180            F: Fn(&P) + Send + Sync + 'static,
1181        >(
1182            this: *mut ffi::GstRTPBasePayload,
1183            _param_spec: glib::ffi::gpointer,
1184            f: glib::ffi::gpointer,
1185        ) {
1186            unsafe {
1187                let f: &F = &*(f as *const F);
1188                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1189            }
1190        }
1191        unsafe {
1192            let f: Box_<F> = Box_::new(f);
1193            connect_raw(
1194                self.as_ptr() as *mut _,
1195                c"notify::ssrc".as_ptr(),
1196                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1197                    notify_ssrc_trampoline::<Self, F> as *const (),
1198                )),
1199                Box_::into_raw(f),
1200            )
1201        }
1202    }
1203
1204    #[doc(alias = "stats")]
1205    fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
1206        unsafe extern "C" fn notify_stats_trampoline<
1207            P: IsA<RTPBasePayload>,
1208            F: Fn(&P) + Send + Sync + 'static,
1209        >(
1210            this: *mut ffi::GstRTPBasePayload,
1211            _param_spec: glib::ffi::gpointer,
1212            f: glib::ffi::gpointer,
1213        ) {
1214            unsafe {
1215                let f: &F = &*(f as *const F);
1216                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1217            }
1218        }
1219        unsafe {
1220            let f: Box_<F> = Box_::new(f);
1221            connect_raw(
1222                self.as_ptr() as *mut _,
1223                c"notify::stats".as_ptr(),
1224                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1225                    notify_stats_trampoline::<Self, F> as *const (),
1226                )),
1227                Box_::into_raw(f),
1228            )
1229        }
1230    }
1231
1232    #[doc(alias = "timestamp")]
1233    fn connect_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(
1234        &self,
1235        f: F,
1236    ) -> SignalHandlerId {
1237        unsafe extern "C" fn notify_timestamp_trampoline<
1238            P: IsA<RTPBasePayload>,
1239            F: Fn(&P) + Send + Sync + 'static,
1240        >(
1241            this: *mut ffi::GstRTPBasePayload,
1242            _param_spec: glib::ffi::gpointer,
1243            f: glib::ffi::gpointer,
1244        ) {
1245            unsafe {
1246                let f: &F = &*(f as *const F);
1247                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1248            }
1249        }
1250        unsafe {
1251            let f: Box_<F> = Box_::new(f);
1252            connect_raw(
1253                self.as_ptr() as *mut _,
1254                c"notify::timestamp".as_ptr(),
1255                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1256                    notify_timestamp_trampoline::<Self, F> as *const (),
1257                )),
1258                Box_::into_raw(f),
1259            )
1260        }
1261    }
1262
1263    #[doc(alias = "timestamp-offset")]
1264    fn connect_timestamp_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
1265        &self,
1266        f: F,
1267    ) -> SignalHandlerId {
1268        unsafe extern "C" fn notify_timestamp_offset_trampoline<
1269            P: IsA<RTPBasePayload>,
1270            F: Fn(&P) + Send + Sync + 'static,
1271        >(
1272            this: *mut ffi::GstRTPBasePayload,
1273            _param_spec: glib::ffi::gpointer,
1274            f: glib::ffi::gpointer,
1275        ) {
1276            unsafe {
1277                let f: &F = &*(f as *const F);
1278                f(RTPBasePayload::from_glib_borrow(this).unsafe_cast_ref())
1279            }
1280        }
1281        unsafe {
1282            let f: Box_<F> = Box_::new(f);
1283            connect_raw(
1284                self.as_ptr() as *mut _,
1285                c"notify::timestamp-offset".as_ptr(),
1286                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1287                    notify_timestamp_offset_trampoline::<Self, F> as *const (),
1288                )),
1289                Box_::into_raw(f),
1290            )
1291        }
1292    }
1293}
1294
1295impl<O: IsA<RTPBasePayload>> RTPBasePayloadExt for O {}