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
length of payload
a #GstClockTime
Gets the internal adapter used by the depayloader.
a #GstAdapter.
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
data to set as payload
length of payload
a #GstClockTime
Tells #GstBaseRTPAudioPayload that the child element is for a frame based
audio codec
Sets the options for frame based audio codecs.
The duraction of an audio frame in milliseconds.
The size of an audio frame in bytes.
Tells #GstBaseRTPAudioPayload that the child element is for a sample based
audio codec
Sets the options for sample based audio codecs.
Size per sample in bytes.
Sets the options for sample based audio codecs.
Size per sample in bits.
Push @out_buf to the peer of @filter. This function takes ownership of
Unlike gst_base_rtp_depayload_push_ts(), this function will not apply
any timestamp on the outgoing buffer. Subclasses should therefore timestamp
outgoing buffers themselves.
a #GstFlowReturn.
a #GstBuffer
Push @out_list to the peer of @filter. This function takes ownership of
a #GstFlowReturn.
a #GstBufferList
Push @out_buf to the peer of @filter. This function takes ownership of
Unlike gst_base_rtp_depayload_push(), this function will by default apply
the last incomming timestamp on the outgoing buffer when it didn't have a
timestamp already. The set_get_timestamp vmethod can be overwritten to change
this behaviour (and take, for example, @timestamp into account).
a #GstFlowReturn.
an RTP timestamp to apply
a #GstBuffer
Check if the packet with @size and @duration would exceed the configured
maximum size.
configured MTU or max_ptime.
%TRUE if the packet of @size and @duration would exceed the
a #GstBaseRTPPayload
the size of the packet
the duration of the packet
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 #GstBaseRTPPayload
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 #GstBaseRTPPayload
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_basertppayload_push() or gst_basertppayload_set_outcaps().
a #GstBaseRTPPayload
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 #GstBaseRTPPayload
the first field name or %NULL
Different types of feedback messages.
Data structure that points to a packet at @offset in @buffer.
The size of the structure is made public to allow stack allocations.
Add a new report block to @packet with the given values.
the max MTU is exceeded or the number of report blocks is greater than
#GST_RTCP_MAX_RB_COUNT.
%TRUE if the packet was created. This function can return %FALSE if
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
Add @ssrc to the BYE @packet.
the max MTU is exceeded or the number of sources blocks is greater than
#GST_RTCP_MAX_BYE_SSRC_COUNT.
%TRUE if the ssrc was added. This function can return %FALSE if
an SSRC to add
Adds @len SSRCs in @ssrc to BYE @packet.
the max MTU is exceeded or the number of sources blocks is greater than
#GST_RTCP_MAX_BYE_SSRC_COUNT.
%TRUE if the all the SSRCs were added. This function can return %FALSE if
an array of SSRCs to add
number of elements in @ssrc
Get the @nth SSRC of the BYE @packet.
The @nth SSRC of @packet.
the nth SSRC to get
Get the reason in @packet.
a reason string. The string must be freed with g_free() after usage.
The reason for the BYE @packet or NULL if the packet did not contain
Get the length of the reason string.
present.
The length of the reason string or 0 when there is no reason string
Get the number of SSRC fields in @packet.
The number of SSRC fields in @packet.
Set the reason string to @reason in @packet.
TRUE if the string could be set.
a reason string
Get the Feedback Control Information attached to a RTPFB or PSFB @packet.
a pointer to the FCI
Get the length of the Feedback Control Information attached to a
RTPFB or PSFB @packet.
The length of the FCI in 32-bit words.
Get the media SSRC field of the RTPFB or PSFB @packet.
the media SSRC.
Get the sender SSRC field of the RTPFB or PSFB @packet.
the sender SSRC.
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
Length of the FCI in 32-bit words
Set the media SSRC field of the RTPFB or PSFB @packet.
a media SSRC
Set the sender SSRC field of the RTPFB or PSFB @packet.
a sender SSRC
Set the feedback message type of the FB @packet.
the #GstRTCPFBType to set
Get the count field in @packet.
valid packet.
The count field in @packet or -1 if @packet does not point to a
Get the length field of @packet. This is the length of the packet in
32-bit words minus one.
The length field of @packet.
Get the packet padding of the packet pointed to by @packet.
If the packet has the padding bit set.
Parse the values of the @nth report block in @packet and store the result in
the values.
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.
Move the packet pointer @packet to the next packet in the payload.
Use gst_rtcp_buffer_get_first_packet() to initialize @packet.
function.
TRUE if @packet is pointing to a valid packet after calling this
Removes the packet pointed to by @packet and moves pointer to the next one
function.
TRUE if @packet is pointing to a valid packet after calling this
Get the ssrc field of the RR @packet.
the ssrc.
Set the ssrc field of the RR @packet.
the SSRC to set
Add a new SDES entry to the current item in @packet.
reached.
%TRUE if the item could be added, %FALSE if the MTU has been
the #GstRTCPSDESType of the SDES entry
the data length
the data
Add a new SDES item for @ssrc to @packet.
items has been exceeded for the SDES packet or the MTU has been reached.
%TRUE if the item could be added, %FALSE if the maximum amount of
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.
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.
Move to the first SDES item in @packet.
TRUE if there was a first item.
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-termined copy of the entry.
%TRUE if there was valid data.
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.
Get the SSRC of the current SDES item.
the SSRC of the current item.
Move to the next SDES entry in the current item.
%TRUE if there was a next entry.
Move to the next SDES item in @packet.
TRUE if there was a next item.
Set the @nth new report block in @packet with the given values.
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.
result SSRC
result NTP time
result RTP time
result packet count
result octect count
Set the given values in the SR packet @packet.
the SSRC
the NTP time
the RTP time
the packet count
the octect count
Structure holding default payload type information.
Add a new packet of @type to @buffer. @packet will point to the newly created
packet.
if the max mtu is exceeded for the buffer.
%TRUE if the packet could be created. This function returns %FALSE
a valid RTCP buffer
the #GstRTCPType of the new packet
pointer to new packet
Finish @buffer after being constructured. This function is usually called
after gst_rtcp_buffer_new() and after adding the RTCP items to the new buffer.
The function adjusts the size of @buffer with the total length of all the
added packets.
a buffer with an RTCP packet
Initialize a new #GstRTCPPacket pointer that points to the first packet in
TRUE if the packet existed in @buffer.
a valid RTCP buffer
a #GstRTCPPacket
Get the number of RTCP packets in @buffer.
the number of RTCP packets in @buffer.
a valid RTCP buffer
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 RTCP (compound)
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
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
Get the feedback message type of the FB @packet.
The feedback message type.
a valid RTPFB or PSFB #GstRTCPPacket
Get the packet type of the packet pointed to by @packet.
pointing to a valid packet.
The packet type or GST_RTCP_TYPE_INVALID when @packet is not
a valid #GstRTCPPacket
Convert @name into a @GstRTCPSDESType. @name is typically a key in a
#GstStructure containing SDES items.
is a private sdes item.
the #GstRTCPSDESType for @name or #GST_RTCP_SDES_PRIV when @name
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
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 mecanism 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 buffer
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 mecanism 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 buffer
Application specific bits
The ID of the header extension
location for data
the size of the data in bytes
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.
MALLOCDATA of @buffer will be overwritten and will not be freed.
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.
are equal or a positive value if @seqnum1 is smaller than @segnum2.
a negative value if @seqnum1 is bigger than @seqnum2, 0 if they
a sequence number
a sequence number
Get the default clock-rate for the static payload type @payload_type.
the clock-rate is undefined.
the default clock rate or -1 if the payload type is not static or
the static payload type
Update the @exttimestamp field with @timestamp. For the first call of the
method, @exttimestamp should point to a location with a value of -1.
This function makes sure that the returned value is a constantly increasing
value even in the case where there is a timestamp wraparound.
The extended timestamp of @timestamp.
a previous extended timestamp
a new timestamp
Get the CSRC at index @idx in @buffer.
the CSRC at index @idx in host order.
the buffer
the index of the CSRC to get
Get the CSRC count of the RTP packet in @buffer.
the CSRC count of @buffer.
the buffer
Check if the extension bit is set on the RTP packet in @buffer.
TRUE if @buffer has the extension bit set.
the buffer
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 buffer
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 buffer
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 buffer
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 buffer
Check if the marker bit is set on the RTP packet in @buffer.
TRUE if @buffer has the marker bit set.
the buffer
Return the total length of the packet in @buffer.
The total length of the packet in @buffer.
the buffer
Check if the padding bit is set on the RTP packet in @buffer.
TRUE if @buffer has the padding bit set.
the buffer
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 buffer
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 buffer
Get the length of the payload of the RTP packet in @buffer.
The length of the payload in @buffer.
the buffer
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 if subbuffered.
A new buffer with the specified data of the payload.
the buffer
the offset in the payload
the length in the payload
Get the payload type of the RTP packet in @buffer.
The payload type.
the buffer
Get the sequence number of the RTP packet in @buffer.
The sequence number in host order.
the buffer
Get the SSRC of the RTP packet in @buffer.
the SSRC of @buffer in host order.
the buffer
Get the timestamp of the RTP packet in @buffer.
The timestamp in host order.
the buffer
Get the version number of the RTP packet in @buffer.
The version of @buffer.
the buffer
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 mecanism 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_list_add_extension_twobytes_header()
This function will not modify the data section of the RTP buffer, only
the header.
%TRUE if header extension could be added
a #GstBufferListIterator pointing right after the #GstBuffer where the header extension should be added
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 mecanism 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()
This function will not modify the data section of the RTP buffer, only
the header.
%TRUE if header extension could be added
a #GstBufferListIterator pointing right after the #GstBuffer where the header extension should be added
Application specific bits
The ID of the header extension
location for data
the size of the data in bytes
Splits a #GstBuffer into a #GstBufferList containing separate
buffers for the header and data sections.
a #GstBufferList
a #GstBuffer containing a RTP packet
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 bufferlist
The index of the group in the #GstBufferList
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 bufferlist
The index of the group in the #GstBufferList
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
Get the length of the payload of the RTP packet in @list.
The length of the payload in @list.
the buffer list
Get the payload type of the first RTP packet in @list.
All packets in @list should have the same payload type.
The payload type.
the buffer list
Get the sequence number of the first RTP packet in @list.
All packets within @list have the same sequence number.
The seq number
the buffer list
Get the SSRC of the first RTP packet in @list.
All RTP packets within @list have the same SSRC.
the SSRC of @list in host order.
the buffer list
Get the timestamp of the first RTP packet in @list.
All packets within @list have the same timestamp.
The timestamp in host order.
the buffer list
Set the payload type of each RTP packet in @list to @payload_type.
the buffer list
the new type
Set the sequence number of each RTP packet in @list to @seq.
The seq number of the last packet in the list + 1.
the buffer list
the new sequence number
Set the SSRC on each RTP packet in @list to @ssrc.
the buffer list
the new SSRC
Set the timestamp of each RTP packet in @list to @timestamp.
the buffer list
the new timestamp
Check if all RTP packets in the @list are valid using validate_data().
Use this function to validate an list before using the other functions in
this module.
TRUE if @list consists only of valid RTP packets.
the buffer list to validate
Allocate a new #GstBuffer with enough data to hold an RTP packet with
All other RTP header fields will be set to 0/FALSE.
parameters.
A newly allocated buffer that can hold an RTP packet with given
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
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
Set the amount of padding in the RTP packet in @buffer to
the buffer
the new amount of padding
Modify the CSRC at index @idx in @buffer to @csrc.
the buffer
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 buffer
the new extension
Set the extension bit of the rtp buffer and fill in the @bits and @length of the
extension header. It will refuse to set the extension data if the buffer is not
large enough.
True if done.
the buffer
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 buffer
the new marker
Set the total @buffer size to @len. The data in the buffer will be made
larger if needed. Any padding will be removed from the packet.
the buffer
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 buffer
the new type
Set the sequence number of the RTP packet in @buffer to @seq.
the buffer
the new sequence number
Set the SSRC on the RTP packet in @buffer to @ssrc.
the buffer
the new SSRC
Set the timestamp of the RTP packet in @buffer to @timestamp.
the buffer
the new timestamp
Set the version of the RTP packet in @buffer to @version.
the buffer
the new version
Check if the data pointed to by @buffer is a valid RTP packet using
validate_data().
Use this function to validate a packet before using the other functions in
this module.
TRUE if @buffer is a valid RTP packet.
the buffer to validate
Check if the @data and @size point to the data of a valid RTP packet.
This function checks the length, version and padding of the packet data.
Use this function to validate a packet before using the other functions in
this module.
TRUE if the data points to a valid RTP packet.
the data to validate
the length of @data to validate
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 insensitve 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