FarsightCodec

FarsightCodec — A descriptor of a codec

Functions

Types and Values

Description

Functions

farsight_codec_init ()

void
farsight_codec_init (FarsightCodec *codec,
                     int id,
                     const char *encoding_name,
                     FarsightMediaType media_type,
                     guint clock_rate);

Initialises a FarsightCodec structure

Parameters

codec

FarsightCodec structure to initialise

 

id

codec identifier, if RTP this should be based on IETF RTP payload types

 

encoding_name

Name of media type this encodes

 

media_type

FarsightMediaType for type of codec

 

clock_rate

The clock rate this codec encodes at, if applicable

 

farsight_codec_destroy ()

void
farsight_codec_destroy (FarsightCodec *codec);

Deletes a FarsightCodec structure and all its data

Parameters

codec

FarsightCodec structure to free

 

farsight_codec_copy ()

FarsightCodec *
farsight_codec_copy (FarsightCodec *codec);

Copies a FarsightCodec structure.

Parameters

codec

codec to copy

 

Returns

a copy of the codec


farsight_codec_list_destroy ()

void
farsight_codec_list_destroy (GList *codec_list);

Deletes a list of FarsightCodec structures and the list itself

Parameters

codec_list

a GList of FarsightCodec to delete

 

farsight_codec_list_copy ()

GList *
farsight_codec_list_copy (const GList *codec_list);

Copies a list of FarsightCodec structures.

Parameters

codec_list

a GList of FarsightCodec to copy

 

Returns

The new list.


farsight_codec_list_from_keyfile ()

GList *
farsight_codec_list_from_keyfile (const gchar *filename);

Reads the content of a GKeyFile of the following format into a GList of FarsightCodec structures.

Example:

1
2
3
4
5
6
7
8
9
10
11
12
[audio/codec1]
clock-rate=8000

[audio/codec1:1]
clock-rate=16000

[audio/codec2]
one_param=QCIF
another_param=WOW

[audio/codec3]
id=-1

If "id" is set to a negative value, it means that it will prevent the system for auto-offering any codec matching the entry

Parameters

filename

Name of the GKeyFile to read the codecs parameters from

 

Returns

The read GList of FarsightCodec or NULL if an error appended


farsight_codec_to_string ()

gchar *
farsight_codec_to_string (FarsightCodec *codec);

Returns a newly-allocated string representing the codec

Parameters

codec

A farsight codec

 

Returns

the newly-allocated string


farsight_media_type_to_string ()

const gchar *
farsight_media_type_to_string (FarsightMediaType media_type);

Types and Values

struct FarsightCodec

struct FarsightCodec {
  gint id;
  char *encoding_name;
  FarsightMediaType media_type;
  guint clock_rate;
  guint channels;
  GList *optional_params;
};

Members

gint id;

numeric identifier for encoding, eg. PT for SDP

 

char *encoding_name;

the name of the codec

 

FarsightMediaType media_type;

type of media this codec is for

 

guint clock_rate;

clock rate of this stream

 

guint channels;

Number of channels codec should decode

 

GList *optional_params;

key pairs of param name to param data

 

struct FarsightCodecParameter

struct FarsightCodecParameter {
    gchar *name;
    gchar *value;
};

Used to store arbitary parameters for a codec

Members

gchar *name;

paramter name.

 

gchar *value;

parameter value.

 

struct FarsightCodecPreference

struct FarsightCodecPreference {
    gchar *encoding_name;
    gint clock_rate;
};

Used to give a preferece for what type of codec to use.

Members

gchar *encoding_name;

name of encoding preferred

 

gint clock_rate;

rate of codec preffered

 

enum FarsightMediaType

Enum used to signify the media type of a codec or stream.

Members

FARSIGHT_MEDIA_TYPE_AUDIO

A media type that encodes audio.

 

FARSIGHT_MEDIA_TYPE_VIDEO

A media type that encodes video.

 

FARSIGHT_MEDIA_TYPE_LAST