## FsPlugin FsPlugin — A class for defining Farsight plugins |

## Synopsis

    #include <gst/farsight/fs-plugin.h>

    struct              FsPlugin;
    GObject *           fs_plugin_create_valist             (const gchar *name,
                                                             const gchar *type_suffix,
                                                             GError **error,
                                                             const gchar *first_property_name,
                                                             va_list var_args);
    GObject *           fs_plugin_create                    (const gchar *name,
                                                             const gchar *type_suffix,
                                                             GError **error,
                                                             const gchar *first_property_name,
                                                             ...);
    #define             FS_INIT_PLUGIN                      (type_register_func)
    gchar **            fs_plugin_list_available            (const gchar *type_suffix);

## Description

This class is a generic class to load GType plugins based on their name. With this simple class, you can only have one type per plugin.

## Details

### struct FsPlugin

    struct FsPlugin {
      GTypeModule parent;
    };

This structure represents a plugin, it is opaque.

GTypeModule `parent`; | the parent object

### fs_plugin_create_valist ()

    GObject *           fs_plugin_create_valist             (const gchar *name,
                                                             const gchar *type_suffix,
                                                             GError **error,
                                                             const gchar *first_property_name,
                                                             va_list var_args);

Loads the appropriate plugin if necessary and creates a GObject of the requested type

`name` : | The name of the plugin to load
`type_suffix` : | The type of plugin to load (normally "transmitter")
`error` : | location of a GError, or NULL if no error occured
`first_property_name` : | The name of the first property to be set on the object
`var_args` : | The rest of the arguments
Returns : | The object created (or NULL if there is an error)

### fs_plugin_create ()

    GObject *           fs_plugin_create                    (const gchar *name,
                                                             const gchar *type_suffix,
                                                             GError **error,
                                                             const gchar *first_property_name,
                                                             ...);

Loads the appropriate plugin if necessary and creates a GObject of the requested type

`name` : | The name of the plugin to load
`type_suffix` : | The type of plugin to load (normally "transmitter")
`error` : | location of a GError, or NULL if no error occured
`first_property_name` : | The name of the first property to be set on the object
`...` : | The NULL-terminated list of properties to set on the transmitter
Returns : | The object created (or NULL if there is an error)

### FS_INIT_PLUGIN()

    #define             FS_INIT_PLUGIN(type_register_func)

This macro is used to declare Farsight plugins and must be used once in any farsight plugin.

`type_register_func` : | A function that register a GType and returns it

### fs_plugin_list_available ()

    gchar **            fs_plugin_list_available            (const gchar *type_suffix);

Gets the list of all available plugins of a certain type

`type_suffix` : | Get list of plugins with this type suffix
Returns : | a newly allocated NULL terminated array of strings or `NULL` if no strings were found. It should be freed with `g_strfreev()`.