RTPBaseAudioPayload

Provides a base class for audio RTP payloaders for frame or sample based audio codecs (constant bitrate)

This class derives from GstRTPBasePayload. It can be used for payloading audio codecs. It will only work with constant bitrate codecs. It supports both frame based and sample based codecs. It takes care of packing up the audio data into RTP packets and filling up the headers accordingly. The payloading is done based on the maximum MTU (mtu) and the maximum time per packet (max-ptime). The general idea is to divide large data buffers into smaller RTP packets. The RTP packet size is the minimum of either the MTU, max-ptime (if set) or available data. The RTP packet size is always larger or equal to min-ptime (if set). If min-ptime is not set, any residual data is sent in a last RTP packet. In the case of frame based codecs, the resulting RTP packets always contain full frames.

Usage

To use this base class, your child element needs to call either gstrtp.rtpbase_audio_payload.RTPBaseAudioPayload.setFrameBased or gstrtp.rtpbase_audio_payload.RTPBaseAudioPayload.setSampleBased. This is usually done in the element's _init() function. Then, the child element must call either gstrtp.rtpbase_audio_payload.RTPBaseAudioPayload.setFrameOptions, gstrtp.rtpbase_audio_payload.RTPBaseAudioPayload.setSampleOptions or gst_rtp_base_audio_payload_set_samplebits_options. Since GstRTPBaseAudioPayload derives from GstRTPBasePayload, the child element must set any variables or call/override any functions required by that base class. The child element does not need to override any other functions specific to GstRTPBaseAudioPayload.

Members

Functions

flush
gst.types.FlowReturn flush(uint payloadLen, gst.types.ClockTime timestamp)

Create an RTP buffer and store payload_len bytes of the adapter as the payload. Set the timestamp on the new buffer to timestamp before pushing the buffer downstream.

getAdapter
gstbase.adapter.Adapter getAdapter()

Gets the internal adapter used by the depayloader.

push
gst.types.FlowReturn push(ubyte[] data, gst.types.ClockTime timestamp)

Create an RTP buffer and store payload_len bytes of data as the payload. Set the timestamp on the new buffer to timestamp before pushing the buffer downstream.

setFrameBased
void setFrameBased()

Tells #GstRTPBaseAudioPayload that the child element is for a frame based audio codec

setFrameOptions
void setFrameOptions(int frameDuration, int frameSize)

Sets the options for frame based audio codecs.

setSampleBased
void setSampleBased()

Tells #GstRTPBaseAudioPayload that the child element is for a sample based audio codec

setSampleOptions
void setSampleOptions(int sampleSize)

Sets the options for sample based audio codecs.

setSamplebitsOptions
void setSamplebitsOptions(int sampleSize)

Sets the options for sample based audio codecs.

Inherited Members

From RTPBasePayload

allocateOutputBuffer
gst.buffer.Buffer allocateOutputBuffer(uint payloadLen, ubyte padLen, ubyte csrcCount)

Allocate a new #GstBuffer 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 payload has #GstRTPBasePayload:source-info true additional CSRCs may be allocated and filled with RTP source information.

getSourceCount
uint getSourceCount(gst.buffer.Buffer buffer)

Count the total number of RTP sources found in the meta of buffer, which will be automically added by gstrtp.rtpbase_payload.RTPBasePayload.allocateOutputBuffer. If #GstRTPBasePayload:source-info is false the count will be 0.

isFilled
bool isFilled(uint size, gst.types.ClockTime duration)

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

isSourceInfoEnabled
bool isSourceInfoEnabled()

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

push
gst.types.FlowReturn push(gst.buffer.Buffer buffer)

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

pushList
gst.types.FlowReturn pushList(gst.buffer_list.BufferList list)

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

setOptions
void setOptions(string media, bool dynamic, string encodingName, uint clockRate)

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 gstrtp.rtpbase_payload.RTPBasePayload.push or gstrtp.rtpbase_payload.RTPBasePayload.setOutcaps.

setOutcapsStructure
bool setOutcapsStructure(gst.structure.Structure s)

Configure the output caps with the optional fields.

setSourceInfoEnabled
void setSourceInfoEnabled(bool enable)

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

connectAddExtension
ulong connectAddExtension(T callback, Flag!"After" after)

Connect to AddExtension signal.

connectClearExtensions
ulong connectClearExtensions(T callback, Flag!"After" after)

Connect to ClearExtensions signal.

connectRequestExtension
ulong connectRequestExtension(T callback, Flag!"After" after)

Connect to RequestExtension signal.