Gst.Plugin

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Plugin Gst.Plugin Gst.Object->Gst.Plugin

Subclasses:None

Methods

Inherited:Gst.Object (27), GObject.Object (38)
Structs:GObject.ObjectClass (5)
class list_free (list)
class load_by_name (name)
class load_file (filename)
class register_static (major_version, minor_version, name, description, init_func, version, license, source, package, origin)
class register_static_full (major_version, minor_version, name, description, init_full_func, version, license, source, package, origin, *user_data)
  add_dependency (env_vars, paths, names, flags)
  add_dependency_simple (env_vars, paths, names, flags)
  get_cache_data ()
  get_description ()
  get_filename ()
  get_license ()
  get_name ()
  get_origin ()
  get_package ()
  get_release_date_string ()
  get_source ()
  get_version ()
  is_loaded ()
  load ()
  set_cache_data (cache_data)

Virtual Methods

Inherited:Gst.Object (1), GObject.Object (7)

Properties

Inherited:Gst.Object (2)

Class Details

class Gst.Plugin(**kwargs)
Bases:Gst.Object
Abstract:No
Structure:Gst.PluginClass

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.PluginFeature subclasses. A plugin should export a symbol gst_plugin_desc that is a struct of type Gst.PluginDesc. 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.PluginInitFunc function that was provided in the

gst_plugin_desc. Once you have a handle to a Gst.Plugin (e.g. from the Gst.Registry), you can add any object that subclasses Gst.PluginFeature.

Usually plugins are always automatically 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.

classmethod list_free(list)[source]
Parameters:list ([Gst.Plugin]) – list of Gst.Plugin

Unrefs each member of list, then frees the list.

classmethod load_by_name(name)[source]
Parameters:name (str) – name of plugin to load
Returns:a reference to a loaded plugin, or None on error.
Return type:Gst.Plugin or None

Load the named plugin. Refs the plugin.

classmethod load_file(filename)[source]
Parameters:filename (str) – the plugin filename to load
Raises:GLib.Error
Returns:a reference to the existing loaded Gst.Plugin, a reference to the newly-loaded Gst.Plugin, or None if an error occurred.
Return type:Gst.Plugin

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

classmethod register_static(major_version, minor_version, name, description, init_func, version, license, source, package, origin)[source]
Parameters:
  • major_version (int) – the major version number of the GStreamer core that the plugin was compiled for, you can just use Gst.VERSION_MAJOR here
  • minor_version (int) – the minor version number of the GStreamer core that the plugin was compiled for, you can just use Gst.VERSION_MINOR here
  • name (str) – a unique name of the plugin (ideally prefixed with an application- or library-specific namespace prefix in order to avoid name conflicts in case a similar plugin with the same name ever gets added to GStreamer)
  • description (str) – description of the plugin
  • init_func (Gst.PluginInitFunc) – pointer to the init function of this plugin.
  • version (str) – version string of the plugin
  • license (str) – effective license of plugin. Must be one of the approved licenses (see Gst.PluginDesc above) or the plugin will not be registered.
  • source (str) – source module plugin belongs to
  • package (str) – shipped package plugin belongs to
  • origin (str) – URL to provider of plugin
Returns:

True if the plugin was registered correctly, otherwise False.

Return type:

bool

Registers a static plugin, ie. a plugin which is private to an application or library and contained within the application or library (as opposed to being shipped as a separate module file).

You must make sure that GStreamer has been initialised (with Gst.init() or via gst_init_get_option_group()) before calling this function.

classmethod register_static_full(major_version, minor_version, name, description, init_full_func, version, license, source, package, origin, *user_data)[source]
Parameters:
  • major_version (int) – the major version number of the GStreamer core that the plugin was compiled for, you can just use Gst.VERSION_MAJOR here
  • minor_version (int) – the minor version number of the GStreamer core that the plugin was compiled for, you can just use Gst.VERSION_MINOR here
  • name (str) – a unique name of the plugin (ideally prefixed with an application- or library-specific namespace prefix in order to avoid name conflicts in case a similar plugin with the same name ever gets added to GStreamer)
  • description (str) – description of the plugin
  • init_full_func (Gst.PluginInitFullFunc) – pointer to the init function with user data of this plugin.
  • version (str) – version string of the plugin
  • license (str) – effective license of plugin. Must be one of the approved licenses (see Gst.PluginDesc above) or the plugin will not be registered.
  • source (str) – source module plugin belongs to
  • package (str) – shipped package plugin belongs to
  • origin (str) – URL to provider of plugin
  • user_data (object or None) – object to user data
Returns:

True if the plugin was registered correctly, otherwise False.

Return type:

bool

Registers a static plugin, ie. a plugin which is private to an application or library and contained within the application or library (as opposed to being shipped as a separate module file) with a Gst.PluginInitFullFunc which allows user data to be passed to the callback function (useful for bindings).

You must make sure that GStreamer has been initialised (with Gst.init() or via gst_init_get_option_group()) before calling this function.

add_dependency(env_vars, paths, names, flags)[source]
Parameters:
  • env_vars ([str] or None) – None-terminated array of environment variables affecting the feature set of the plugin (e.g. an environment variable containing paths where to look for additional modules/plugins of a library), or None. Environment variable names may be followed by a path component which will be added to the content of the environment variable, e.g. “HOME/.mystuff/plugins”.
  • paths ([str] or None) – None-terminated array of directories/paths where dependent files may be, or None.
  • names ([str] or None) – None-terminated array of file names (or file name suffixes, depending on flags) to be used in combination with the paths from paths and/or the paths extracted from the environment variables in env_vars, or None.
  • flags (Gst.PluginDependencyFlags) – optional flags, or Gst.PluginDependencyFlags.NONE

Make GStreamer aware of external dependencies which affect the feature set of this plugin (ie. the elements or typefinders associated with it).

GStreamer will re-inspect plugins with external dependencies whenever any of the external dependencies change. This is useful for plugins which wrap other plugin systems, e.g. a plugin which wraps a plugin-based visualisation library and makes visualisations available as GStreamer elements, or a codec loader which exposes elements and/or caps dependent on what external codec libraries are currently installed.

add_dependency_simple(env_vars, paths, names, flags)[source]
Parameters:
  • env_vars (str or None) – one or more environment variables (separated by ‘:’, ‘;’ or ‘,’), or None. Environment variable names may be followed by a path component which will be added to the content of the environment variable, e.g. “HOME/.mystuff/plugins:MYSTUFF_PLUGINS_PATH”
  • paths (str or None) – one ore more directory paths (separated by ‘:’ or ‘;’ or ‘,’), or None. Example: “/usr/lib/mystuff/plugins”
  • names (str or None) – one or more file names or file name suffixes (separated by commas), or None
  • flags (Gst.PluginDependencyFlags) – optional flags, or Gst.PluginDependencyFlags.NONE

Make GStreamer aware of external dependencies which affect the feature set of this plugin (ie. the elements or typefinders associated with it).

GStreamer will re-inspect plugins with external dependencies whenever any of the external dependencies change. This is useful for plugins which wrap other plugin systems, e.g. a plugin which wraps a plugin-based visualisation library and makes visualisations available as GStreamer elements, or a codec loader which exposes elements and/or caps dependent on what external codec libraries are currently installed.

Convenience wrapper function for Gst.Plugin.add_dependency() which takes simple strings as arguments instead of string arrays, with multiple arguments separated by predefined delimiters (see above).

get_cache_data()[source]
Returns:The cached data as a Gst.Structure or None.
Return type:Gst.Structure or None

Gets the plugin specific data cache. If it is None there is no cached data stored. This is the case when the registry is getting rebuilt.

get_description()[source]
Returns:the long name of the plugin
Return type:str

Get the long descriptive name of the plugin

get_filename()[source]
Returns:the filename of the plugin
Return type:str

get the filename of the plugin

get_license()[source]
Returns:the license of the plugin
Return type:str

get the license of the plugin

get_name()[source]
Returns:the name of the plugin
Return type:str

Get the short name of the plugin

get_origin()[source]
Returns:the origin of the plugin
Return type:str

get the URL where the plugin comes from

get_package()[source]
Returns:the package of the plugin
Return type:str

get the package the plugin belongs to.

get_release_date_string()[source]
Returns:the date string of the plugin, or None if not available.
Return type:str or None

Get the release date (and possibly time) in form of a string, if available.

For normal GStreamer plugin releases this will usually just be a date in the form of “YYYY-MM-DD”, while pre-releases and builds from git may contain a time component after the date as well, in which case the string will be formatted like “YYYY-MM-DDTHH:MMZ” (e.g. “2012-04-30T09:30Z”).

There may be plugins that do not have a valid release date set on them.

get_source()[source]
Returns:the source of the plugin
Return type:str

get the source module the plugin belongs to.

get_version()[source]
Returns:the version of the plugin
Return type:str

get the version of the plugin

is_loaded()[source]
Returns:True is loaded, False otherwise
Return type:bool

queries if the plugin is loaded into memory

load()[source]
Returns:a reference to a loaded plugin, or None on error.
Return type:Gst.Plugin or None

Loads self. Note that the *return value* is the loaded plugin; self 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;
set_cache_data(cache_data)[source]
Parameters:cache_data (Gst.Structure) – a structure containing the data to cache

Adds plugin specific data to cache. Passes the ownership of the structure to the self.

The cache is flushed every time the registry is rebuilt.