Next: , Previous: GstPluginFeature, Up: Top


29 GstPlugin

Container for features loaded from a shared object module

29.1 Overview

GStreamer is extensible, so <gst-element> instances can be loaded at runtime. A plugin system can provide one or more of the basic GStreamer<gst-plugin-feature> subclasses.

A plugin should export a symbol gst_plugin_desc that is a struct of type <gst-plugin-desc>. the plugin loader will check the version of the core library the plugin was linked against and will create a new <gst-plugin>. It will then call the <gst-plugin-init-func> function that was provided in the gst_plugin_desc.

Once you have a handle to a <gst-plugin> (e.g. from the <gst-registry-pool>), you can add any object that subclasses <gst-plugin-feature>.

Use gst-plugin-find-feature and gst-plugin-get-feature-list to find features in a plugin.

Usually plugins are always automaticlly loaded so you don't need to call gst-plugin-load explicitly to bring it into memory. There are options to statically link plugins to an app or even use GStreamer without a plugin repository in which case gst-plugin-load can be needed to bring the plugin into memory.

29.2 Usage

— Class: <gst-plugin>

This <gobject> class defines no properties, other than those defined by its superclasses.

— Function: gst-plugin-error-quark   (ret unsigned-int)

Get the error quark.

ret
The error quark used in GError messages
— Function: gst-plugin-get-name (self <gst-plugin>)   (ret mchars)
— Method: get-name

Get the short name of the plugin

plugin
plugin to get the name of
ret
the name of the plugin
— Function: gst-plugin-get-description (self <gst-plugin>)   (ret mchars)
— Method: get-description

Get the long descriptive name of the plugin

plugin
plugin to get long name of
ret
the long name of the plugin
— Function: gst-plugin-get-filename (self <gst-plugin>)   (ret mchars)
— Method: get-filename

get the filename of the plugin

plugin
plugin to get the filename of
ret
the filename of the plugin
— Function: gst-plugin-get-license (self <gst-plugin>)   (ret mchars)
— Method: get-license

get the license of the plugin

plugin
plugin to get the license of
ret
the license of the plugin
— Function: gst-plugin-get-package (self <gst-plugin>)   (ret mchars)
— Method: get-package

get the package the plugin belongs to.

plugin
plugin to get the package of
ret
the package of the plugin
— Function: gst-plugin-get-origin (self <gst-plugin>)   (ret mchars)
— Method: get-origin

get the URL where the plugin comes from

plugin
plugin to get the origin of
ret
the origin of the plugin
— Function: gst-plugin-get-source (self <gst-plugin>)   (ret mchars)
— Method: get-source

get the source module the plugin belongs to.

plugin
plugin to get the source of
ret
the source of the plugin
— Function: gst-plugin-get-version (self <gst-plugin>)   (ret mchars)
— Method: get-version

get the version of the plugin

plugin
plugin to get the version of
ret
the version of the plugin
— Function: gst-plugin-get-module (self <gst-plugin>)   (ret <g-module*>)
— Method: get-module

Gets the <g-module> of the plugin. If the plugin isn't loaded yet, NULL is returned.

plugin
plugin to query
ret
module belonging to the plugin or NULL if the plugin isn't loaded yet.
— Function: gst-plugin-is-loaded (self <gst-plugin>)   (ret bool)
— Method: is-loaded

queries if the plugin is loaded into memory

plugin
plugin to query
ret
TRUE is loaded, FALSE otherwise
— Function: gst-plugin-name-filter (self <gst-plugin>) (name mchars)   (ret bool)
— Method: name-filter

A standard filter that returns TRUE when the plugin is of the given name.

plugin
the plugin to check
name
the name of the plugin
ret
TRUE if the plugin is of the given name.
— Function: gst-plugin-load-file (filename mchars)   (ret <gst-plugin>)

Loads the given plugin and refs it. Caller needs to unref after use.

filename
the plugin filename to load
error
pointer to a NULL-valued GError
ret
a reference to the existing loaded GstPlugin, a reference to the newly-loaded GstPlugin, or NULL if an error occurred.
— Function: gst-plugin-load (self <gst-plugin>)   (ret <gst-plugin>)
— Method: load

Loads plugin. Note that the *return value* is the loaded plugin; plugin is untouched. The normal use pattern of this function goes like this:

          
          GstPlugin *loaded_plugin;
          loaded_plugin = gst_plugin_load (plugin);
          // presumably, we're no longer interested in the potentially-unloaded plugin
          gst_object_unref (plugin);
          plugin = loaded_plugin;
plugin
plugin to load
ret
A reference to a loaded plugin, or NULL on error.
— Function: gst-plugin-load-by-name (name mchars)   (ret <gst-plugin>)

Load the named plugin. Refs the plugin.

name
name of plugin to load
ret
A reference to a loaded plugin, or NULL on error.