Package ch.bailu.gtk.gst
Klasse Registry
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gst.Registry
- Alle implementierten Schnittstellen:
PointerInterface
One registry holds the metadata of a set of plugins.
<emphasis role="bold">Design:</emphasis>
The #GstRegistry object is a list of plugins and some functions for dealing
with them. Each #GstPlugin is matched 1-1 with a file on disk, and may or may
not be loaded at a given time.
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:
`$XDG_DATA_HOME/gstreamer-$GST_API_VERSION/plugins/`
and `$prefix/libs/gstreamer-$GST_API_VERSION/`.
[$XDG_DATA_HOME](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) defaults to
`$HOME/.local/share`.
The registry cache file is loaded from
`$XDG_CACHE_HOME/gstreamer-$GST_API_VERSION/registry-$ARCH.bin`
(where $XDG_CACHE_HOME defaults to `$HOME/.cache`) 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 "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 initialization.
<emphasis role="bold">Design:</emphasis>
The #GstRegistry object is a list of plugins and some functions for dealing
with them. Each #GstPlugin is matched 1-1 with a file on disk, and may or may
not be loaded at a given time.
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:
`$XDG_DATA_HOME/gstreamer-$GST_API_VERSION/plugins/`
and `$prefix/libs/gstreamer-$GST_API_VERSION/`.
[$XDG_DATA_HOME](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) defaults to
`$HOME/.local/share`.
The registry cache file is loaded from
`$XDG_CACHE_HOME/gstreamer-$GST_API_VERSION/registry-$ARCH.bin`
(where $XDG_CACHE_HOME defaults to `$HOME/.cache`) 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 "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 initialization.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
addFeature
(PluginFeature feature) Add the feature to the registry.boolean
Add the plugin to the registry.boolean
checkFeatureVersion
(Str feature_name, int min_major, int min_minor, int min_micro) Checks whether a plugin feature by the given name exists in
@registry and whether its version is at least the
version required.boolean
checkFeatureVersion
(String feature_name, int min_major, int min_minor, int min_micro) Checks whether a plugin feature by the given name exists in
@registry and whether its version is at least the
version required.featureFilter
(Registry.OnPluginFeatureFilter filter, boolean first, Pointer user_data) Runs a filter against all features of the plugins in the registry
and returns a GList with the results.findFeature
(Str name, long type) Find the pluginfeature with the given name and type in the registry.findFeature
(String name, long type) Find the pluginfeature with the given name and type in the registry.findPlugin
(Str name) Find the plugin with the given name in the registry.findPlugin
(String name) Find the plugin with the given name in the registry.static boolean
By default GStreamer will perform scanning and rebuilding of the
registry file using a helper child process.static void
forkSetEnabled
(boolean enabled) Applications might want to disable/enable spawning of a child helper process
when rebuilding the registry.static Registry
get()
Retrieves the singleton plugin registry.static ClassHandler
getFeatureList
(long type) Retrieves a #GList of #GstPluginFeature of @type.getFeatureListByPlugin
(Str name) Retrieves a #GList of features of the plugin with name @name.getFeatureListByPlugin
(String name) Retrieves a #GList of features of the plugin with name @name.int
Returns the registry's feature list cookie.static int
static long
static TypeSystem.TypeSize
Get a copy of all plugins registered in the given registry.static long
static TypeSystem.TypeSize
Look up a plugin in the given registry with the given filename.Look up a plugin in the given registry with the given filename.lookupFeature
(Str name) Find a #GstPluginFeature with @name in @registry.lookupFeature
(String name) Find a #GstPluginFeature with @name in @registry.Connect to signal "feature-added".onPluginAdded
(Registry.OnPluginAdded signal) Connect to signal "plugin-added".pluginFilter
(Registry.OnPluginFilter filter, boolean first, Pointer user_data) Runs a filter against all plugins in the registry and returns a #GList with
the results.void
removeFeature
(PluginFeature feature) Remove the feature from the registry.void
removePlugin
(Plugin plugin) Remove the plugin from the registry.boolean
Scan the given path for plugins to add to the registry.boolean
Scan the given path for plugins to add to the registry.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_FEATURE_ADDED
- Siehe auch:
-
SIGNAL_ON_PLUGIN_ADDED
- Siehe auch:
-
-
Konstruktordetails
-
Registry
-
-
Methodendetails
-
getClassHandler
-
addFeature
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 gst_object_ref_sink())- Parameter:
feature
- the feature to add- Gibt zurück:
- %TRUE on success. MT safe.
-
addPlugin
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 gst_object_ref_sink())- Parameter:
plugin
- the plugin to add- Gibt zurück:
- %TRUE on success. MT safe.
-
checkFeatureVersion
public boolean checkFeatureVersion(@Nonnull Str feature_name, int min_major, int min_minor, int min_micro) Checks whether a plugin feature by the given name exists in
@registry and whether its version is at least the
version required.- Parameter:
feature_name
- the name of the feature (e.g. "oggdemux")min_major
- the minimum major version numbermin_minor
- the minimum minor version numbermin_micro
- the minimum micro version number- Gibt zurück:
- %TRUE if the feature could be found and the version is the same as the required version or newer, and %FALSE otherwise.
-
checkFeatureVersion
public boolean checkFeatureVersion(String feature_name, int min_major, int min_minor, int min_micro) Checks whether a plugin feature by the given name exists in
@registry and whether its version is at least the
version required.- Parameter:
feature_name
- the name of the feature (e.g. "oggdemux")min_major
- the minimum major version numbermin_minor
- the minimum minor version numbermin_micro
- the minimum micro version number- Gibt zurück:
- %TRUE if the feature could be found and the version is the same as the required version or newer, and %FALSE otherwise.
-
featureFilter
public List featureFilter(Registry.OnPluginFeatureFilter filter, boolean first, @Nullable Pointer user_data) 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).- Parameter:
filter
- the filter to usefirst
- only return first matchuser_data
- user data passed to the filter function- Gibt zurück:
- a #GList of #GstPluginFeature. Use gst_plugin_feature_list_free() after usage. MT safe.
-
findFeature
Find the pluginfeature with the given name and type in the registry.- Parameter:
name
- the pluginfeature name to findtype
- the pluginfeature type to find- Gibt zurück:
- the pluginfeature with the given name and type or %NULL if the plugin was not found. gst_object_unref() after usage. MT safe.
-
findFeature
Find the pluginfeature with the given name and type in the registry.- Parameter:
name
- the pluginfeature name to findtype
- the pluginfeature type to find- Gibt zurück:
- the pluginfeature with the given name and type or %NULL if the plugin was not found. gst_object_unref() after usage. MT safe.
-
findPlugin
Find the plugin with the given name in the registry.
The plugin will be reffed; caller is responsible for unreffing.- Parameter:
name
- the plugin name to find- Gibt zurück:
- the plugin with the given name or %NULL if the plugin was not found. gst_object_unref() after usage. MT safe.
-
findPlugin
Find the plugin with the given name in the registry.
The plugin will be reffed; caller is responsible for unreffing.- Parameter:
name
- the plugin name to find- Gibt zurück:
- the plugin with the given name or %NULL if the plugin was not found. gst_object_unref() after usage. MT safe.
-
getFeatureList
Retrieves a #GList of #GstPluginFeature of @type.- Parameter:
type
- a #GType.- Gibt zurück:
- a #GList of #GstPluginFeature of @type. Use gst_plugin_feature_list_free() after use MT safe.
-
getFeatureListByPlugin
Retrieves a #GList of features of the plugin with name @name.- Parameter:
name
- a plugin name.- Gibt zurück:
- a #GList of #GstPluginFeature. Use gst_plugin_feature_list_free() after usage.
-
getFeatureListByPlugin
Retrieves a #GList of features of the plugin with name @name.- Parameter:
name
- a plugin name.- Gibt zurück:
- a #GList of #GstPluginFeature. Use gst_plugin_feature_list_free() after usage.
-
getFeatureListCookie
public int getFeatureListCookie()Returns the registry's feature list cookie. This changes
every time a feature is added or removed from the registry.- Gibt zurück:
- the feature list cookie.
-
getPluginList
Get a copy of all plugins registered in the given registry. The refcount
of each element in the list in incremented.- Gibt zurück:
- a #GList of #GstPlugin. Use gst_plugin_list_free() after usage. MT safe.
-
lookup
Look up a plugin in the given registry with the given filename.
If found, plugin is reffed.- Parameter:
filename
- the name of the file to look up- Gibt zurück:
- the #GstPlugin if found, or %NULL if not. gst_object_unref() after usage.
-
lookup
Look up a plugin in the given registry with the given filename.
If found, plugin is reffed.- Parameter:
filename
- the name of the file to look up- Gibt zurück:
- the #GstPlugin if found, or %NULL if not. gst_object_unref() after usage.
-
lookupFeature
Find a #GstPluginFeature with @name in @registry.- Parameter:
name
- a #GstPluginFeature name- Gibt zurück:
- a #GstPluginFeature with its refcount incremented, use gst_object_unref() after usage. MT safe.
-
lookupFeature
Find a #GstPluginFeature with @name in @registry.- Parameter:
name
- a #GstPluginFeature name- Gibt zurück:
- a #GstPluginFeature with its refcount incremented, use gst_object_unref() after usage. MT safe.
-
pluginFilter
public List pluginFilter(Registry.OnPluginFilter filter, boolean first, @Nullable Pointer user_data) 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 gst_plugin_list_free() after use, which
will unref again.- Parameter:
filter
- the filter to usefirst
- only return first matchuser_data
- user data passed to the filter function- Gibt zurück:
- a #GList of #GstPlugin. Use gst_plugin_list_free() after usage. MT safe.
-
removeFeature
Remove the feature from the registry.
MT safe.- Parameter:
feature
- the feature to remove
-
removePlugin
Remove the plugin from the registry.
MT safe.- Parameter:
plugin
- the plugin to remove
-
scanPath
Scan the given path for plugins to add to the registry. The syntax of the
path is specific to the registry.- Parameter:
path
- the path to scan- Gibt zurück:
- %TRUE if registry changed
-
scanPath
Scan the given path for plugins to add to the registry. The syntax of the
path is specific to the registry.- Parameter:
path
- the path to scan- Gibt zurück:
- %TRUE if registry changed
-
onFeatureAdded
Connect to signal "feature-added".
SeeRegistry.OnFeatureAdded.onFeatureAdded(ch.bailu.gtk.gst.PluginFeature)
for signal description.
FieldSIGNAL_ON_FEATURE_ADDED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onPluginAdded
Connect to signal "plugin-added".
SeeRegistry.OnPluginAdded.onPluginAdded(ch.bailu.gtk.gst.Plugin)
for signal description.
FieldSIGNAL_ON_PLUGIN_ADDED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
forkIsEnabled
public static boolean forkIsEnabled()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
gst_registry_fork_set_enabled() function, in which case new plugins
are scanned (and loaded) into the application process.- Gibt zurück:
- %TRUE if GStreamer will use the child helper process when rebuilding the registry.
-
forkSetEnabled
public static void forkSetEnabled(boolean enabled) Applications might want to disable/enable spawning of a child helper process
when rebuilding the registry. See gst_registry_fork_is_enabled() for more
information.- Parameter:
enabled
- whether rebuilding the registry can use a temporary child helper process.
-
get
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.- Gibt zurück:
- the #GstRegistry.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-