1 <chapter id="chapter-plugins">
3 <!-- FIXME: introduce type definitions before this chapter -->
5 A plugin is a shared library that contains at least one of the following
12 one or more element factories
17 one or more type definitions
22 one or more auto-pluggers
27 exported symbols for use in other plugins
33 All plugins should implement one function, <function>plugin_init</function>,
34 that creates all the element factories and registers all the type
35 definitions contained in the plugin.
36 Without this function, a plugin cannot be registered.
39 The plugins are maintained in the plugin system. Optionally, the
40 type definitions and the element factories can be saved into an XML
41 representation so that the plugin system does not have to load all
42 available plugins in order to know their definition.
46 The basic plugin structure has the following fields:
49 typedef struct _GstPlugin GstPlugin;
52 gchar *name; /* name of the plugin */
53 gchar *longname; /* long name of plugin */
54 gchar *filename; /* filename it came from */
56 GList *types; /* list of types provided */
58 GList *elements; /* list of elements provided */
60 GList *autopluggers; /* list of autopluggers provided */
63 gboolean loaded; /* if the plugin is in memory */
68 You can query a <classname>GList</classname> of available plugins with the
69 function <function>gst_registry_pool_plugin_list</function> as this example
75 plugins = gst_registry_pool_plugin_list ();
78 GstPlugin *plugin = (GstPlugin *)plugins->data;
80 g_print ("plugin: %s\n", gst_plugin_get_name (plugin));
82 plugins = g_list_next (plugins);