pub trait RTPBasePayloadExt: IsA<RTPBasePayload> + Sealed + 'static {
Show 58 methods // Provided methods fn allocate_output_buffer( &self, payload_len: u32, pad_len: u8, csrc_count: u8 ) -> Buffer { ... } fn source_count(&self, buffer: &Buffer) -> u32 { ... } fn is_filled( &self, size: u32, duration: impl Into<Option<ClockTime>> ) -> bool { ... } fn is_source_info_enabled(&self) -> bool { ... } fn push(&self, buffer: Buffer) -> Result<FlowSuccess, FlowError> { ... } fn push_list(&self, list: BufferList) -> Result<FlowSuccess, FlowError> { ... } fn set_options( &self, media: &str, dynamic: bool, encoding_name: &str, clock_rate: u32 ) { ... } fn set_source_info_enabled(&self, enable: bool) { ... } fn is_auto_header_extension(&self) -> bool { ... } fn set_auto_header_extension(&self, auto_header_extension: bool) { ... } fn max_ptime(&self) -> i64 { ... } fn set_max_ptime(&self, max_ptime: i64) { ... } fn min_ptime(&self) -> i64 { ... } fn set_min_ptime(&self, min_ptime: i64) { ... } fn mtu(&self) -> u32 { ... } fn set_mtu(&self, mtu: u32) { ... } fn is_onvif_no_rate_control(&self) -> bool { ... } fn set_onvif_no_rate_control(&self, onvif_no_rate_control: bool) { ... } fn is_perfect_rtptime(&self) -> bool { ... } fn set_perfect_rtptime(&self, perfect_rtptime: bool) { ... } fn pt(&self) -> u32 { ... } fn set_pt(&self, pt: u32) { ... } fn ptime_multiple(&self) -> i64 { ... } fn set_ptime_multiple(&self, ptime_multiple: i64) { ... } fn is_scale_rtptime(&self) -> bool { ... } fn set_scale_rtptime(&self, scale_rtptime: bool) { ... } fn seqnum(&self) -> u32 { ... } fn seqnum_offset(&self) -> i32 { ... } fn set_seqnum_offset(&self, seqnum_offset: i32) { ... } fn is_source_info(&self) -> bool { ... } fn set_source_info(&self, source_info: bool) { ... } fn ssrc(&self) -> u32 { ... } fn set_ssrc(&self, ssrc: u32) { ... } fn stats(&self) -> Option<Structure> { ... } fn timestamp(&self) -> u32 { ... } fn timestamp_offset(&self) -> u32 { ... } fn set_timestamp_offset(&self, timestamp_offset: u32) { ... } fn connect_add_extension<F: Fn(&Self, &RTPHeaderExtension) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_add_extension(&self, ext: &RTPHeaderExtension) { ... } fn connect_clear_extensions<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn emit_clear_extensions(&self) { ... } fn connect_request_extension<F: Fn(&Self, u32, &str) -> Option<RTPHeaderExtension> + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_auto_header_extension_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_max_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_min_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_mtu_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_onvif_no_rate_control_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_perfect_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_pt_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_ptime_multiple_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_scale_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_seqnum_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_seqnum_offset_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_source_info_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_ssrc_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_timestamp_offset_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all RTPBasePayload methods.

§Implementors

RTPBasePayload

Provided Methods§

source

fn allocate_output_buffer( &self, payload_len: u32, pad_len: u8, csrc_count: u8 ) -> Buffer

Allocate a new gst::Buffer with enough data to hold an RTP packet with minimum csrc_count CSRCs, a payload length of payload_len and padding of pad_len. If self has source-info true additional CSRCs may be allocated and filled with RTP source information.

§payload_len

the length of the payload

§pad_len

the amount of padding

§csrc_count

the minimum number of CSRC entries

§Returns

A newly allocated buffer that can hold an RTP packet with given parameters.

source

fn source_count(&self, buffer: &Buffer) -> u32

Count the total number of RTP sources found in the meta of buffer, which will be automically added by allocate_output_buffer(). If source-info is false the count will be 0.

§buffer

a gst::Buffer, typically the buffer to payload

§Returns

The number of sources.

source

fn is_filled(&self, size: u32, duration: impl Into<Option<ClockTime>>) -> bool

Check if the packet with size and duration would exceed the configured maximum size.

§size

the size of the packet

§duration

the duration of the packet

§Returns

true if the packet of size and duration would exceed the configured MTU or max_ptime.

source

fn is_source_info_enabled(&self) -> bool

Queries whether the payloader will add contributing sources (CSRCs) to the RTP header from GstRTPSourceMeta.

§Returns

true if source-info is enabled.

source

fn push(&self, buffer: Buffer) -> Result<FlowSuccess, FlowError>

Push buffer to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.

This function takes ownership of buffer.

§buffer

a gst::Buffer

§Returns

a gst::FlowReturn.

source

fn push_list(&self, list: BufferList) -> Result<FlowSuccess, FlowError>

Push list to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.

This function takes ownership of list.

§list

a gst::BufferList

§Returns

a gst::FlowReturn.

source

fn set_options( &self, media: &str, dynamic: bool, encoding_name: &str, clock_rate: u32 )

Set the rtp options of the payloader. These options will be set in the caps of the payloader. Subclasses must call this method before calling push() or gst_rtp_base_payload_set_outcaps().

§media

the media type (typically “audio” or “video”)

§dynamic

if the payload type is dynamic

§encoding_name

the encoding name

§clock_rate

the clock rate of the media

source

fn set_source_info_enabled(&self, enable: bool)

Enable or disable adding contributing sources to RTP packets from GstRTPSourceMeta.

§enable

whether to add contributing sources to RTP packets

source

fn is_auto_header_extension(&self) -> bool

If enabled, the payloader will automatically try to enable all the RTP header extensions provided in the src caps, saving the application the need to handle these extensions manually using the GstRTPBasePayload::request-extension: signal.

source

fn set_auto_header_extension(&self, auto_header_extension: bool)

If enabled, the payloader will automatically try to enable all the RTP header extensions provided in the src caps, saving the application the need to handle these extensions manually using the GstRTPBasePayload::request-extension: signal.

source

fn max_ptime(&self) -> i64

source

fn set_max_ptime(&self, max_ptime: i64)

source

fn min_ptime(&self) -> i64

Minimum duration of the packet data in ns (can’t go above MTU)

source

fn set_min_ptime(&self, min_ptime: i64)

Minimum duration of the packet data in ns (can’t go above MTU)

source

fn mtu(&self) -> u32

source

fn set_mtu(&self, mtu: u32)

source

fn is_onvif_no_rate_control(&self) -> bool

Make the payloader timestamp packets according to the Rate-Control=no behaviour specified in the ONVIF replay spec.

source

fn set_onvif_no_rate_control(&self, onvif_no_rate_control: bool)

Make the payloader timestamp packets according to the Rate-Control=no behaviour specified in the ONVIF replay spec.

source

fn is_perfect_rtptime(&self) -> bool

Try to use the offset fields to generate perfect RTP timestamps. When this option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of each payloaded buffer. The PTSes of buffers may not necessarily increment with the amount of data in each input buffer, consider e.g. the case where the buffer arrives from a network which means that the PTS is unrelated to the amount of data. Because the RTP timestamps are generated from GST_BUFFER_PTS this can result in RTP timestamps that also don’t increment with the amount of data in the payloaded packet. To circumvent this it is possible to set the perfect rtptime option enabled. When this option is enabled the payloader will increment the RTP timestamps based on GST_BUFFER_OFFSET which relates to the amount of data in each packet rather than the GST_BUFFER_PTS of each buffer and therefore the RTP timestamps will more closely correlate with the amount of data in each buffer. Currently GstRTPBasePayload is limited to handling perfect RTP timestamps for audio streams.

source

fn set_perfect_rtptime(&self, perfect_rtptime: bool)

Try to use the offset fields to generate perfect RTP timestamps. When this option is disabled, RTP timestamps are generated from GST_BUFFER_PTS of each payloaded buffer. The PTSes of buffers may not necessarily increment with the amount of data in each input buffer, consider e.g. the case where the buffer arrives from a network which means that the PTS is unrelated to the amount of data. Because the RTP timestamps are generated from GST_BUFFER_PTS this can result in RTP timestamps that also don’t increment with the amount of data in the payloaded packet. To circumvent this it is possible to set the perfect rtptime option enabled. When this option is enabled the payloader will increment the RTP timestamps based on GST_BUFFER_OFFSET which relates to the amount of data in each packet rather than the GST_BUFFER_PTS of each buffer and therefore the RTP timestamps will more closely correlate with the amount of data in each buffer. Currently GstRTPBasePayload is limited to handling perfect RTP timestamps for audio streams.

source

fn pt(&self) -> u32

source

fn set_pt(&self, pt: u32)

source

fn ptime_multiple(&self) -> i64

Force buffers to be multiples of this duration in ns (0 disables)

source

fn set_ptime_multiple(&self, ptime_multiple: i64)

Force buffers to be multiples of this duration in ns (0 disables)

source

fn is_scale_rtptime(&self) -> bool

Make the RTP packets’ timestamps be scaled with the segment’s rate (corresponding to RTSP speed parameter). Disabling this property means the timestamps will not be affected by the set delivery speed (RTSP speed).

Example: A server wants to allow streaming a recorded video in double speed but still have the timestamps correspond to the position in the video. This is achieved by the client setting RTSP Speed to 2 while the server has this property disabled.

source

fn set_scale_rtptime(&self, scale_rtptime: bool)

Make the RTP packets’ timestamps be scaled with the segment’s rate (corresponding to RTSP speed parameter). Disabling this property means the timestamps will not be affected by the set delivery speed (RTSP speed).

Example: A server wants to allow streaming a recorded video in double speed but still have the timestamps correspond to the position in the video. This is achieved by the client setting RTSP Speed to 2 while the server has this property disabled.

source

fn seqnum(&self) -> u32

source

fn seqnum_offset(&self) -> i32

source

fn set_seqnum_offset(&self, seqnum_offset: i32)

source

fn is_source_info(&self) -> bool

Enable writing the CSRC field in allocated RTP header based on RTP source information found in the input buffer’s GstRTPSourceMeta.

source

fn set_source_info(&self, source_info: bool)

Enable writing the CSRC field in allocated RTP header based on RTP source information found in the input buffer’s GstRTPSourceMeta.

source

fn ssrc(&self) -> u32

source

fn set_ssrc(&self, ssrc: u32)

source

fn stats(&self) -> Option<Structure>

Various payloader statistics retrieved atomically (and are therefore synchroized with each other), these can be used e.g. to generate an RTP-Info header. This property return a GstStructure named application/x-rtp-payload-stats containing the following fields relating to the last processed buffer and current state of the stream being payloaded:

  • clock-rate :G_TYPE_UINT, clock-rate of the stream
  • running-time :G_TYPE_UINT64, running time
  • seqnum :G_TYPE_UINT, sequence number, same as seqnum
  • timestamp :G_TYPE_UINT, RTP timestamp, same as timestamp
  • ssrc :G_TYPE_UINT, The SSRC in use
  • pt :G_TYPE_UINT, The Payload type in use, same as pt
  • seqnum-offset :G_TYPE_UINT, The current offset added to the seqnum
  • timestamp-offset :G_TYPE_UINT, The current offset added to the timestamp
source

fn timestamp(&self) -> u32

source

fn timestamp_offset(&self) -> u32

source

fn set_timestamp_offset(&self, timestamp_offset: u32)

source

fn connect_add_extension<F: Fn(&Self, &RTPHeaderExtension) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

Add ext as an extension for writing part of an RTP header extension onto outgoing RTP packets.

§ext

the RTPHeaderExtension

source

fn emit_add_extension(&self, ext: &RTPHeaderExtension)

source

fn connect_clear_extensions<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

Clear all RTP header extensions used by this payloader.

source

fn emit_clear_extensions(&self)

source

fn connect_request_extension<F: Fn(&Self, u32, &str) -> Option<RTPHeaderExtension> + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

The returned ext must be configured with the correct ext_id and with the necessary attributes as required by the extension implementation.

§ext_id

the extension id being requested

§ext_uri

the extension URI being requested

§Returns

the RTPHeaderExtension for ext_id, or None

source

fn connect_auto_header_extension_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_max_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_min_ptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_mtu_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_onvif_no_rate_control_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_perfect_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_pt_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_ptime_multiple_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_scale_rtptime_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_seqnum_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_seqnum_offset_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_source_info_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_ssrc_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_stats_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

source

fn connect_timestamp_offset_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§