Note: The API in this module is not yet declared stable.
The GstRTPCBuffer helper functions makes it easy to parse and create regular
#GstBuffer objects that contain compound RTCP packets. These buffers are typically
of 'application/x-rtcp' #GstCaps.
An RTCP buffer consists of 1 or more #GstRTCPPacket structures that you can
retrieve with gst_rtcp_buffer_get_first_packet(). #GstRTCPPacket acts as a pointer
into the RTCP buffer; you can move to the next packet with
gst_rtcp_packet_move_to_next().
Add a new packet of @type to @rtcp. @packet will point to the newly created
packet.
%TRUE if the packet could be created. This function returns %FALSE
if the max mtu is exceeded for the buffer.
a valid RTCP buffer
the #GstRTCPType of the new packet
pointer to new packet
Initialize a new #GstRTCPPacket pointer that points to the first packet in
@rtcp.
TRUE if the packet existed in @rtcp.
a valid RTCP buffer
a #GstRTCPPacket
Get the number of RTCP packets in @rtcp.
the number of RTCP packets in @rtcp.
a valid RTCP buffer
Finish @rtcp after being constructed. This function is usually called
after gst_rtcp_buffer_map() and after adding the RTCP items to the new buffer.
The function adjusts the size of @rtcp with the total length of all the
added packets.
a buffer with an RTCP packet
Open @buffer for reading or writing, depending on @flags. The resulting RTCP
buffer state is stored in @rtcp.
a buffer with an RTCP packet
flags for the mapping
resulting #GstRTCPBuffer
Create a new buffer for constructing RTCP packets. The packet will have a
maximum size of @mtu.
A newly allocated buffer.
the maximum mtu size.
Create a new buffer and set the data to a copy of @len
bytes of @data and the size to @len. The data will be freed when the buffer
is freed.
A newly allocated buffer with a copy of @data and of size @len.
data for the new buffer
the length of data
Create a new buffer and set the data and size of the buffer to @data and @len
respectively. @data will be freed when the buffer is unreffed, so this
function transfers ownership of @data to the new buffer.
A newly allocated buffer with @data and of size @len.
data for the new buffer
the length of data
Check if the data pointed to by @buffer is a valid RTCP packet using
gst_rtcp_buffer_validate_data().
TRUE if @buffer is a valid RTCP packet.
the buffer to validate
Check if the @data and @size point to the data of a valid compound,
non-reduced size RTCP packet.
Use this function to validate a packet before using the other functions in
this module.
TRUE if the data points to a valid RTCP packet.
the data to validate
the length of @data to validate
Check if the @data and @size point to the data of a valid RTCP packet.
Use this function to validate a packet before using the other functions in
this module.
This function is updated to support reduced size rtcp packets according to
RFC 5506 and will validate full compound RTCP packets as well as reduced
size RTCP packets.
TRUE if the data points to a valid RTCP packet.
the data to validate
the length of @data to validate
Check if the data pointed to by @buffer is a valid RTCP packet using
gst_rtcp_buffer_validate_reduced().
TRUE if @buffer is a valid RTCP packet.
the buffer to validate
Different types of feedback messages.
Invalid type
Generic NACK
Temporary Maximum Media Stream Bit Rate Request
Temporary Maximum Media Stream Bit Rate
Notification
Request an SR packet for early
synchronization
Picture Loss Indication
Slice Loss Indication
Reference Picture Selection Indication
Application layer Feedback
Full Intra Request Command
Temporal-Spatial Trade-off Request
Temporal-Spatial Trade-off Notification
Video Back Channel Message
Data structure that points to a packet at @offset in @buffer.
The size of the structure is made public to allow stack allocations.
pointer to RTCP buffer
offset of packet in buffer data
Add profile-specific extension @data to @packet. If @packet already
contains profile-specific extension @data will be appended to the existing
extension.
%TRUE if the profile specific extension data was added.
a valid SR or RR #GstRTCPPacket
profile-specific data
length of the profile-specific data in bytes
Add a new report block to @packet with the given values.
%TRUE if the packet was created. This function can return %FALSE if
the max MTU is exceeded or the number of report blocks is greater than
#GST_RTCP_MAX_RB_COUNT.
a valid SR or RR #GstRTCPPacket
data source being reported
fraction lost since last SR/RR
the cumululative number of packets lost
the extended last sequence number received
the interarrival jitter
the last SR packet from this source
the delay since last SR packet
Get the application-dependent data attached to a RTPFB or PSFB @packet.
A pointer to the data
a valid APP #GstRTCPPacket
Get the length of the application-dependent data attached to an APP
@packet.
The length of data in 32-bit words.
a valid APP #GstRTCPPacket
Get the name field of the APP @packet.
The 4-byte name field, not zero-terminated.
a valid APP #GstRTCPPacket
Get the SSRC/CSRC field of the APP @packet.
The SSRC/CSRC.
a valid APP #GstRTCPPacket
Get the subtype field of the APP @packet.
The subtype.
a valid APP #GstRTCPPacket
Set the length of the application-dependent data attached to an APP
@packet.
%TRUE if there was enough space in the packet to add this much
data.
a valid APP #GstRTCPPacket
Length of the data in 32-bit words
Set the name field of the APP @packet.
a valid APP #GstRTCPPacket
4-byte ASCII name
Set the SSRC/CSRC field of the APP @packet.
a valid APP #GstRTCPPacket
SSRC/CSRC of the packet
Set the subtype field of the APP @packet.
a valid APP #GstRTCPPacket
subtype of the packet
Add @ssrc to the BYE @packet.
%TRUE if the ssrc was added. This function can return %FALSE if
the max MTU is exceeded or the number of sources blocks is greater than
#GST_RTCP_MAX_BYE_SSRC_COUNT.
a valid BYE #GstRTCPPacket
an SSRC to add
Adds @len SSRCs in @ssrc to BYE @packet.
%TRUE if the all the SSRCs were added. This function can return %FALSE if
the max MTU is exceeded or the number of sources blocks is greater than
#GST_RTCP_MAX_BYE_SSRC_COUNT.
a valid BYE #GstRTCPPacket
an array of SSRCs to add
number of elements in @ssrc
Get the @nth SSRC of the BYE @packet.
The @nth SSRC of @packet.
a valid BYE #GstRTCPPacket
the nth SSRC to get
Get the reason in @packet.
The reason for the BYE @packet or NULL if the packet did not contain
a reason string. The string must be freed with g_free() after usage.
a valid BYE #GstRTCPPacket
Get the length of the reason string.
The length of the reason string or 0 when there is no reason string
present.
a valid BYE #GstRTCPPacket
Get the number of SSRC fields in @packet.
The number of SSRC fields in @packet.
a valid BYE #GstRTCPPacket
Set the reason string to @reason in @packet.
TRUE if the string could be set.
a valid BYE #GstRTCPPacket
a reason string
The profile-specific extension data is copied into a new allocated
memory area @data. This must be freed with g_free() after usage.
%TRUE if there was valid data.
a valid SR or RR #GstRTCPPacket
result profile-specific data
length of the profile-specific extension data
Get the Feedback Control Information attached to a RTPFB or PSFB @packet.
a pointer to the FCI
a valid RTPFB or PSFB #GstRTCPPacket
Get the length of the Feedback Control Information attached to a
RTPFB or PSFB @packet.
The length of the FCI in 32-bit words.
a valid RTPFB or PSFB #GstRTCPPacket
Get the media SSRC field of the RTPFB or PSFB @packet.
the media SSRC.
a valid RTPFB or PSFB #GstRTCPPacket
Get the sender SSRC field of the RTPFB or PSFB @packet.
the sender SSRC.
a valid RTPFB or PSFB #GstRTCPPacket
Get the feedback message type of the FB @packet.
The feedback message type.
a valid RTPFB or PSFB #GstRTCPPacket
Set the length of the Feedback Control Information attached to a
RTPFB or PSFB @packet.
%TRUE if there was enough space in the packet to add this much FCI
a valid RTPFB or PSFB #GstRTCPPacket
Length of the FCI in 32-bit words
Set the media SSRC field of the RTPFB or PSFB @packet.
a valid RTPFB or PSFB #GstRTCPPacket
a media SSRC
Set the sender SSRC field of the RTPFB or PSFB @packet.
a valid RTPFB or PSFB #GstRTCPPacket
a sender SSRC
Set the feedback message type of the FB @packet.
a valid RTPFB or PSFB #GstRTCPPacket
the #GstRTCPFBType to set
Get the count field in @packet.
The count field in @packet or -1 if @packet does not point to a
valid packet.
a valid #GstRTCPPacket
Get the length field of @packet. This is the length of the packet in
32-bit words minus one.
The length field of @packet.
a valid #GstRTCPPacket
Get the packet padding of the packet pointed to by @packet.
If the packet has the padding bit set.
a valid #GstRTCPPacket
%TRUE if there was valid data.
a valid SR or RR #GstRTCPPacket
result profile-specific data
result length of the profile-specific data
The number of 32-bit words containing profile-specific extension
data from @packet.
a valid SR or RR #GstRTCPPacket
Parse the values of the @nth report block in @packet and store the result in
the values.
a valid SR or RR #GstRTCPPacket
the nth report block in @packet
result for data source being reported
result for fraction lost since last SR/RR
result for the cumululative number of packets lost
result for the extended last sequence number received
result for the interarrival jitter
result for the last SR packet from this source
result for the delay since last SR packet
Get the number of report blocks in @packet.
The number of report blocks in @packet.
a valid SR or RR #GstRTCPPacket
Get the packet type of the packet pointed to by @packet.
The packet type or GST_RTCP_TYPE_INVALID when @packet is not
pointing to a valid packet.
a valid #GstRTCPPacket
Move the packet pointer @packet to the next packet in the payload.
Use gst_rtcp_buffer_get_first_packet() to initialize @packet.
TRUE if @packet is pointing to a valid packet after calling this
function.
a #GstRTCPPacket
Removes the packet pointed to by @packet and moves pointer to the next one
TRUE if @packet is pointing to a valid packet after calling this
function.
a #GstRTCPPacket
Get the ssrc field of the RR @packet.
the ssrc.
a valid RR #GstRTCPPacket
Set the ssrc field of the RR @packet.
a valid RR #GstRTCPPacket
the SSRC to set
Add a new SDES entry to the current item in @packet.
%TRUE if the item could be added, %FALSE if the MTU has been
reached.
a valid SDES #GstRTCPPacket
the #GstRTCPSDESType of the SDES entry
the data length
the data
Add a new SDES item for @ssrc to @packet.
%TRUE if the item could be added, %FALSE if the maximum amount of
items has been exceeded for the SDES packet or the MTU has been reached.
a valid SDES #GstRTCPPacket
the SSRC of the new item to add
This function is like gst_rtcp_packet_sdes_get_entry() but it returns a
null-terminated copy of the data instead. use g_free() after usage.
%TRUE if there was valid data.
a valid SDES #GstRTCPPacket
result of the entry type
result length of the entry data
result entry data
Move to the first SDES entry in the current item.
%TRUE if there was a first entry.
a valid SDES #GstRTCPPacket
Move to the first SDES item in @packet.
TRUE if there was a first item.
a valid SDES #GstRTCPPacket
Get the data of the current SDES item entry. @type (when not NULL) will
contain the type of the entry. @data (when not NULL) will point to @len
bytes.
When @type refers to a text item, @data will point to a UTF8 string. Note
that this UTF8 string is NOT null-terminated. Use
gst_rtcp_packet_sdes_copy_entry() to get a null-terminated copy of the entry.
%TRUE if there was valid data.
a valid SDES #GstRTCPPacket
result of the entry type
result length of the entry data
result entry data
Get the number of items in the SDES packet @packet.
The number of items in @packet.
a valid SDES #GstRTCPPacket
Get the SSRC of the current SDES item.
the SSRC of the current item.
a valid SDES #GstRTCPPacket
Move to the next SDES entry in the current item.
%TRUE if there was a next entry.
a valid SDES #GstRTCPPacket
Move to the next SDES item in @packet.
TRUE if there was a next item.
a valid SDES #GstRTCPPacket
Set the @nth new report block in @packet with the given values.
Note: Not implemented.
a valid SR or RR #GstRTCPPacket
the nth report block to set
data source being reported
fraction lost since last SR/RR
the cumululative number of packets lost
the extended last sequence number received
the interarrival jitter
the last SR packet from this source
the delay since last SR packet
Parse the SR sender info and store the values.
a valid SR #GstRTCPPacket
result SSRC
result NTP time
result RTP time
result packet count
result octet count
Set the given values in the SR packet @packet.
a valid SR #GstRTCPPacket
the SSRC
the NTP time
the RTP time
the packet count
the octet count
Move to the first extended report block in XR @packet.
TRUE if there was a first extended report block.
a valid XR #GstRTCPPacket
The number of 32-bit words containing type-specific block
data from @packet.
a valid XR #GstRTCPPacket
Get the extended report block type of the XR @packet.
The extended report block type.
a valid XR #GstRTCPPacket
Parse the extended report block for DLRR report block type.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has DLRR Report Block.
the index of sub-block to retrieve.
the SSRC of the receiver.
the last receiver reference timestamp of @ssrc.
the delay since @last_rr.
Retrieve the packet receipt time of @seq which ranges in [begin_seq, end_seq).
%TRUE if the report block returns the receipt time correctly.
a valid XR #GstRTCPPacket which has the Packet Recept Times Report Block.
the sequence to retrieve the time.
the packet receipt time of @seq.
Parse the Packet Recept Times Report Block from a XR @packet
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has a Packet Receipt Times Report Block
the SSRC of the RTP data packet source being reported upon by this report block.
the amount of thinning performed on the sequence number space.
the first sequence number that this block reports on.
the last sequence number that this block reports on plus one.
Parse the extended report block for Loss RLE and Duplicated LRE block type.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which is Loss RLE or Duplicate RLE report.
the SSRC of the RTP data packet source being reported upon by this report block.
the amount of thinning performed on the sequence number space.
the first sequence number that this block reports on.
the last sequence number that this block reports on plus one.
the number of chunks calculated by block length.
Retrieve actual chunk data.
%TRUE if the report block returns chunk correctly.
a valid XR #GstRTCPPacket which is Loss RLE or Duplicate RLE report.
the index of chunk to retrieve.
the @nth chunk.
%TRUE if the report block returns the reference time correctly.
a valid XR #GstRTCPPacket which has the Receiver Reference Time.
NTP timestamp
Get the ssrc field of the XR @packet.
the ssrc.
a valid XR #GstRTCPPacket
Extract a basic information from static summary report block of XR @packet.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has Statics Summary Report Block.
the SSRC of the source.
the first sequence number that this block reports on.
the last sequence number that this block reports on plus one.
Extract jitter information from the statistics summary. If the jitter flag in
a block header is set as zero, all of jitters will be zero.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has Statics Summary Report Block.
the minimum relative transit time between two sequences.
the maximum relative transit time between two sequences.
the mean relative transit time between two sequences.
the standard deviation of the relative transit time between two sequences.
Get the number of lost or duplicate packets. If the flag in a block header
is set as zero, @lost_packets or @dup_packets will be zero.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has Statics Summary Report Block.
the number of lost packets between begin_seq and end_seq.
the number of duplicate packets between begin_seq and end_seq.
Extract the value of ttl for ipv4, or hop limit for ipv6.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has Statics Summary Report Block.
the flag to indicate that the return values are ipv4 ttl or ipv6 hop limits.
the minimum TTL or Hop Limit value of data packets between two sequences.
the maximum TTL or Hop Limit value of data packets between two sequences.
the mean TTL or Hop Limit value of data packets between two sequences.
the standard deviation of the TTL or Hop Limit value of data packets between two sequences.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the fraction of RTP data packets within burst periods.
the fraction of RTP data packets within inter-burst gaps.
the mean duration(ms) of the burst periods.
the mean duration(ms) of the gap periods.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the gap threshold.
the receiver configuration byte.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the most recently calculated round trip time between RTP interfaces(ms)
the most recently estimated end system delay(ms)
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the current nominal jitter buffer delay(ms)
the current maximum jitter buffer delay(ms)
the absolute maximum delay(ms)
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the SSRC of source
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the fraction of RTP data packets from the source lost.
the fraction of RTP data packets from the source that have been discarded.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the R factor is a voice quality metric describing the segment of the call.
the external R factor is a voice quality metric.
the estimated mean opinion score for listening quality.
the estimated mean opinion score for conversational quality.
%TRUE if the report block is correctly parsed.
a valid XR #GstRTCPPacket which has VoIP Metrics Report Block.
the ratio of the signal level to a 0 dBm reference.
the ratio of the silent period background noise level to a 0 dBm reference.
the residual echo return loss value.
the gap threshold.
Move to the next extended report block in XR @packet.
TRUE if there was a next extended report block.
a valid XR #GstRTCPPacket
Different types of SDES content.
Invalid SDES entry
End of SDES list
Canonical name
User name
User's electronic mail address
User's phone number
Geographic user location
Name of application or tool
Notice about the source
Private extensions
H.323 callable address
Application Specific Identifier (RFC6776)
Reporting Group Identifier (RFC8861)
RtpStreamId SDES item (RFC8852).
RepairedRtpStreamId SDES item (RFC8852).
CLUE CaptId (RFC8849)
MID SDES item (RFC8843).
Different RTCP packet types.
Invalid type
Sender report
Receiver report
Source description
Goodbye
Application defined
Transport layer feedback.
Payload-specific feedback.
Extended report.
Types of RTCP Extended Reports, those are defined in RFC 3611 and other RFCs
according to the [IANA registry](https://www.iana.org/assignments/rtcp-xr-block-types/rtcp-xr-block-types.xhtml).
Invalid XR Report Block
Loss RLE Report Block
Duplicate RLE Report Block
Packet Receipt Times Report Block
Receiver Reference Time Report Block
Delay since the last Receiver Report
Statistics Summary Report Block
VoIP Metrics Report Block
The maximum amount of SSRCs in a BYE packet.
The maximum amount of Receiver report blocks in RR and SR messages.
The maximum text length for an SDES item.
The maximum amount of SDES items.
Mask for version and packet type pair allowing reduced size
packets, basically it accepts other types than RR and SR
Mask for version, padding bit and packet type pair
Valid value for the first two bytes of an RTCP packet after applying
#GST_RTCP_VALID_MASK to them.
The supported RTCP version 2.
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
gst_rtp_base_audio_payload_set_frame_based() or
gst_rtp_base_audio_payload_set_sample_based(). This is usually done in the
element's `_init()` function. Then, the child element must call either
gst_rtp_base_audio_payload_set_frame_options(),
gst_rtp_base_audio_payload_set_sample_options() 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.
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.
If @payload_len is -1, all pending bytes will be flushed. If @timestamp is
-1, the timestamp will be calculated automatically.
a #GstFlowReturn
a #GstRTPBasePayload
length of payload
a #GstClockTime
Gets the internal adapter used by the depayloader.
a #GstAdapter.
a #GstRTPBaseAudioPayload
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.
a #GstFlowReturn
a #GstRTPBasePayload
data to set as payload
length of payload
a #GstClockTime
Tells #GstRTPBaseAudioPayload that the child element is for a frame based
audio codec
a pointer to the element.
Sets the options for frame based audio codecs.
a pointer to the element.
The duraction of an audio frame in milliseconds.
The size of an audio frame in bytes.
Tells #GstRTPBaseAudioPayload that the child element is for a sample based
audio codec
a pointer to the element.
Sets the options for sample based audio codecs.
a pointer to the element.
Size per sample in bytes.
Sets the options for sample based audio codecs.
a pointer to the element.
Size per sample in bits.
Base class for audio RTP payloader.
the parent class
Provides a base class for RTP depayloaders
In order to handle RTP header extensions correctly if the
depayloader aggregates multiple RTP packet payloads into one output
buffer this class provides the function
gst_rtp_base_depayload_set_aggregate_hdrext_enabled(). If the
aggregation is enabled the virtual functions
@GstRTPBaseDepayload.process or
@GstRTPBaseDepayload.process_rtp_packet must tell the base class
what happens to the current RTP packet. By default the base class
assumes that the packet payload is used with the next output
buffer.
If the RTP packet will not be used with an output buffer
gst_rtp_base_depayload_dropped() must be called. A typical
situation would be if we are waiting for a keyframe.
If the RTP packet will be used but not with the current output
buffer but with the next one gst_rtp_base_depayload_delayed() must
be called. This may happen if the current RTP packet signals the
start of a new output buffer and the currently processed output
buffer will be pushed first. The undelay happens implicitly once
the current buffer has been pushed or
gst_rtp_base_depayload_flush() has been called.
If gst_rtp_base_depayload_flush() is called all RTP packets that
have not been dropped since the last output buffer are dropped,
e.g. if an output buffer is discarded due to malformed data. This
may or may not include the current RTP packet depending on the 2nd
parameter @keep_current.
Be aware that in case gst_rtp_base_depayload_push_list() is used
each buffer will see the same list of RTP header extensions.
Called from @GstRTPBaseDepayload.process or
@GstRTPBaseDepayload.process_rtp_packet when the depayloader needs
to keep the current input RTP header for use with the next output
buffer.
The delayed buffer will remain until the end of processing the
current output buffer and then enqueued for processing with the
next output buffer.
A typical use-case is when the depayloader implementation will
start a new output buffer for the current input RTP buffer but push
the current output buffer first.
Must be called with the stream lock held.
a #GstRTPBaseDepayload
Called from @GstRTPBaseDepayload.process or
@GstRTPBaseDepayload.process_rtp_packet if the depayloader does not
use the current buffer for the output buffer. This will either drop
the delayed buffer or the last buffer from the header extension
cache.
A typical use-case is when the depayloader implementation is
dropping an input RTP buffer while waiting for the first keyframe.
Must be called with the stream lock held.
a #GstRTPBaseDepayload
If @GstRTPBaseDepayload.process or
@GstRTPBaseDepayload.process_rtp_packet drop an output buffer this
function tells the base class to flush header extension cache as
well.
This will not drop an input RTP header marked as delayed from
gst_rtp_base_depayload_delayed().
If @keep_current is %TRUE the current input RTP header will be kept
and enqueued after flushing the previous input RTP headers.
A typical use-case for @keep_current is when the depayloader
implementation invalidates the current output buffer and starts a
new one with the current RTP input buffer.
Must be called with the stream lock held.
a #GstRTPBaseDepayload
if the current RTP buffer shall be kept
Queries whether header extensions will be aggregated per depayloaded buffers.
%TRUE if aggregate-header-extension is enabled.
a #GstRTPBaseDepayload
Queries whether #GstRTPSourceMeta will be added to depayloaded buffers.
%TRUE if source-info is enabled.
a #GstRTPBaseDepayload
Push @out_buf to the peer of @filter. This function takes ownership of
@out_buf.
This function will by default apply the last incoming timestamp on
the outgoing buffer when it didn't have a timestamp already.
a #GstFlowReturn.
a #GstRTPBaseDepayload
a #GstBuffer
Push @out_list to the peer of @filter. This function takes ownership of
@out_list.
a #GstFlowReturn.
a #GstRTPBaseDepayload
a #GstBufferList
Enable or disable aggregating header extensions.
a #GstRTPBaseDepayload
whether to aggregate header extensions per output buffer
Enable or disable adding #GstRTPSourceMeta to depayloaded buffers.
a #GstRTPBaseDepayload
whether to add meta about RTP sources to buffer
If enabled, the depayloader will automatically try to enable all the
RTP header extensions provided in the sink caps, saving the application
the need to handle these extensions manually using the
GstRTPBaseDepayload::request-extension: signal.
A list of already enabled RTP header extensions. This may be useful for finding
out which extensions are already enabled (with add-extension signal) and picking a non-conflicting
ID for a new extension that needs to be added on top of the existing ones.
Note that the value returned by reading this property is not dynamically updated when the set of
enabled extensions changes by any of existing action signals. Rather, it represents the current state
at the time the property is read.
Dynamic updates of this property can be received by subscribing to its corresponding "notify" signal, i.e.
"notify::extensions".
Max seqnum reorder before the sender is assumed to have restarted.
When max-reorder is set to 0 all reordered/duplicate packets are
considered coming from a restarted sender.
Add RTP source information found in RTP header as meta to output buffer.
Various depayloader statistics retrieved atomically (and are therefore
synchroized with each other). This property return a GstStructure named
application/x-rtp-depayload-stats containing the following fields relating to
the last processed buffer and current state of the stream being depayloaded:
* `clock-rate`: #G_TYPE_UINT, clock-rate of the stream
* `npt-start`: #G_TYPE_UINT64, time of playback start
* `npt-stop`: #G_TYPE_UINT64, time of playback stop
* `play-speed`: #G_TYPE_DOUBLE, the playback speed
* `play-scale`: #G_TYPE_DOUBLE, the playback scale
* `running-time-dts`: #G_TYPE_UINT64, the last running-time of the
last DTS
* `running-time-pts`: #G_TYPE_UINT64, the last running-time of the
last PTS
* `seqnum`: #G_TYPE_UINT, the last seen seqnum
* `timestamp`: #G_TYPE_UINT, the last seen RTP timestamp
Add @ext as an extension for reading part of an RTP header extension from
incoming RTP packets.
the #GstRTPHeaderExtension
Clear all RTP header extensions used by this depayloader.
The returned @ext must be configured with the correct @ext_id and with the
necessary attributes as required by the extension implementation.
the #GstRTPHeaderExtension for @ext_id, or %NULL
the extension id being requested
the extension URI being requested
Base class for RTP depayloaders.
the parent class
Provides a base class for RTP payloaders
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.
A newly allocated buffer that can hold an RTP packet with given
parameters.
a #GstRTPBasePayload
the length of the payload
the amount of padding
the minimum number of CSRC entries
Count the total number of RTP sources found in the meta of @buffer, which
will be automically added by gst_rtp_base_payload_allocate_output_buffer().
If #GstRTPBasePayload:source-info is %FALSE the count will be 0.
The number of sources.
a #GstRTPBasePayload
a #GstBuffer, typically the buffer to payload
Check if the packet with @size and @duration would exceed the configured
maximum size.
%TRUE if the packet of @size and @duration would exceed the
configured MTU or max_ptime.
a #GstRTPBasePayload
the size of the packet
the duration of the packet
Queries whether the payloader will add contributing sources (CSRCs) to the
RTP header from #GstRTPSourceMeta.
%TRUE if source-info is enabled.
a #GstRTPBasePayload
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.
a #GstFlowReturn.
a #GstRTPBasePayload
a #GstBuffer
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.
a #GstFlowReturn.
a #GstRTPBasePayload
a #GstBufferList
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
gst_rtp_base_payload_push() or gst_rtp_base_payload_set_outcaps().
a #GstRTPBasePayload
the media type (typically "audio" or "video")
if the payload type is dynamic
the encoding name
the clock rate of the media
Configure the output caps with the optional parameters.
Variable arguments should be in the form field name, field type
(as a GType), value(s). The last variable argument should be NULL.
%TRUE if the caps could be set.
a #GstRTPBasePayload
the first field name or %NULL
field values
Configure the output caps with the optional fields.
%TRUE if the caps could be set.
a #GstRTPBasePayload
a #GstStructure with the caps fields
Enable or disable adding contributing sources to RTP packets from
#GstRTPSourceMeta.
a #GstRTPBasePayload
whether to add contributing sources to RTP packets
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.
A list of already enabled RTP header extensions. This may be useful for finding
out which extensions are already enabled (with add-extension signal) and picking a non-conflicting
ID for a new extension that needs to be added on top of the existing ones.
Note that the value returned by reading this property is not dynamically updated when the set of
enabled extensions changes by any of existing action signals. Rather, it represents the current state
at the time the property is read.
Dynamic updates of this property can be received by subscribing to its corresponding "notify" signal, i.e.
"notify::extensions".
Minimum duration of the packet data in ns (can't go above MTU)
Make the payloader timestamp packets according to the Rate-Control=no
behaviour specified in the ONVIF replay spec.
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.
Force buffers to be multiples of this duration in ns (0 disables)
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.
Enable writing the CSRC field in allocated RTP header based on RTP source
information found in the input buffer's #GstRTPSourceMeta.
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 #GstRTPBasePayload:seqnum
* `timestamp` :#G_TYPE_UINT, RTP timestamp, same as #GstRTPBasePayload:timestamp
* `ssrc` :#G_TYPE_UINT, The SSRC in use
* `pt` :#G_TYPE_UINT, The Payload type in use, same as #GstRTPBasePayload: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
Add @ext as an extension for writing part of an RTP header extension onto
outgoing RTP packets.
the #GstRTPHeaderExtension
Clear all RTP header extensions used by this payloader.
The returned @ext must be configured with the correct @ext_id and with the
necessary attributes as required by the extension implementation.
the #GstRTPHeaderExtension for @ext_id, or %NULL
the extension id being requested
the extension URI being requested
Base class for audio RTP payloader.
the parent class
The GstRTPBuffer helper functions makes it easy to parse and create regular
#GstBuffer objects that contain RTP payloads. These buffers are typically of
'application/x-rtp' #GstCaps.
pointer to RTP buffer
internal state
array of data
array of size
array of #GstMapInfo
Adds a RFC 5285 header extension with a one byte header to the end of the
RTP header. If there is already a RFC 5285 header extension with a one byte
header, the new extension will be appended.
It will not work if there is already a header extension that does not follow
the mechanism described in RFC 5285 or if there is a header extension with
a two bytes header as described in RFC 5285. In that case, use
gst_rtp_buffer_add_extension_twobytes_header()
%TRUE if header extension could be added
the RTP packet
The ID of the header extension (between 1 and 14).
location for data
the size of the data in bytes
Adds a RFC 5285 header extension with a two bytes header to the end of the
RTP header. If there is already a RFC 5285 header extension with a two bytes
header, the new extension will be appended.
It will not work if there is already a header extension that does not follow
the mechanism described in RFC 5285 or if there is a header extension with
a one byte header as described in RFC 5285. In that case, use
gst_rtp_buffer_add_extension_onebyte_header()
%TRUE if header extension could be added
the RTP packet
Application specific bits
The ID of the header extension
location for data
the size of the data in bytes
Get the CSRC at index @idx in @buffer.
the CSRC at index @idx in host order.
the RTP packet
the index of the CSRC to get
Get the CSRC count of the RTP packet in @buffer.
the CSRC count of @buffer.
the RTP packet
Check if the extension bit is set on the RTP packet in @buffer.
TRUE if @buffer has the extension bit set.
the RTP packet
Similar to gst_rtp_buffer_get_extension_data, but more suitable for language
bindings usage. @bits will contain the extension 16 bits of custom data and
the extension data (not including the extension header) is placed in a new
#GBytes structure.
If @rtp did not contain an extension, this function will return %NULL, with
@bits unchanged. If there is an extension header but no extension data then
an empty #GBytes will be returned.
A new #GBytes if an extension header was present
and %NULL otherwise.
the RTP packet
location for header bits
Get the extension data. @bits will contain the extension 16 bits of custom
data. @data will point to the data in the extension and @wordlen will contain
the length of @data in 32 bits words.
If @buffer did not contain an extension, this function will return %FALSE
with @bits, @data and @wordlen unchanged.
TRUE if @buffer had the extension bit set.
the RTP packet
location for result bits
location for data
location for length of @data in 32 bits words
Parses RFC 5285 style header extensions with a one byte header. It will
return the nth extension with the requested id.
TRUE if @buffer had the requested header extension
the RTP packet
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
location for data
the size of the data in bytes
Parses RFC 5285 style header extensions with a two bytes header. It will
return the nth extension with the requested id.
TRUE if @buffer had the requested header extension
the RTP packet
Application specific bits
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
location for data
the size of the data in bytes
Return the total length of the header in @buffer. This include the length of
the fixed header, the CSRC list and the extension header.
The total length of the header in @buffer.
the RTP packet
Check if the marker bit is set on the RTP packet in @buffer.
TRUE if @buffer has the marker bit set.
the RTP packet
Return the total length of the packet in @buffer.
The total length of the packet in @buffer.
the RTP packet
Check if the padding bit is set on the RTP packet in @buffer.
TRUE if @buffer has the padding bit set.
the RTP packet
Get a pointer to the payload data in @buffer. This pointer is valid as long
as a reference to @buffer is held.
A pointer
to the payload data in @buffer.
the RTP packet
Create a buffer of the payload of the RTP packet in @buffer. This function
will internally create a subbuffer of @buffer so that a memcpy can be
avoided.
A new buffer with the data of the payload.
the RTP packet
Similar to gst_rtp_buffer_get_payload, but more suitable for language
bindings usage. The return value is a pointer to a #GBytes structure
containing the payload data in @rtp.
A new #GBytes containing the payload data in @rtp.
the RTP packet
Get the length of the payload of the RTP packet in @buffer.
The length of the payload in @buffer.
the RTP packet
Create a subbuffer of the payload of the RTP packet in @buffer. @offset bytes
are skipped in the payload and the subbuffer will be of size @len.
If @len is -1 the total payload starting from @offset is subbuffered.
A new buffer with the specified data of the payload.
the RTP packet
the offset in the payload
the length in the payload
Get the payload type of the RTP packet in @buffer.
The payload type.
the RTP packet
Get the sequence number of the RTP packet in @buffer.
The sequence number in host order.
the RTP packet
Get the SSRC of the RTP packet in @buffer.
the SSRC of @buffer in host order.
the RTP packet
Get the timestamp of the RTP packet in @buffer.
The timestamp in host order.
the RTP packet
Get the version number of the RTP packet in @buffer.
The version of @buffer.
the RTP packet
Set the amount of padding in the RTP packet in @buffer to
@len. If @len is 0, the padding is removed.
NOTE: This function does not work correctly.
the RTP packet
the new amount of padding
Unsets the extension bit of the RTP buffer and removes the extension header
and data.
If the RTP buffer has no header extension data, the action has no effect.
The RTP buffer must be mapped READWRITE only once and the underlying
GstBuffer must be writable.
the RTP packet
Modify the CSRC at index @idx in @buffer to @csrc.
the RTP packet
the CSRC index to set
the CSRC in host order to set at @idx
Set the extension bit on the RTP packet in @buffer to @extension.
the RTP packet
the new extension
Set the extension bit of the rtp buffer and fill in the @bits and @length of the
extension header. If the existing extension data is not large enough, it will
be made larger.
Will also shorten the extension data from 1.20.
True if done.
the RTP packet
the bits specific for the extension
the length that counts the number of 32-bit words in
the extension, excluding the extension header ( therefore zero is a valid length)
Set the marker bit on the RTP packet in @buffer to @marker.
the RTP packet
the new marker
Set the total @rtp size to @len. The data in the buffer will be made
larger if needed. Any padding will be removed from the packet.
the RTP packet
the new packet length
Set the padding bit on the RTP packet in @buffer to @padding.
the buffer
the new padding
Set the payload type of the RTP packet in @buffer to @payload_type.
the RTP packet
the new type
Set the sequence number of the RTP packet in @buffer to @seq.
the RTP packet
the new sequence number
Set the SSRC on the RTP packet in @buffer to @ssrc.
the RTP packet
the new SSRC
Set the timestamp of the RTP packet in @buffer to @timestamp.
the RTP packet
the new timestamp
Set the version of the RTP packet in @buffer to @version.
the RTP packet
the new version
Unmap @rtp previously mapped with gst_rtp_buffer_map().
a #GstRTPBuffer
Allocate enough data in @buffer to hold an RTP packet with @csrc_count CSRCs,
a payload length of @payload_len and padding of @pad_len.
@buffer must be writable and all previous memory in @buffer will be freed.
If @pad_len is >0, the padding bit will be set. All other RTP header fields
will be set to 0/FALSE.
a #GstBuffer
the length of the payload
the amount of padding
the number of CSRC entries
Calculate the header length of an RTP packet with @csrc_count CSRC entries.
An RTP packet can have at most 15 CSRC entries.
The length of an RTP header with @csrc_count CSRC entries.
the number of CSRC entries
Calculate the total length of an RTP packet with a payload size of @payload_len,
a padding of @pad_len and a @csrc_count CSRC entries.
The total length of an RTP header with given parameters.
the length of the payload
the amount of padding
the number of CSRC entries
Calculate the length of the payload of an RTP packet with size @packet_len,
a padding of @pad_len and a @csrc_count CSRC entries.
The length of the payload of an RTP packet with given parameters.
the length of the total RTP packet
the amount of padding
the number of CSRC entries
Compare two sequence numbers, taking care of wraparounds. This function
returns the difference between @seqnum1 and @seqnum2.
a negative value if @seqnum1 is bigger than @seqnum2, 0 if they
are equal or a positive value if @seqnum1 is smaller than @segnum2.
a sequence number
a sequence number
Get the default clock-rate for the static payload type @payload_type.
the default clock rate or -1 if the payload type is not static or
the clock-rate is undefined.
the static payload type
Update the @exttimestamp field with the extended timestamp of @timestamp
For the first call of the method, @exttimestamp should point to a location
with a value of -1.
This function is able to handle both forward and backward timestamps taking
into account:
- timestamp wraparound making sure that the returned value is properly increased.
- timestamp unwraparound making sure that the returned value is properly decreased.
The extended timestamp of @timestamp or 0 if the result can't go anywhere backwards.
a previous extended timestamp
a new timestamp
Similar to gst_rtp_buffer_get_extension_onebyte_header, but working
on the #GBytes you get from gst_rtp_buffer_get_extension_bytes.
Parses RFC 5285 style header extensions with a one byte header. It will
return the nth extension with the requested id.
TRUE if @bytes had the requested header extension
#GBytes
The bit-pattern. Anything but 0xBEDE is rejected.
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
location for data
the size of the data in bytes
Map the contents of @buffer into @rtp.
%TRUE if @buffer could be mapped.
a #GstBuffer
#GstMapFlags
a #GstRTPBuffer
Allocate a new #GstBuffer with enough data to hold an RTP packet with
@csrc_count CSRCs, a payload length of @payload_len and padding of @pad_len.
All other RTP header fields will be set to 0/FALSE.
A newly allocated buffer that can hold an RTP packet with given
parameters.
the length of the payload
the amount of padding
the number of CSRC entries
Create a new #GstBuffer that can hold an RTP packet that is exactly
@packet_len long. The length of the payload depends on @pad_len and
@csrc_count and can be calculated with gst_rtp_buffer_calc_payload_len().
All RTP header fields will be set to 0/FALSE.
A newly allocated buffer that can hold an RTP packet of @packet_len.
the total length of the packet
the amount of padding
the number of CSRC entries
Create a new buffer and set the data to a copy of @len
bytes of @data and the size to @len. The data will be freed when the buffer
is freed.
A newly allocated buffer with a copy of @data and of size @len.
data for the new
buffer
the length of data
Create a new buffer and set the data and size of the buffer to @data and @len
respectively. @data will be freed when the buffer is unreffed, so this
function transfers ownership of @data to the new buffer.
A newly allocated buffer with @data and of size @len.
data for the new buffer
the length of data
Additional RTP buffer flags. These flags can potentially be used on any
buffers carrying RTP packets.
Note that these are only valid for #GstCaps of type: application/x-rtp (x-rtcp).
They can conflict with other extended buffer flags.
The #GstBuffer was once wrapped
in a retransmitted packet as specified by RFC 4588.
The packet represents redundant RTP packet.
The flag is used in gstrtpstorage to be able to hold the packetback
and use it only for recovery from packet loss.
Since: 1.14
Offset to define more flags.
Additional mapping flags for gst_rtp_buffer_map().
Skip mapping and validation of RTP
padding and RTP pad count when present. Useful for buffers where
the padding may be encrypted.
Offset to define more flags
Instance struct for a RTP Audio/Video header extension.
the #GstRTPHeaderExtension for @uri or %NULL
the rtp header extension URI to search for
This is used to know how much data a certain header extension will need for
both allocating the resulting data, and deciding how much payload data can
be generated.
Implementations should return as accurate a value as is possible using the
information given in the input @buffer.
the maximum size of the data written by this extension
a #GstRTPHeaderExtension
a #GstBuffer
the flags supported by this instance of @ext
a #GstRTPHeaderExtension
Read the RTP header extension from @data.
whether the extension could be read from @data
a #GstRTPHeaderExtension
#GstRTPHeaderExtensionFlags for how the extension should
be written
location to read the rtp header extension from
size of @data
a #GstBuffer to modify if necessary
gst_rtp_header_extension_set_id() must have been called with a valid
extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced
by gst_sdp_media_attributes_to_caps().
whether the configured attributes on @ext can successfully be set on
@caps
a #GstRTPHeaderExtension
writable #GstCaps to modify
Passes RTP payloader's sink (i.e. not payloaded) @caps to the header
extension.
Whether @caps could be read successfully
a #GstRTPHeaderExtension
sink #GstCaps
Updates depayloader src caps based on the information received in RTP header.
@caps must be writable as this function may modify them.
whether @caps were modified successfully
a #GstRTPHeaderExtension
src #GstCaps to modify
Writes the RTP header extension to @data using information available from
the @input_meta. @data will be sized to be at least the value returned
from gst_rtp_header_extension_get_max_size().
the size of the data written, < 0 on failure
a #GstRTPHeaderExtension
the input #GstBuffer to read information from if necessary
#GstRTPHeaderExtensionFlags for how the extension should
be written
output RTP #GstBuffer
location to write the rtp header extension into
size of @data
Retrieve the direction
The direction
the #GstRTPHeaderExtension
the RTP extension id configured on @ext
a #GstRTPHeaderExtension
This is used to know how much data a certain header extension will need for
both allocating the resulting data, and deciding how much payload data can
be generated.
Implementations should return as accurate a value as is possible using the
information given in the input @buffer.
the maximum size of the data written by this extension
a #GstRTPHeaderExtension
a #GstBuffer
the #GstStructure field name used in SDP-like #GstCaps for this @ext configuration
the #GstRTPHeaderExtension
the flags supported by this instance of @ext
a #GstRTPHeaderExtension
the RTP extension URI for this object
a #GstRTPHeaderExtension
Read the RTP header extension from @data.
whether the extension could be read from @data
a #GstRTPHeaderExtension
#GstRTPHeaderExtensionFlags for how the extension should
be written
location to read the rtp header extension from
size of @data
a #GstBuffer to modify if necessary
gst_rtp_header_extension_set_id() must have been called with a valid
extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced
by gst_sdp_media_attributes_to_caps().
whether the @caps could be successfully set on @ext.
a #GstRTPHeaderExtension
the #GstCaps to configure this extension with
gst_rtp_header_extension_set_id() must have been called with a valid
extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced
by gst_sdp_media_attributes_to_caps().
whether the configured attributes on @ext can successfully be set on
@caps
a #GstRTPHeaderExtension
writable #GstCaps to modify
Helper implementation for GstRTPExtensionClass::set_caps_from_attributes
that sets the @ext uri on caps with the specified extension id as required
for sdp #GstCaps.
Requires that the extension does not have any attributes or direction
advertised in @caps.
whether the @ext attributes could be set on @caps.
the #GstRTPHeaderExtension
#GstCaps to write fields into
Set the direction that this header extension should be used in.
If #GST_RTP_HEADER_EXTENSION_DIRECTION_INHERITED is included, the
direction will not be included in the caps (as it shouldn't be in the
extmap line in the SDP).
the #GstRTPHeaderExtension
The direction
sets the RTP extension id on @ext
a #GstRTPHeaderExtension
The id of this extension
Passes RTP payloader's sink (i.e. not payloaded) @caps to the header
extension.
Whether @caps could be read successfully
a #GstRTPHeaderExtension
sink #GstCaps
Call this function in a subclass from #GstRTPHeaderExtensionClass::read to
tell the depayloader whether the data just parsed from RTP packet require
updating its src (non-RTP) caps. If @state is TRUE, #GstRTPBaseDepayload will
eventually invoke gst_rtp_header_extension_update_non_rtp_src_caps() to
have the caps update applied. Applying the update also flips the internal
"wants update" flag back to FALSE.
a #GstRTPHeaderExtension
TRUE if caps update is needed
Updates depayloader src caps based on the information received in RTP header.
@caps must be writable as this function may modify them.
whether @caps were modified successfully
a #GstRTPHeaderExtension
src #GstCaps to modify
Call this function after gst_rtp_header_extension_read() to check if
the depayloader's src caps need updating with data received in the last RTP
packet.
Whether @ext wants to update depayloader's src caps.
a #GstRTPHeaderExtension
Writes the RTP header extension to @data using information available from
the @input_meta. @data will be sized to be at least the value returned
from gst_rtp_header_extension_get_max_size().
the size of the data written, < 0 on failure
a #GstRTPHeaderExtension
the input #GstBuffer to read information from if necessary
#GstRTPHeaderExtensionFlags for how the extension should
be written
output RTP #GstBuffer
location to write the rtp header extension into
size of @data
the parent #GObject
Base class for RTP Header extensions.
the parent class
the flags supported by this instance of @ext
a #GstRTPHeaderExtension
the maximum size of the data written by this extension
a #GstRTPHeaderExtension
a #GstBuffer
the size of the data written, < 0 on failure
a #GstRTPHeaderExtension
the input #GstBuffer to read information from if necessary
#GstRTPHeaderExtensionFlags for how the extension should
be written
output RTP #GstBuffer
location to write the rtp header extension into
size of @data
whether the extension could be read from @data
a #GstRTPHeaderExtension
#GstRTPHeaderExtensionFlags for how the extension should
be written
location to read the rtp header extension from
size of @data
a #GstBuffer to modify if necessary
Whether @caps could be read successfully
a #GstRTPHeaderExtension
sink #GstCaps
whether @caps were modified successfully
a #GstRTPHeaderExtension
src #GstCaps to modify
whether the configured attributes on @ext can successfully be set on
@caps
a #GstRTPHeaderExtension
writable #GstCaps to modify
Set the URI for this RTP header extension implementation.
the #GstRTPHeaderExtensionClass
the RTP Header extension uri for @klass
Direction to which to apply the RTP Header Extension
Neither send nor
receive RTP Header Extensions
Only send RTP Header
Extensions @GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY: Only
receive RTP Header Extensions
Send and receive RTP
Header Extensions ext
RTP header extension
direction is inherited from the stream
Flags that apply to a RTP Audio/Video header extension.
The one byte rtp extension header.
1-16 data bytes per extension with a maximum of
14 extension ids in total.
The two byte rtp extension header.
256 data bytes per extension with a maximum of 255 (or 256
including appbits) extensions in total.
Standard predefined fixed payload types.
The official list is at:
http://www.iana.org/assignments/rtp-parameters
Audio:
reserved: 19
unassigned: 20-23,
Video:
unassigned: 24, 27, 29, 30, 35-71, 77-95
Reserved for RTCP conflict avoidance: 72-76
ITU-T G.711. mu-law audio (RFC 3551)
RFC 3551 says reserved
RFC 3551 says reserved
GSM audio
ITU G.723.1 audio
IMA ADPCM wave type (RFC 3551)
IMA ADPCM wave type (RFC 3551)
experimental linear predictive encoding
ITU-T G.711 A-law audio (RFC 3551)
ITU-T G.722 (RFC 3551)
stereo PCM
mono PCM
EIA & TIA standard IS-733
Comfort Noise (RFC 3389)
Audio MPEG 1-3.
ITU-T G.728 Speech coder (RFC 3551)
IMA ADPCM wave type (RFC 3551)
IMA ADPCM wave type (RFC 3551)
ITU-T G.729 Speech coder (RFC 3551)
See RFC 2029
ISO Standards 10918-1 and 10918-2 (RFC 2435)
nv encoding by Ron Frederick
ITU-T Recommendation H.261 (RFC 2032)
Video MPEG 1 & 2 (RFC 2250)
MPEG-2 transport stream (RFC 2250)
Video H263 (RFC 2190)
Structure holding default payload type information.
payload type, -1 means dynamic
the media type(s), usually "audio", "video", "application", "text",
"message".
the encoding name of @pt
default clock rate, 0 = unknown/variable
encoding parameters. For audio this is the number of
channels. NULL = not applicable.
the bitrate of the media. 0 = unknown/variable.
Get the #GstRTPPayloadInfo for @media and @encoding_name. This function is
mostly used to get the default clock-rate and bandwidth for dynamic payload
types specified with @media and @encoding name.
The search for @encoding_name will be performed in a case insensitive way.
a #GstRTPPayloadInfo or NULL when no info could be found.
the media to find
the encoding name to find
Get the #GstRTPPayloadInfo for @payload_type. This function is
mostly used to get the default clock-rate and bandwidth for static payload
types specified with @payload_type.
a #GstRTPPayloadInfo or NULL when no info could be found.
the payload_type to find
The transfer profile to use.
invalid profile
the Audio/Visual profile (RFC 3551)
the secure Audio/Visual profile (RFC 3711)
the Audio/Visual profile with feedback (RFC 4585)
the secure Audio/Visual profile with feedback (RFC 5124)
Meta describing the source(s) of the buffer.
parent #GstMeta
the SSRC
whether @ssrc is set and valid
pointer to the CSRCs
number of elements in @csrc
Appends @csrc to the list of contributing sources in @meta.
%TRUE if all elements in @csrc was added, %FALSE otherwise.
a #GstRTPSourceMeta
the csrcs to append
number of elements in @csrc
Count the total number of RTP sources found in @meta, both SSRC and CSRC.
The number of RTP sources
a #GstRTPSourceMeta
Sets @ssrc in @meta. If @ssrc is %NULL the ssrc of @meta will be unset.
%TRUE on success, %FALSE otherwise.
a #GstRTPSourceMeta
pointer to the SSRC
Get access to the configured MTU of @payload.
a #GstRTPBasePayload
Get access to the configured payload type of @payload.
a #GstRTPBasePayload
Get access to the sinkpad of @payload.
a #GstRTPBasePayload
Get access to the srcpad of @payload.
a #GstRTPBasePayload
Constant string used in element classification to signal that this element
is a RTP header extension.
Check if @pt is a dynamic payload type.
a payload type
The supported RTP version 2.
Attaches RTP source information to @buffer.
the #GstRTPSourceMeta on @buffer.
a #GstBuffer
pointer to the SSRC
pointer to the CSRCs
number of elements in @csrc
Find the #GstRTPSourceMeta on @buffer.
the #GstRTPSourceMeta or %NULL when there
is no such metadata on @buffer.
a #GstBuffer
Provides common defines for the RTP library.
The GstRTPPayloads helper functions makes it easy to deal with static and dynamic
payloads. Its main purpose is to retrieve properties such as the default clock-rate
and get session bandwidth information.
Open @buffer for reading or writing, depending on @flags. The resulting RTCP
buffer state is stored in @rtcp.
a buffer with an RTCP packet
flags for the mapping
resulting #GstRTCPBuffer
Create a new buffer for constructing RTCP packets. The packet will have a
maximum size of @mtu.
A newly allocated buffer.
the maximum mtu size.
Create a new buffer and set the data to a copy of @len
bytes of @data and the size to @len. The data will be freed when the buffer
is freed.
A newly allocated buffer with a copy of @data and of size @len.
data for the new buffer
the length of data
Create a new buffer and set the data and size of the buffer to @data and @len
respectively. @data will be freed when the buffer is unreffed, so this
function transfers ownership of @data to the new buffer.
A newly allocated buffer with @data and of size @len.
data for the new buffer
the length of data
Check if the data pointed to by @buffer is a valid RTCP packet using
gst_rtcp_buffer_validate_data().
TRUE if @buffer is a valid RTCP packet.
the buffer to validate
Check if the @data and @size point to the data of a valid compound,
non-reduced size RTCP packet.
Use this function to validate a packet before using the other functions in
this module.
TRUE if the data points to a valid RTCP packet.
the data to validate
the length of @data to validate
Check if the @data and @size point to the data of a valid RTCP packet.
Use this function to validate a packet before using the other functions in
this module.
This function is updated to support reduced size rtcp packets according to
RFC 5506 and will validate full compound RTCP packets as well as reduced
size RTCP packets.
TRUE if the data points to a valid RTCP packet.
the data to validate
the length of @data to validate
Check if the data pointed to by @buffer is a valid RTCP packet using
gst_rtcp_buffer_validate_reduced().
TRUE if @buffer is a valid RTCP packet.
the buffer to validate
Converts an NTP time to UNIX nanoseconds. @ntptime can typically be
the NTP time of an SR RTCP message and contains, in the upper 32 bits, the
number of seconds since 1900 and, in the lower 32 bits, the fractional
seconds. The resulting value will be the number of nanoseconds since 1970.
the UNIX time for @ntptime in nanoseconds.
an NTP timestamp
Convert @name into a @GstRTCPSDESType. @name is typically a key in a
#GstStructure containing SDES items.
the #GstRTCPSDESType for @name or #GST_RTCP_SDES_PRIV when @name
is a private sdes item.
a SDES name
Converts @type to the string equivalent. The string is typically used as a
key in a #GstStructure containing SDES items.
the string equivalent of @type
a #GstRTCPSDESType
Converts a UNIX timestamp in nanoseconds to an NTP time. The caller should
pass a value with nanoseconds since 1970. The NTP time will, in the upper
32 bits, contain the number of seconds since 1900 and, in the lower 32
bits, the fractional seconds. The resulting value can be used as an ntptime
for constructing SR RTCP packets.
the NTP time for @unixtime.
an UNIX timestamp in nanoseconds
Allocate enough data in @buffer to hold an RTP packet with @csrc_count CSRCs,
a payload length of @payload_len and padding of @pad_len.
@buffer must be writable and all previous memory in @buffer will be freed.
If @pad_len is >0, the padding bit will be set. All other RTP header fields
will be set to 0/FALSE.
a #GstBuffer
the length of the payload
the amount of padding
the number of CSRC entries
Calculate the header length of an RTP packet with @csrc_count CSRC entries.
An RTP packet can have at most 15 CSRC entries.
The length of an RTP header with @csrc_count CSRC entries.
the number of CSRC entries
Calculate the total length of an RTP packet with a payload size of @payload_len,
a padding of @pad_len and a @csrc_count CSRC entries.
The total length of an RTP header with given parameters.
the length of the payload
the amount of padding
the number of CSRC entries
Calculate the length of the payload of an RTP packet with size @packet_len,
a padding of @pad_len and a @csrc_count CSRC entries.
The length of the payload of an RTP packet with given parameters.
the length of the total RTP packet
the amount of padding
the number of CSRC entries
Compare two sequence numbers, taking care of wraparounds. This function
returns the difference between @seqnum1 and @seqnum2.
a negative value if @seqnum1 is bigger than @seqnum2, 0 if they
are equal or a positive value if @seqnum1 is smaller than @segnum2.
a sequence number
a sequence number
Get the default clock-rate for the static payload type @payload_type.
the default clock rate or -1 if the payload type is not static or
the clock-rate is undefined.
the static payload type
Update the @exttimestamp field with the extended timestamp of @timestamp
For the first call of the method, @exttimestamp should point to a location
with a value of -1.
This function is able to handle both forward and backward timestamps taking
into account:
- timestamp wraparound making sure that the returned value is properly increased.
- timestamp unwraparound making sure that the returned value is properly decreased.
The extended timestamp of @timestamp or 0 if the result can't go anywhere backwards.
a previous extended timestamp
a new timestamp
Similar to gst_rtp_buffer_get_extension_onebyte_header, but working
on the #GBytes you get from gst_rtp_buffer_get_extension_bytes.
Parses RFC 5285 style header extensions with a one byte header. It will
return the nth extension with the requested id.
TRUE if @bytes had the requested header extension
#GBytes
The bit-pattern. Anything but 0xBEDE is rejected.
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
location for data
the size of the data in bytes
Map the contents of @buffer into @rtp.
%TRUE if @buffer could be mapped.
a #GstBuffer
#GstMapFlags
a #GstRTPBuffer
Allocate a new #GstBuffer with enough data to hold an RTP packet with
@csrc_count CSRCs, a payload length of @payload_len and padding of @pad_len.
All other RTP header fields will be set to 0/FALSE.
A newly allocated buffer that can hold an RTP packet with given
parameters.
the length of the payload
the amount of padding
the number of CSRC entries
Create a new #GstBuffer that can hold an RTP packet that is exactly
@packet_len long. The length of the payload depends on @pad_len and
@csrc_count and can be calculated with gst_rtp_buffer_calc_payload_len().
All RTP header fields will be set to 0/FALSE.
A newly allocated buffer that can hold an RTP packet of @packet_len.
the total length of the packet
the amount of padding
the number of CSRC entries
Create a new buffer and set the data to a copy of @len
bytes of @data and the size to @len. The data will be freed when the buffer
is freed.
A newly allocated buffer with a copy of @data and of size @len.
data for the new
buffer
the length of data
Create a new buffer and set the data and size of the buffer to @data and @len
respectively. @data will be freed when the buffer is unreffed, so this
function transfers ownership of @data to the new buffer.
A newly allocated buffer with @data and of size @len.
data for the new buffer
the length of data
Retrieve all the factories of the currently registered RTP header
extensions. Call gst_element_factory_create() with each factory to create
the associated #GstRTPHeaderExtension.
a #GList of
#GstElementFactory's. Use gst_plugin_feature_list_free() after use
Reads the NTP time from the @size NTP-56 extension bytes in @data and store the
result in @ntptime.
%TRUE on success.
the data to read from
the size of @data
the result NTP time
Reads the NTP time from the @size NTP-64 extension bytes in @data and store the
result in @ntptime.
%TRUE on success.
the data to read from
the size of @data
the result NTP time
Writes the NTP time in @ntptime to the format required for the NTP-56 header
extension. @data must hold at least #GST_RTP_HDREXT_NTP_56_SIZE bytes.
%TRUE on success.
the data to write to
the size of @data
the NTP time
Writes the NTP time in @ntptime to the format required for the NTP-64 header
extension. @data must hold at least #GST_RTP_HDREXT_NTP_64_SIZE bytes.
%TRUE on success.
the data to write to
the size of @data
the NTP time
Get the #GstRTPPayloadInfo for @media and @encoding_name. This function is
mostly used to get the default clock-rate and bandwidth for dynamic payload
types specified with @media and @encoding name.
The search for @encoding_name will be performed in a case insensitive way.
a #GstRTPPayloadInfo or NULL when no info could be found.
the media to find
the encoding name to find
Get the #GstRTPPayloadInfo for @payload_type. This function is
mostly used to get the default clock-rate and bandwidth for static payload
types specified with @payload_type.
a #GstRTPPayloadInfo or NULL when no info could be found.
the payload_type to find