Gst.Plugin¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gst.Plugin(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GStreamer is extensible, so
Gst.Element
instances can be loaded at runtime. A plugin system can provide one or more of the basic GStreamerGst.PluginFeature
subclasses.A plugin should export a symbol
gst_plugin_desc
that is a struct of typeGst.PluginDesc
. the plugin loader will check the version of the core library the plugin was linked against and will create a newGst.Plugin
. It will then call theGst.PluginInitFunc
function that was provided in thegst_plugin_desc
.Once you have a handle to a
Gst.Plugin
(e.g. from theGst.Registry
), you can add any object that subclassesGst.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 caseGst.Plugin.load
() can be needed to bring the plugin into memory.- classmethod list_free(list)[source]¶
- Parameters:
list ([
Gst.Plugin
]) – list ofGst.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
orNone
Load the named plugin. Refs the plugin.
- classmethod load_file(filename)[source]¶
- Parameters:
filename (
str
) – the plugin filename to load- Raises:
- Returns:
a reference to the existing loaded
Gst.Plugin
, a reference to the newly-loadedGst.Plugin
, orNone
if an error occurred.- Return type:
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 useGst.VERSION_MAJOR
hereminor_version (
int
) – the minor version number of the GStreamer core that the plugin was compiled for, you can just useGst.VERSION_MINOR
herename (
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 plugininit_func (
Gst.PluginInitFunc
) – pointer to the init function of this plugin.version (
str
) – version string of the pluginlicense (
str
) – effective license of plugin. Must be one of the approved licenses (seeGst.PluginDesc
above) or the plugin will not be registered.source (
str
) – source module plugin belongs topackage (
str
) – shipped package plugin belongs toorigin (
str
) – URL to provider of plugin
- Returns:
True
if the plugin was registered correctly, otherwiseFalse
.- Return type:
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 useGst.VERSION_MAJOR
hereminor_version (
int
) – the minor version number of the GStreamer core that the plugin was compiled for, you can just useGst.VERSION_MINOR
herename (
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 plugininit_full_func (
Gst.PluginInitFullFunc
) – pointer to the init function with user data of this plugin.version (
str
) – version string of the pluginlicense (
str
) – effective license of plugin. Must be one of the approved licenses (seeGst.PluginDesc
above) or the plugin will not be registered.source (
str
) – source module plugin belongs topackage (
str
) – shipped package plugin belongs toorigin (
str
) – URL to provider of plugin
- Returns:
True
if the plugin was registered correctly, otherwiseFalse
.- Return type:
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
] orNone
) –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), orNone
. 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
] orNone
) –None
-terminated array of directories/paths where dependent files may be, orNone
.names ([
str
] orNone
) –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, orNone
.flags (
Gst.PluginDependencyFlags
) – optional flags, orGst.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
orNone
) – one or more environment variables (separated by ‘:’, ‘;’ or ‘,’), orNone
. 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
orNone
) – one ore more directory paths (separated by ‘:’ or ‘;’ or ‘,’), orNone
. Example: “/usr/lib/mystuff/plugins”names (
str
orNone
) – one or more file names or file name suffixes (separated by commas), orNone
flags (
Gst.PluginDependencyFlags
) – optional flags, orGst.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).
- add_status_error(message)[source]¶
- Parameters:
message (
str
) – the status error message
New in version 1.24.
- add_status_info(message)[source]¶
- Parameters:
message (
str
) – the status info message
New in version 1.24.
- add_status_warning(message)[source]¶
- Parameters:
message (
str
) – the status warning message
New in version 1.24.
- get_cache_data()[source]¶
- Returns:
The cached data as a
Gst.Structure
orNone
.- Return type:
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:
Get the long descriptive name of the plugin
- get_license()[source]¶
- Returns:
the license of the plugin
- Return type:
get the license of the plugin
- get_origin()[source]¶
- Returns:
the origin of the plugin
- Return type:
get the URL where the plugin comes from
- get_package()[source]¶
- Returns:
the package of the plugin
- Return type:
get the package the plugin belongs to.
- get_release_date_string()[source]¶
-
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:
get the source module the plugin belongs to.
- get_version()[source]¶
- Returns:
the version of the plugin
- Return type:
get the version of the plugin
- load()[source]¶
- Returns:
a reference to a loaded plugin, or
None
on error.- Return type:
Gst.Plugin
orNone
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.