pointer to RTP buffer
array of data
array of #GstMapInfo
array of size
internal state
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()
The ID of the header extension (between 1 and 14).
location for data
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()
Application specific bits
The ID of the header extension
location for data
Get the CSRC at index idx
in buffer
.
the index of the CSRC to get
Get the CSRC count of the RTP packet in buffer
.
Check if the extension bit is set on the RTP packet in buffer
.
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.
Parses RFC 5285 style header extensions with a one byte header. It will return the nth extension with the requested id.
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
Parses RFC 5285 style header extensions with a two bytes header. It will return the nth extension with the requested id.
The ID of the header extension to be read (between 1 and 14).
Read the nth extension packet with the requested ID
Return the total length of the header in buffer
. This include the length of
the fixed header, the CSRC list and the extension header.
Check if the marker bit is set on the RTP packet in buffer
.
Return the total length of the packet in buffer
.
Check if the padding bit is set on the RTP packet in buffer
.
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
.
Get the length of the payload of the RTP packet in 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
is subbuffered.
the offset in the payload
the length in the payload
Get the payload type of the RTP packet in buffer
.
Get the sequence number of the RTP packet in buffer
.
Get the SSRC of the RTP packet in buffer
.
Get the timestamp of the RTP packet in buffer
.
Get the version number of the RTP packet in buffer
.
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 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.
Modify the CSRC at index idx
in buffer
to csrc
.
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 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.
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 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 new packet length
Set the padding bit on the RTP packet in buffer
to padding
.
the new padding
Set the payload type of the RTP packet in buffer
to payload_type
.
the new type
Set the sequence number of the RTP packet in buffer
to seq
.
the new sequence number
Set the SSRC on the RTP packet in buffer
to ssrc
.
the new SSRC
Set the timestamp of the RTP packet in buffer
to timestamp
.
the new timestamp
Set the version of the RTP packet in buffer
to version
.
the new version
Unmap rtp
previously mapped with gst_rtp_buffer_map().
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 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 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 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 sequence number
a sequence number
Get the default clock-rate for the static payload type payload_type
.
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:
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.
#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
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.
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.
the total length of the packet
the amount of padding
the number of CSRC entries
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.