GstPlugin

Name

GstPlugin -- Dynamically loadable Elements

Synopsis


#include <gst/gst.h>


struct      GstPlugin;
struct      GstPluginElement;
GstPlugin*  (*GstPluginInitFunc)            (GModule *module);
GstPlugin*  gst_plugin_new                  (const gchar *name);
void        gst_plugin_set_name             (GstPlugin *plugin,
                                             const gchar *name);
const gchar* gst_plugin_get_name            (GstPlugin *plugin);
const gchar* gst_plugin_get_longname        (GstPlugin *plugin);
void        gst_plugin_set_longname         (GstPlugin *plugin,
                                             const gchar *longname);
const gchar* gst_plugin_get_filename        (GstPlugin *plugin);
gboolean    gst_plugin_is_loaded            (GstPlugin *plugin);
void        gst_plugin_load_all             (void);
gboolean    gst_plugin_load                 (const gchar *name);
gboolean    gst_plugin_load_absolute        (const gchar *name);
void        gst_plugin_add_path             (const gchar *path);
gboolean    gst_library_load                (const gchar *name);
void        gst_plugin_add_factory          (GstPlugin *plugin,
                                             GstElementFactory *factory);
void        gst_plugin_add_type             (GstPlugin *plugin,
                                             GstTypeFactory *factory);
GstPlugin*  gst_plugin_find                 (const gchar *name);
GList*      gst_plugin_get_list             (void);
GList*      gst_plugin_get_factory_list     (GstPlugin *plugin);
GList*      gst_plugin_get_type_list        (GstPlugin *plugin);
GstElementFactory* gst_plugin_find_elementfactory
                                            (const gchar *name);
GstElementFactory* gst_plugin_load_elementfactory
                                            (const gchar *name);
void        gst_plugin_load_typefactory     (const gchar *mime);
void        gst_plugin_load_thyself         (xmlNodePtr parent);
xmlNodePtr  gst_plugin_save_thyself         (xmlNodePtr parent);

Description

GStreamer is extensible so GstElements can be loaded at runtime.

Details

struct GstPlugin

struct GstPlugin {
  gchar *name;			/* name of the plugin */
  gchar *longname;		/* long name of plugin */
  gchar *filename;		/* filename it came from */

  GList *types;			/* list of types provided */
  gint numtypes;
  GList *elements;		/* list of elements provided */
  gint numelements;

  gboolean loaded;              /* if the plugin is in memory */
};


struct GstPluginElement

struct GstPluginElement;


GstPluginInitFunc ()

GstPlugin*  (*GstPluginInitFunc)            (GModule *module);

A plugin should implement this function called plugin_init. It will be called by the loader at statup.

module :The GModule it was loaded from
Returns :The plugin or NULL is an error was detected.


gst_plugin_new ()

GstPlugin*  gst_plugin_new                  (const gchar *name);

Create a new plugin with given name.

name : name of new plugin
Returns : new plugin


gst_plugin_set_name ()

void        gst_plugin_set_name             (GstPlugin *plugin,
                                             const gchar *name);

Sets the name (should be short) of the plugin.

plugin : plugin to set name of
name : new name


gst_plugin_get_name ()

const gchar* gst_plugin_get_name            (GstPlugin *plugin);

Get the short name of the plugin

plugin : plugin to get the name of
Returns : the name of the plugin


gst_plugin_get_longname ()

const gchar* gst_plugin_get_longname        (GstPlugin *plugin);

Get the long descriptive name of the plugin

plugin : plugin to get long name of
Returns : the long name of the plugin


gst_plugin_set_longname ()

void        gst_plugin_set_longname         (GstPlugin *plugin,
                                             const gchar *longname);

Sets the long name (should be descriptive) of the plugin.

plugin : plugin to set long name of
longname : new long name


gst_plugin_get_filename ()

const gchar* gst_plugin_get_filename        (GstPlugin *plugin);

get the filename of the plugin

plugin : plugin to get the filename of
Returns : the filename of the plugin


gst_plugin_is_loaded ()

gboolean    gst_plugin_is_loaded            (GstPlugin *plugin);

queries if the plugin is loaded into memory

plugin : plugin to query
Returns : TRUE is loaded, FALSE otherwise


gst_plugin_load_all ()

void        gst_plugin_load_all             (void);

Load all plugins in the path.


gst_plugin_load ()

gboolean    gst_plugin_load                 (const gchar *name);

Load the named plugin. Name should be given as &quot;libplugin.so&quot;.

name : name of plugin to load
Returns : whether the plugin was loaded or not


gst_plugin_load_absolute ()

gboolean    gst_plugin_load_absolute        (const gchar *name);

name : name of plugin to load
Returns : whether or not the plugin loaded


gst_plugin_add_path ()

void        gst_plugin_add_path             (const gchar *path);

Add a directory to the path searched for plugins.

path : the directory to add to the search path


gst_library_load ()

gboolean    gst_library_load                (const gchar *name);

Load the named library. Name should be given as &quot;liblibrary.so&quot;.

name : name of library to load
Returns : whether the library was loaded or not


gst_plugin_add_factory ()

void        gst_plugin_add_factory          (GstPlugin *plugin,
                                             GstElementFactory *factory);

Add factory to the list of those provided by the plugin.

plugin : plugin to add factory to
factory : factory to add


gst_plugin_add_type ()

void        gst_plugin_add_type             (GstPlugin *plugin,
                                             GstTypeFactory *factory);

Add a typefactory to the list of those provided by the plugin.

plugin : plugin to add type to
factory : the typefactory to add


gst_plugin_find ()

GstPlugin*  gst_plugin_find                 (const gchar *name);

Search the list of registered plugins for one of the given name

name : name of plugin to find
Returns : pointer to the GstPlugin if found, NULL otherwise


gst_plugin_get_list ()

GList*      gst_plugin_get_list             (void);

get the currently loaded plugins

Returns :; a GList of GstPlugin elements


gst_plugin_get_factory_list ()

GList*      gst_plugin_get_factory_list     (GstPlugin *plugin);

get a list of all the factories that this plugin provides

plugin : the plugin to get the factories from
Returns : a GList of factories


gst_plugin_get_type_list ()

GList*      gst_plugin_get_type_list        (GstPlugin *plugin);

get a list of all the typefactories that this plugin provides

plugin : the plugin to get the typefactories from
Returns : a GList of factories


gst_plugin_find_elementfactory ()

GstElementFactory* gst_plugin_find_elementfactory
                                            (const gchar *name);

Find a registered elementfactory by name.

name : name of elementfactory to find
Returns : GstElementFactory if found, NULL if not


gst_plugin_load_elementfactory ()

GstElementFactory* gst_plugin_load_elementfactory
                                            (const gchar *name);

Load a registered elementfactory by name.

name : name of elementfactory to load
Returns : GstElementFactory if loaded, NULL if not


gst_plugin_load_typefactory ()

void        gst_plugin_load_typefactory     (const gchar *mime);

Load a registered typefactory by mime type.

mime : name of typefactory to load


gst_plugin_load_thyself ()

void        gst_plugin_load_thyself         (xmlNodePtr parent);

load the plugin from an XML representation

parent : the parent node to load the plugin from


gst_plugin_save_thyself ()

xmlNodePtr  gst_plugin_save_thyself         (xmlNodePtr parent);

saves the plugin into an XML representation

parent : the parent node to save the plugin to
Returns : the new XML node