GstRtp.RTCPBuffer

Fields

Name

Type

Access

Description

buffer

Gst.Buffer

r/w

map

Gst.MapInfo

r/w

Methods

class

new (mtu)

class

new_copy_data (data)

class

new_take_data (data)

class

validate (buffer)

class

validate_data (data)

class

validate_data_reduced (data)

class

validate_reduced (buffer)

add_packet (type, packet)

get_first_packet (packet)

get_packet_count ()

unmap ()

Details

class GstRtp.RTCPBuffer

Note: The API in this module is not yet declared stable.

The GstRTPCBuffer helper functions makes it easy to parse and create regular Gst.Buffer objects that contain compound RTCP packets. These buffers are typically of ‘application/x-rtcp’ Gst.Caps.

An RTCP buffer consists of 1 or more GstRtp.RTCPPacket structures that you can retrieve with GstRtp.RTCPBuffer.get_first_packet(). GstRtp.RTCPPacket acts as a pointer into the RTCP buffer; you can move to the next packet with GstRtp.RTCPPacket.move_to_next().

classmethod new(mtu)[source]
Parameters:

mtu (int) – the maximum mtu size.

Returns:

A newly allocated buffer.

Return type:

Gst.Buffer

Create a new buffer for constructing RTCP packets. The packet will have a maximum size of mtu.

classmethod new_copy_data(data)[source]
Parameters:

data (bytes) – data for the new buffer

Returns:

A newly allocated buffer with a copy of data and of size len.

Return type:

Gst.Buffer

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.

classmethod new_take_data(data)[source]
Parameters:

data (bytes) – data for the new buffer

Returns:

A newly allocated buffer with data and of size len.

Return type:

Gst.Buffer

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.

classmethod validate(buffer)[source]
Parameters:

buffer (Gst.Buffer) – the buffer to validate

Returns:

True if buffer is a valid RTCP packet.

Return type:

bool

Check if the data pointed to by buffer is a valid RTCP packet using GstRtp.RTCPBuffer.validate_data().

classmethod validate_data(data)[source]
Parameters:

data (bytes) – the data to validate

Returns:

True if the data points to a valid RTCP packet.

Return type:

bool

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.

classmethod validate_data_reduced(data)[source]
Parameters:

data (bytes) – the data to validate

Returns:

True if the data points to a valid RTCP packet.

Return type:

bool

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.

New in version 1.6.

classmethod validate_reduced(buffer)[source]
Parameters:

buffer (Gst.Buffer) – the buffer to validate

Returns:

True if buffer is a valid RTCP packet.

Return type:

bool

Check if the data pointed to by buffer is a valid RTCP packet using GstRtp.RTCPBuffer.validate_reduced().

New in version 1.6.

add_packet(type, packet)[source]
Parameters:
Returns:

True if the packet could be created. This function returns False if the max mtu is exceeded for the buffer.

Return type:

bool

Add a new packet of type to self. packet will point to the newly created packet.

get_first_packet(packet)[source]
Parameters:

packet (GstRtp.RTCPPacket) – a GstRtp.RTCPPacket

Returns:

True if the packet existed in self.

Return type:

bool

Initialize a new GstRtp.RTCPPacket pointer that points to the first packet in self.

get_packet_count()[source]
Returns:

the number of RTCP packets in self.

Return type:

int

Get the number of RTCP packets in self.

unmap()[source]
Return type:

bool

Finish self after being constructed. This function is usually called after GstRtp.RTCPBuffer.map() and after adding the RTCP items to the new buffer.

The function adjusts the size of self with the total length of all the added packets.