Registry
Object Hierarchy:
Description:
public class Registry :
Object
One registry holds the metadata of a set of plugins. Design: The Registry
object is a list of plugins and some functions for dealing with them. Each Plugin is matched
1-1 with a file on disk, and may or may not be loaded at a given time. There may be multiple
Registry objects, but the "default registry" is the only object that has any meaning to the core. The registry file is actually a
cache of plugin information. This is unlike versions prior to 0.10, where the registry file was the primary source of plugin information,
and was created by the gst-register command. The primary source, at all times, of plugin information is each plugin file itself. Thus, if
an application wants information about a particular plugin, or wants to search for a feature that satisfies given criteria, the primary
means of doing so is to load every plugin and look at the resulting information that is gathered in the default registry. Clearly, this is
a time consuming process, so we cache information in the registry file. The format and location of the cache file is internal to
gstreamer. On startup, plugins are searched for in the plugin search path. The following locations are checked in this order:
- location from --gst-plugin-path commandline option.
- the GST_PLUGIN_PATH environment variable.
- the GST_PLUGIN_SYSTEM_PATH environment variable.
- default locations (if GST_PLUGIN_SYSTEM_PATH is not set). Those default locations are:
~/.gstreamer-$GST_MAJORMINOR/plugins/
and $prefix/libs/gstreamer-$GST_MAJORMINOR/.
The registry cache file is loaded from ~/.gstreamer-$GST_MAJORMINOR/registry-$ARCH.bin or the file listed in the
GST_REGISTRY env var. One reason to change the registry location is for testing. For each plugin that is found in the plugin search path,
there could be 3 possibilities for cached information:
- the cache may not contain information about a given file.
- the cache may have stale information.
- the cache may have current information.
In the first two cases, the plugin is loaded and the cache updated. In addition to these cases, the cache may have entries for plugins
that are not relevant to the current process. These are marked as not available to the current process. If the cache is updated for
whatever reason, it is marked dirty. A dirty cache is written out at the end of initialization. Each entry is checked to make sure the
information is minimally valid. If not, the entry is simply dropped. Implementation notes: The "cache" and "default registry"
are different concepts and can represent different sets of plugins. For various reasons, at init time, the cache is stored in the default
registry, and plugins not relevant to the current process are marked with the
CACHED bit. These plugins are removed at the end of intitialization.
Namespace: Gst
Package: gstreamer-0.10
Content:
Static methods:
Creation methods:
Methods:
-
public bool add_feature (owned PluginFeature feature)
Add the feature to the registry. The feature-added signal will be emitted. This function sinks
feature. MT safe.
-
public void add_path (string path)
Add the given path to the registry. The syntax of the path is specific to the registry. If the path has
already been added, do nothing.
-
public bool add_plugin (owned Plugin plugin)
Add the plugin to the registry. The plugin-added signal will be emitted. This function will sink
plugin. MT safe.
-
public List<PluginFeature> feature_filter (PluginFeatureFilter filter, bool first)
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).
PluginFeature. Use gst_plugin_feature_list_free after usage.
MT safe.
-
public PluginFeature? find_feature (string name, Type type)
Find the pluginfeature with the given name and type in the registry. or NULL if the plugin was not
found. unref after usage. MT safe.
-
public Plugin? find_plugin (string name)
Find the plugin with the given name in the registry. The plugin will be reffed; caller is responsible
for unreffing. plugin was not found. unref after usage. MT safe.
-
public List<PluginFeature> get_feature_list (Type type)
-
public List<PluginFeature> get_feature_list_by_plugin (string name)
Retrieves a List of features of the plugin with
name name. PluginFeature. Use
gst_plugin_feature_list_free after usage.
-
public uint32 get_feature_list_cookie ()
Returns the registrys feature list cookie. This changes every time a feature is added or removed from
the registry.
-
public List<string> get_path_list ()
Get the list of paths for the given registry. strings. g_list_free after use. MT safe.
-
public List<Plugin> get_plugin_list ()
Get a copy of all plugins registered in the given registry. The refcount of each element in the list in
incremented. Use gst_plugin_list_free after usage. MT safe.
-
public Plugin? lookup (string filename)
Look up a plugin in the given registry with the given filename. If found, plugin is reffed.
unref after usage.
-
public PluginFeature? lookup_feature (string name)
-
public List<Plugin> plugin_filter (PluginFilter filter, bool first)
Runs a filter against all plugins in the registry and returns a
List 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 gst_plugin_list_free after use, which will unref
again. Use gst_plugin_list_free after usage. MT safe.
-
public void remove_feature (PluginFeature feature)
Remove the feature from the registry. MT safe.
-
public void remove_plugin (Plugin plugin)
Remove the plugin from the registry. MT safe.
-
public bool scan_path (string path)
Scan the given path for plugins to add to the registry. The syntax of the path is specific to the
registry.
-
public bool xml_read_cache (string location)
-
public bool xml_write_cache (string location)
Signals:
-
public virtual void feature_added (void* feature)
Signals that a feature has been added to the registry (possibly replacing a previously-added one by the
same name)
-
public virtual void plugin_added (void* plugin)
Signals that a plugin has been added to the registry (possibly replacing a previously-added one by the
same name)