| Farsight2 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <gst/farsight/fs-conference-iface.h> struct FsCodec; enum FsMediaType; struct FsCodecParameter; struct FsFeedbackParameter; #define FS_CODEC_ID_ANY #define FS_CODEC_ID_DISABLE FsCodec * fs_codec_new (int id,const char *encoding_name,FsMediaType media_type,guint clock_rate); void fs_codec_destroy (FsCodec *codec); FsCodec * fs_codec_copy (const FsCodec *codec); gboolean fs_codec_are_equal (const FsCodec *codec1,const FsCodec *codec2); GList * fs_codec_list_from_keyfile (const gchar *filename,GError **error); void fs_codec_list_destroy (GList *codec_list); GList * fs_codec_list_copy (const GList *codec_list); gboolean fs_codec_list_are_equal (GList *list1,GList *list2); gchar * fs_codec_to_string (const FsCodec *codec); void fs_codec_add_optional_parameter (FsCodec *codec,const gchar *name,const gchar *value); void fs_codec_remove_optional_parameter (FsCodec *codec,FsCodecParameter *param); FsCodecParameter * fs_codec_get_optional_parameter (FsCodec *codec,const gchar *name,const gchar *value); void fs_codec_add_feedback_parameter (FsCodec *codec,const gchar *type,const gchar *subtype,const gchar *extra_params); FsFeedbackParameter * fs_codec_get_feedback_parameter (FsCodec *codec,const gchar *type,const gchar *subtype,const gchar *extra_params); void fs_codec_remove_feedback_parameter (FsCodec *codec,GList *item); #define FS_CODEC_FORMAT #define FS_CODEC_ARGS (codec) const gchar * fs_media_type_to_string (FsMediaType media_type);
An FsCodec is a way to exchange codec information between the client and Farsight. The information specified in this structure is usually representative of the codec information exchanged in the signaling.
struct FsCodec {
gint id;
char *encoding_name;
FsMediaType media_type;
guint clock_rate;
guint channels;
GList *optional_params;
};
This structure reprensents one codec that can be offered or received
gint |
numeric identifier for encoding, eg. PT for SDP |
| the name of the codec | |
FsMediaType |
type of media this codec is for |
guint |
clock rate of this stream |
guint |
Number of channels codec should decode |
GList * |
key pairs of param name to param data |
typedef enum
{
FS_MEDIA_TYPE_AUDIO,
FS_MEDIA_TYPE_VIDEO,
FS_MEDIA_TYPE_LAST = FS_MEDIA_TYPE_VIDEO
} FsMediaType;
Enum used to signify the media type of a codec or stream.
| A media type that encodes audio. | |
| A media type that encodes video. | |
| Largest valid FsMediaType |
struct FsCodecParameter {
gchar *name;
gchar *value;
};
Used to store arbitary parameters for a codec
struct FsFeedbackParameter {
gchar *type;
gchar *subtype;
gchar *extra_params;
};
Use to store feedback parameters
#define FS_CODEC_ID_ANY (-1)
If the id of a FsCodec is FS_CODEC_ID_ANY, then it will be replaced with a dynamic payload type at runtime
#define FS_CODEC_ID_DISABLE (-2)
If the id of a FsCodec is FS_CODEC_ID_DISABLE, then this codec will not be used
FsCodec * fs_codec_new (int id,const char *encoding_name,FsMediaType media_type,guint clock_rate);
Allocates and initializes a FsCodec structure
|
codec identifier, if RTP this should be based on IETF RTP payload types |
|
Name of media type this encodes |
|
FsMediaType for type of codec |
|
The clock rate this codec encodes at, if applicable |
Returns : |
A newly allocated FsCodec |
void fs_codec_destroy (FsCodec *codec);
Deletes a FsCodec structure and all its data. Is a no-op on NULL codec
|
FsCodec structure to free |
FsCodec * fs_codec_copy (const FsCodec *codec);
Copies a FsCodec structure.
|
codec to copy |
Returns : |
a copy of the codec |
gboolean fs_codec_are_equal (const FsCodec *codec1,const FsCodec *codec2);
Compare two codecs, it will declare two codecs to be identical even
if their optional parameters are in a different order. NULL encoding names
are ignored.
GList * fs_codec_list_from_keyfile (const gchar *filename,GError **error);
Reads the content of a GKeyFile of the following format into a GList of FsCodec structures.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[audio/codec1] clock-rate=8000 [audio/codec1:1] clock-rate=16000 [audio/codec2] one_param=QCIF another_param=WOW [video/codec3] wierd_param=42 feedback:nack/pli=1 feedback:tfrc= |
void fs_codec_list_destroy (GList *codec_list);
Deletes a list of FsCodec structures and the list itself.
Does nothing on NULL lists.
|
a GList of FsCodec to delete |
GList * fs_codec_list_copy (const GList *codec_list);
Copies a list of FsCodec structures.
|
a GList of FsCodec to copy |
Returns : |
The new list. |
gboolean fs_codec_list_are_equal (GList *list1,GList *list2);
Verifies if two glist of fscodecs are identical
gchar * fs_codec_to_string (const FsCodec *codec);
Returns a newly-allocated string representing the codec
|
A farsight codec |
Returns : |
the newly-allocated string |
void fs_codec_add_optional_parameter (FsCodec *codec,const gchar *name,const gchar *value);
This function adds an new optional parameter to a FsCodec
|
The FsCodec to add the parameter to |
|
The name of the optional parameter |
|
The extra_params of the optional parameter |
void fs_codec_remove_optional_parameter (FsCodec *codec,FsCodecParameter *param);
Removes an optional parameter from a codec.
NULL param will do nothing.
|
a FsCodec |
|
a pointer to the FsCodecParameter to remove |
FsCodecParameter * fs_codec_get_optional_parameter (FsCodec *codec,const gchar *name,const gchar *value);
Finds the FsCodecParameter in the FsCodec that has the requested name
and, if not NULL, the requested value
|
a FsCodec |
|
The name of the parameter to search for |
|
The value of the parameter to search for or NULL for any value |
Returns : |
the FsCodecParameter from the FsCodec or NULL
|
void fs_codec_add_feedback_parameter (FsCodec *codec,const gchar *type,const gchar *subtype,const gchar *extra_params);
This function adds an new feedback parameter to a FsCodec
|
The FsCodec to add the parameter to |
|
The type of the feedback parameter |
|
The subtype of the feedback parameter |
|
The extra_params of the feeback parameter |
FsFeedbackParameter * fs_codec_get_feedback_parameter (FsCodec *codec,const gchar *type,const gchar *subtype,const gchar *extra_params);
Finds the FsFeedbackParameter in the FsCodec that has the requested subtype, type and extra_params. One of which must be non-NULL;
|
a FsCodec |
|
The subtype of the parameter to search for or NULL for any type |
|
The subtype of the parameter to search for or NULL for any subtype |
|
The extra_params of the parameter to search for or NULL for
any extra_params |
Returns : |
the FsFeedbackParameter from the FsCodec or NULL
|
void fs_codec_remove_feedback_parameter (FsCodec *codec,GList *item);
Removes an optional parameter from a codec.
NULL param will do nothing.
|
a FsCodec |
|
a pointer to the GList element to remove that contains a FsFeedbackParameter |
#define FS_CODEC_FORMAT "%d: %s %s clock:%d channels:%d params:%p"
A format that can be used in printf like format strings to format a FsCodec
#define FS_CODEC_ARGS(codec)
Formats the codec in args for FS_CODEC_FORMAT
|
a FsCodec |
const gchar * fs_media_type_to_string (FsMediaType media_type);
Gives a user-printable string representing the media type
|
A media type |
Returns : |
a static string representing the media type |