public class Registry extends GstObject
Plugin
objects.
See upstream documentation at https://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstRegistry.html
One registry holds the metadata of a set of plugins. All registries build the RegistryPool.
Design:
The Registry object is a list of plugins and some methods for dealing with them. Plugins are 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.xml 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.xml file.
On startup, plugins are searched for in the plugin search path. This path can be set directly using the GST_PLUGIN_PATH environment variable. The registry file is loaded from ~/.gstreamer-$GST_MAJORMINOR/registry-$ARCH.xml or the file listed in the GST_REGISTRY environment variable. The only 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:
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.
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 %GST_PLUGIN_FLAG_CACHED bit. These plugins are removed at the end of intitialization.
Modifier and Type | Class and Description |
---|---|
static interface |
Registry.PluginFilter |
GstObject.Handle
GObject.GCallback, GObject.GInterface
NativeObject.Initializer, NativeObject.TypeProvider, NativeObject.TypeRegistration<T extends NativeObject>
Modifier and Type | Field and Description |
---|---|
static String |
GTYPE_NAME |
Modifier and Type | Method and Description |
---|---|
boolean |
addPlugin(Plugin plugin)
Add the plugin to the registry.
|
Plugin |
findPlugin(String name)
Find a plugin in the registry.
|
static Registry |
get()
Retrieves the default registry.
|
List<PluginFeature> |
getPluginFeatureListByPlugin(String name)
Retrieves a list of
PluginFeature of the named Plugin . |
List<Plugin> |
getPluginList()
Get a list of all plugins registered in the registry.
|
List<Plugin> |
getPluginList(Registry.PluginFilter filter)
Get a subset of the Plugins in the registry, filtered by filter.
|
PluginFeature |
lookupFeature(String name)
Find a
PluginFeature by name in the registry. |
void |
removePlugin(Plugin plugin)
Remove a plugin from the registry.
|
boolean |
scanPath(String path)
Add the given path to the registry.
|
addControlBinding, getControlBinding, getName, getParent, hasActiveControlBindings, removeControlBinding, setControlBindingDisabled, setControlBindingsDisabled, setName, suggestNextSync, syncValues, toString
addCallback, connect, connect, disconnect, dispose, emit, emit, get, getPropertyDefaultValue, getPropertyMaximumValue, getPropertyMinimumValue, getRefCount, getTypeName, invalidate, listPropertyNames, removeCallback, set
close, disown, equals, getPointer, getRawPointer, hashCode
public static final String GTYPE_NAME
public Plugin findPlugin(String name)
name
- The plugin name to find.public boolean addPlugin(Plugin plugin)
plugin
- the Plugin
to addpublic void removePlugin(Plugin plugin)
plugin
- The plugin to remove.public PluginFeature lookupFeature(String name)
PluginFeature
by name in the registry.name
- The name of the plugin feature to find.PluginFeature
or null if not found.public List<Plugin> getPluginList()
Plugin
public List<Plugin> getPluginList(Registry.PluginFilter filter)
filter
- the filter to usePlugin
objects that match the filter.public List<PluginFeature> getPluginFeatureListByPlugin(String name)
PluginFeature
of the named Plugin
.name
- The plugin name.PluginFeature
for the named plugin.public boolean scanPath(String path)
path
- The path to add to the registry.public static Registry get()
Copyright © 2019 gstreamer-java. All rights reserved.