Gst.Plugin¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gst.Object (27), GObject.Object (37) | 
|---|---|
| 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) | 
|---|
Signals¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
Fields¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
Class Details¶
- 
class Gst.Plugin(**kwargs)¶
- Bases: - Gst.Object- Abstract: - No - Structure: - Gst.PluginClass- GStreamer is extensible, so - Gst.Elementinstances can be loaded at runtime. A plugin system can provide one or more of the basic GStreamer- Gst.PluginFeaturesubclasses.- A plugin should export a symbol - gst_plugin_descthat 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.PluginInitFuncfunction 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 - Noneon error.- Return type: - Gst.Pluginor- 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- Noneif 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 useGst.VERSION_MAJORhere
- minor_version (int) – the minor version number of the GStreamer core that the plugin was compiled for, you can just useGst.VERSION_MINORhere
- 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 (seeGst.PluginDescabove) 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: - Trueif the plugin was registered correctly, otherwise- False.- 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.
- major_version (
 - 
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_MAJORhere
- minor_version (int) – the minor version number of the GStreamer core that the plugin was compiled for, you can just useGst.VERSION_MINORhere
- 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 (seeGst.PluginDescabove) 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 (objectorNone) –objectto user data
 - Returns: - Trueif the plugin was registered correctly, otherwise- False.- 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.PluginInitFullFuncwhich 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.
- major_version (
 - 
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. 
- env_vars ([
 - 
add_dependency_simple(env_vars, paths, names, flags)[source]¶
- Parameters: - env_vars (strorNone) – 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 (strorNone) – one ore more directory paths (separated by ‘:’ or ‘;’ or ‘,’), orNone. Example: “/usr/lib/mystuff/plugins”
- names (strorNone) – 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).
- env_vars (
 - 
get_cache_data()[source]¶
- Returns: - The cached data as a - Gst.Structureor- None.- Return type: - Gst.Structureor- None- Gets the plugin specific data cache. If it is - Nonethere 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: - stror- None- 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_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 - Noneif not available.- Return type: - stror- 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: - Trueis loaded,- Falseotherwise- Return type: - bool- queries if the plugin is loaded into memory 
 - 
load()[source]¶
- Returns: - a reference to a loaded plugin, or - Noneon error.- Return type: - Gst.Pluginor- 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. 
 
- 
classmethod