GstRtp.RTPHeaderExtension

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Element Gst.Element GstRtp.RTPHeaderExtension GstRtp.RTPHeaderExtension Gst.Element->GstRtp.RTPHeaderExtension Gst.Object->Gst.Element

Subclasses:

None

Methods

Inherited:

Gst.Element (82), Gst.Object (27), GObject.Object (37)

Structs:

GstRtp.RTPHeaderExtensionClass (1), Gst.ElementClass (10), GObject.ObjectClass (5)

class

create_from_uri (uri)

class

set_uri (uri)

get_direction ()

get_id ()

get_max_size (input_meta)

get_sdp_caps_field_name ()

get_supported_flags ()

get_uri ()

read (read_flags, data, buffer)

set_attributes_from_caps (caps)

set_caps_from_attributes (caps)

set_caps_from_attributes_helper (caps, attributes)

set_direction (direction)

set_id (ext_id)

set_non_rtp_sink_caps (caps)

set_wants_update_non_rtp_src_caps (state)

update_non_rtp_src_caps (caps)

wants_update_non_rtp_src_caps ()

write (input_meta, write_flags, output, data)

Virtual Methods

Inherited:

Gst.Element (16), Gst.Object (1), GObject.Object (7)

do_get_max_size (input_meta)

do_get_supported_flags ()

do_read (read_flags, data, buffer)

do_set_attributes (direction, attributes)

do_set_caps_from_attributes (caps)

do_set_non_rtp_sink_caps (caps)

do_update_non_rtp_src_caps (caps)

do_write (input_meta, write_flags, output, data)

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

Gst.Element (3), Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Element (3), Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent

Gst.Element

r

the parent GObject.Object

Class Details

class GstRtp.RTPHeaderExtension(**kwargs)
Bases:

Gst.Element

Abstract:

Yes

Structure:

GstRtp.RTPHeaderExtensionClass

Instance struct for a RTP Audio/Video header extension.

New in version 1.20.

classmethod create_from_uri(uri)[source]
Parameters:

uri (str) – the rtp header extension URI to search for

Returns:

the GstRtp.RTPHeaderExtension for uri or None

Return type:

GstRtp.RTPHeaderExtension or None

New in version 1.20.

classmethod set_uri(uri)
Parameters:

uri (str) – the RTP Header extension uri for self

Set the URI for this RTP header extension implementation.

New in version 1.20.

get_direction()[source]
Returns:

The direction

Return type:

GstRtp.RTPHeaderExtensionDirection

Retrieve the direction

New in version 1.20.

get_id()[source]
Returns:

the RTP extension id configured on self

Return type:

int

New in version 1.20.

get_max_size(input_meta)[source]
Parameters:

input_meta (Gst.Buffer) – a Gst.Buffer

Returns:

the maximum size of the data written by this extension

Return type:

int

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.

New in version 1.20.

get_sdp_caps_field_name()[source]
Returns:

the Gst.Structure field name used in SDP-like Gst.Caps for this self configuration

Return type:

str

New in version 1.20.

get_supported_flags()[source]
Returns:

the flags supported by this instance of self

Return type:

GstRtp.RTPHeaderExtensionFlags

New in version 1.20.

get_uri()[source]
Returns:

the RTP extension URI for this object

Return type:

str or None

New in version 1.20.

read(read_flags, data, buffer)[source]
Parameters:
Returns:

whether the extension could be read from data

Return type:

bool

Read the RTP header extension from data.

New in version 1.20.

set_attributes_from_caps(caps)[source]
Parameters:

caps (Gst.Caps) – the Gst.Caps to configure this extension with

Returns:

whether the caps could be successfully set on self.

Return type:

bool

GstRtp.RTPHeaderExtension.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().

New in version 1.20.

set_caps_from_attributes(caps)[source]
Parameters:

caps (Gst.Caps) – writable Gst.Caps to modify

Returns:

whether the configured attributes on self can successfully be set on caps

Return type:

bool

GstRtp.RTPHeaderExtension.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().

New in version 1.20.

set_caps_from_attributes_helper(caps, attributes)[source]
Parameters:
Returns:

whether the self attributes could be set on caps.

Return type:

bool

Helper implementation for GstRTPExtensionClass::set_caps_from_attributes that sets the self uri on caps with the specified extension id as required for sdp Gst.Caps.

Requires that the extension does not have any attributes or direction advertised in caps.

New in version 1.20.

set_direction(direction)[source]
Parameters:

direction (GstRtp.RTPHeaderExtensionDirection) – The direction

Set the direction that this header extension should be used in. If GstRtp.RTPHeaderExtensionDirection.INHERITED is included, the direction will not be included in the caps (as it shouldn’t be in the extmap line in the SDP).

New in version 1.20.

set_id(ext_id)[source]
Parameters:

ext_id (int) – The id of this extension

sets the RTP extension id on self

New in version 1.20.

set_non_rtp_sink_caps(caps)[source]
Parameters:

caps (Gst.Caps) – sink Gst.Caps

Returns:

Whether caps could be read successfully

Return type:

bool

Passes RTP payloader’s sink (i.e. not payloaded) caps to the header extension.

New in version 1.20.

set_wants_update_non_rtp_src_caps(state)[source]
Parameters:

state (bool) – True if caps update is needed

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, GstRtp.RTPBaseDepayload will eventually invoke GstRtp.RTPHeaderExtension.update_non_rtp_src_caps() to have the caps update applied. Applying the update also flips the internal “wants update” flag back to False.

New in version 1.20.

update_non_rtp_src_caps(caps)[source]
Parameters:

caps (Gst.Caps) – src Gst.Caps to modify

Returns:

whether caps were modified successfully

Return type:

bool

Updates depayloader src caps based on the information received in RTP header. caps must be writable as this function may modify them.

New in version 1.20.

wants_update_non_rtp_src_caps()[source]
Returns:

Whether self wants to update depayloader’s src caps.

Return type:

bool

Call this function after GstRtp.RTPHeaderExtension.read() to check if the depayloader’s src caps need updating with data received in the last RTP packet.

New in version 1.20.

write(input_meta, write_flags, output, data)[source]
Parameters:
Returns:

the size of the data written, < 0 on failure

Return type:

int

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 GstRtp.RTPHeaderExtension.get_max_size().

New in version 1.20.

do_get_max_size(input_meta) virtual
Parameters:

input_meta (Gst.Buffer) – a Gst.Buffer

Returns:

the maximum size of the data written by this extension

Return type:

int

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.

New in version 1.20.

do_get_supported_flags() virtual
Returns:

the flags supported by this instance of ext

Return type:

GstRtp.RTPHeaderExtensionFlags

retrieve the supported flags

New in version 1.20.

do_read(read_flags, data, buffer) virtual
Parameters:
Returns:

whether the extension could be read from data

Return type:

bool

Read the RTP header extension from data.

New in version 1.20.

do_set_attributes(direction, attributes) virtual
Parameters:
Return type:

bool

set the necessary attributes that may be signaled e.g. with an SDP.

do_set_caps_from_attributes(caps) virtual
Parameters:

caps (Gst.Caps) – writable Gst.Caps to modify

Returns:

whether the configured attributes on ext can successfully be set on caps

Return type:

bool

GstRtp.RTPHeaderExtension.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().

New in version 1.20.

do_set_non_rtp_sink_caps(caps) virtual
Parameters:

caps (Gst.Caps) – sink Gst.Caps

Returns:

Whether caps could be read successfully

Return type:

bool

Passes RTP payloader’s sink (i.e. not payloaded) caps to the header extension.

New in version 1.20.

do_update_non_rtp_src_caps(caps) virtual
Parameters:

caps (Gst.Caps) – src Gst.Caps to modify

Returns:

whether caps were modified successfully

Return type:

bool

Updates depayloader src caps based on the information received in RTP header. caps must be writable as this function may modify them.

New in version 1.20.

do_write(input_meta, write_flags, output, data) virtual
Parameters:
Returns:

the size of the data written, < 0 on failure

Return type:

int

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 GstRtp.RTPHeaderExtension.get_max_size().

New in version 1.20.