## Utility functions Utility functions — Miscellaneous useful functions |

## Functions

void | fs_utils_set_bitrate ()
GList * | fs_utils_get_default_codec_preferences ()
GKeyFile * | fs_utils_get_default_element_properties ()
GList * | fs_utils_get_default_rtp_header_extension_preferences ()

## Includes

    #include <farstream/fs-utils.h>

## Description

## Functions

### fs_utils_set_bitrate ()

    void
    fs_utils_set_bitrate (GstElement *element,
                          glong bitrate);

This allows setting the bitrate on all elements that have a "bitrate" property without having to know the type or of the unit used by that element.

This will be obsolete in 0.11 (when all elements use bit/sec for the "bitrate" property.

#### Parameters

element | The GstElement |
bitrate | The bitrate in bits/sec |

### fs_utils_get_default_codec_preferences ()

    GList *
    fs_utils_get_default_codec_preferences
                                   (GstElement *element);

These default codec preferences should work with the elements that are available in the main GStreamer element repositories. They should be suitable for standards based protocols like SIP or XMPP.

#### Parameters

element | Element for which to fetch default codec preferences |

#### Returns

The default codec preferences for this plugin. This GList should be freed with `fs_codec_list_destroy()`.

[element-type FsCodec][transfer full]

### fs_utils_get_default_element_properties ()

    GKeyFile *
    fs_utils_get_default_element_properties
                                   (GstElement *element);

This function produces a GKeyFile that can be fed to `fs_element_added_notifier_set_properties_from_keyfile()`. If no default properties have been found, it will return `NULL`.

#### Parameters

element | Element for which to fetch default element properties |

#### Returns

a GKeyFile containing the default element properties for this element or `NULL` if no properties were found. Caller must free the GKeyFile when he is done.

### fs_utils_get_default_rtp_header_extension_preferences ()

    GList *
    fs_utils_get_default_rtp_header_extension_preferences
                                   (GstElement *element,
                                    FsMediaType media_type);

These default rtp header extension preferences should work with the elements that are available in the main GStreamer element repositories. They should be suitable for standards based protocols like SIP or XMPP.

#### Parameters

element | Element for which to fetch default RTP Header Extension preferences |
media_type | The FsMediaType for which to get default RTP Header Extension preferences |

#### Returns

The default rtp header extension preferences for this plugin, this GList should be freed with `fs_codec_list_destroy()`.

[element-type FsCodec][transfer full]

## Types and Values