Farstream.Codec

Fields

Name

Type

Access

Description

channels

int

r/w

Number of channels codec should decode

clock_rate

int

r/w

clock rate of this stream

encoding_name

str

r/w

the name of the codec

feedback_params

[Farstream.FeedbackParameter]

r/w

key triplets of feedbck param type, subtype and extra string that is supported for this codec

id

int

r/w

numeric identifier for encoding, eg. PT for SDP

media_type

Farstream.MediaType

r/w

type of media this codec is for

minimum_reporting_interval

int

r/w

The minimum interval between two RTCP reports, If it is not specified (GObject.G_MAXUINT), it is up to the protocol to decide (it is 5 seconds for RTP).

optional_params

[Farstream.CodecParameter]

r/w

key pairs of param name to param data

Methods

class

new (id, encoding_name, media_type, clock_rate)

add_feedback_parameter (type, subtype, extra_params)

add_optional_parameter (name, value)

are_equal (codec2)

copy ()

get_feedback_parameter (type, subtype, extra_params)

get_optional_parameter (name, value)

remove_feedback_parameter (item)

remove_optional_parameter (param)

to_string ()

Details

class Farstream.Codec

This structure reprensents one codec that can be offered or received

classmethod new(id, encoding_name, media_type, clock_rate)
Parameters:
  • id (int) – codec identifier, if RTP this should be based on IETF RTP payload types

  • encoding_name (str) – Name of media type this encodes

  • media_type (Farstream.MediaType) – Farstream.MediaType for type of codec

  • clock_rate (int) – The clock rate this codec encodes at, if applicable

Returns:

A newly allocated Farstream.Codec

Return type:

Farstream.Codec

Allocates and initializes a Farstream.Codec structure

add_feedback_parameter(type, subtype, extra_params)
Parameters:
  • type (str) – The type of the feedback parameter

  • subtype (str) – The subtype of the feedback parameter

  • extra_params (str) – The extra_params of the feeback parameter

This function adds an new feedback parameter to a Farstream.Codec

add_optional_parameter(name, value)
Parameters:
  • name (str) – The name of the optional parameter

  • value (str) – The extra_params of the optional parameter

This function adds an new optional parameter to a Farstream.Codec

are_equal(codec2)
Parameters:

codec2 (Farstream.Codec) – Second codec

Returns:

True of the codecs are identical, False otherwise

Return type:

bool

Compare two codecs, it will declare two codecs to be identical even if their optional parameters are in a different order. None encoding names are ignored.

copy()
Returns:

a copy of the codec

Return type:

Farstream.Codec

Copies a Farstream.Codec structure.

get_feedback_parameter(type, subtype, extra_params)
Parameters:
  • type (str or None) – The subtype of the parameter to search for or None for any type

  • subtype (str or None) – The subtype of the parameter to search for or None for any subtype

  • extra_params (str or None) – The extra_params of the parameter to search for or None for any extra_params

Returns:

the Farstream.FeedbackParameter from the Farstream.Codec or None

Return type:

Farstream.FeedbackParameter

Finds the Farstream.FeedbackParameter in the Farstream.Codec that has the requested subtype, type and extra_params. One of which must be non-None;

get_optional_parameter(name, value)
Parameters:
  • name (str) – The name of the parameter to search for

  • value (str or None) – The value of the parameter to search for or None for any value

Returns:

the Farstream.CodecParameter from the Farstream.Codec or None

Return type:

Farstream.CodecParameter

Finds the Farstream.CodecParameter in the Farstream.Codec that has the requested name and, if not None, the requested value

remove_feedback_parameter(item)
Parameters:

item ([Farstream.FeedbackParameter]) – a pointer to the GLib.List element to remove that contains a Farstream.FeedbackParameter

Removes an optional parameter from a codec.

None param will do nothing.

remove_optional_parameter(param)
Parameters:

param (Farstream.CodecParameter) – a pointer to the Farstream.CodecParameter to remove

Removes an optional parameter from a codec.

None param will do nothing.

to_string()
Returns:

the newly-allocated string

Return type:

str

Returns a newly-allocated string representing the codec