Registry

class Registry(**properties: Any)

Superclasses: Object, InitiallyUnowned, Object

Constructors:

Registry(**properties)

Methods

class Registry
add_feature(feature: PluginFeature) bool

Add the feature to the registry. The feature-added signal will be emitted.

feature’s reference count will be incremented, and any floating reference will be removed (see ref_sink())

Parameters:

feature – the feature to add

add_plugin(plugin: Plugin) bool

Add the plugin to the registry. The plugin-added signal will be emitted.

plugin’s reference count will be incremented, and any floating reference will be removed (see ref_sink())

Parameters:

plugin – the plugin to add

check_feature_version(feature_name: str, min_major: int, min_minor: int, min_micro: int) bool

Checks whether a plugin feature by the given name exists in registry and whether its version is at least the version required.

Parameters:
  • feature_name – the name of the feature (e.g. “oggdemux”)

  • min_major – the minimum major version number

  • min_minor – the minimum minor version number

  • min_micro – the minimum micro version number

feature_filter(filter: Callable[[...], bool], first: bool, *user_data: Any) list[PluginFeature]

Runs a filter against all features of the plugins in the registry and returns a GList with the results. If the first flag is set, only the first match is returned (as a list with a single object).

Parameters:
  • filter – the filter to use

  • first – only return first match

  • user_data – user data passed to the filter function

find_feature(name: str, type: type) PluginFeature | None

Find the pluginfeature with the given name and type in the registry.

Parameters:
  • name – the pluginfeature name to find

  • type – the pluginfeature type to find

find_plugin(name: str) Plugin | None

Find the plugin with the given name in the registry. The plugin will be reffed; caller is responsible for unreffing.

Parameters:

name – the plugin name to find

fork_is_enabled() bool

By default GStreamer will perform scanning and rebuilding of the registry file using a helper child process.

Applications might want to disable this behaviour with the fork_set_enabled() function, in which case new plugins are scanned (and loaded) into the application process.

fork_set_enabled(enabled: bool) None

Applications might want to disable/enable spawning of a child helper process when rebuilding the registry. See fork_is_enabled() for more information.

Parameters:

enabled – whether rebuilding the registry can use a temporary child helper process.

get() Registry

Retrieves the singleton plugin registry. The caller does not own a reference on the registry, as it is alive as long as GStreamer is initialized.

get_feature_list(type: type) list[PluginFeature]

Retrieves a GList of PluginFeature of type.

Parameters:

type – a Type.

get_feature_list_by_plugin(name: str) list[PluginFeature]

Retrieves a GList of features of the plugin with name name.

Parameters:

name – a plugin name.

Returns the registry’s feature list cookie. This changes every time a feature is added or removed from the registry.

get_plugin_list() list[Plugin]

Get a copy of all plugins registered in the given registry. The refcount of each element in the list in incremented.

lookup(filename: str) Plugin | None

Look up a plugin in the given registry with the given filename. If found, plugin is reffed.

Parameters:

filename – the name of the file to look up

lookup_feature(name: str) PluginFeature | None

Find a PluginFeature with name in registry.

Parameters:

name – a PluginFeature name

plugin_filter(filter: Callable[[...], bool], first: bool, *user_data: Any) list[Plugin]

Runs a filter against all plugins in the registry and returns a GList with the results. If the first flag is set, only the first match is returned (as a list with a single object). Every plugin is reffed; use list_free() after use, which will unref again.

Parameters:
  • filter – the filter to use

  • first – only return first match

  • user_data – user data passed to the filter function

remove_feature(feature: PluginFeature) None

Remove the feature from the registry.

MT safe.

Parameters:

feature – the feature to remove

remove_plugin(plugin: Plugin) None

Remove the plugin from the registry.

MT safe.

Parameters:

plugin – the plugin to remove

scan_path(path: str) bool

Scan the given path for plugins to add to the registry. The syntax of the path is specific to the registry.

Parameters:

path – the path to scan

Signals

class Registry.signals
feature_added(feature: PluginFeature) None

Signals that a feature has been added to the registry (possibly replacing a previously-added one by the same name)

Parameters:

feature – the feature that has been added

plugin_added(plugin: Plugin) None

Signals that a plugin has been added to the registry (possibly replacing a previously-added one by the same name)

Parameters:

plugin – the plugin that has been added

Fields

class Registry
object
priv