Class: Gst::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/gst/registry.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#add_control_binding, check_uniqueness, #control_bindings_disabled=, #control_rate, #control_rate=, default_deep_notify, #default_error, #get_control_binding, #get_g_value_array, #get_value, #get_value_array, #has_active_control_bindings, #has_ancestor, #has_as_ancestor, #has_as_parent, #name, #name=, #parent, #parent=, #path_string, #ref, ref_sink, #remove_control_binding, replace, #set_control_binding_disabled, #suggest_next_sync, #sync_values, #unparent, #unref

Class Method Details

.fork_is_enabledBoolean

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. rebuilding the registry.

Returns:

  • (Boolean)

    true if GStreamer will use the child helper process when

.fork_set_enabled(enabled) ⇒ nil

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.

Parameters:

  • enabled (Boolean)

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

Returns:

  • (nil)

.getGst::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.

Returns:

Instance Method Details

#add_feature(feature) ⇒ Boolean

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()) MT safe.

Parameters:

Returns:

  • (Boolean)

    true on success.

#add_plugin(plugin) ⇒ Boolean

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()) MT safe.

Parameters:

Returns:

  • (Boolean)

    true on success.

#check_feature_version(feature_name, min_major, min_minor, min_micro) ⇒ Boolean

Checks whether a plugin feature by the given name exists in registry and whether its version is at least the version required. the same as the required version or newer, and false otherwise.

Parameters:

  • feature_name (String)

    the name of the feature (e.g. "oggdemux")

  • min_major (Integer)

    the minimum major version number

  • min_minor (Integer)

    the minimum minor version number

  • min_micro (Integer)

    the minimum micro version number

Returns:

  • (Boolean)

    true if the feature could be found and the version is

#feature_filter(filter, first, user_data) ⇒ GLib::List<Gst::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). MT safe.

Parameters:

  • filter (Gst::PluginFeatureFilter)

    the filter to use

  • first (Boolean)

    only return first match

  • user_data (GObject)

    user data passed to the filter function

Returns:

  • (GLib::List<Gst::PluginFeature>)

    a #GList of Gst::PluginFeature. Use gst_plugin_feature_list_free() after usage.

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

Returns:

  • (Integer)

    the feature list cookie.

#find_feature(name, type) ⇒ Gst::PluginFeature

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

Parameters:

  • name (String)

    the pluginfeature name to find

  • type (GLib::Type)

    the pluginfeature type to find

Returns:

  • (Gst::PluginFeature)

    the pluginfeature with the given name and type or nil if the plugin was not found. gst_object_unref() after usage.

#find_plugin(name) ⇒ Gst::Plugin

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

Parameters:

  • name (String)

    the plugin name to find

Returns:

  • (Gst::Plugin)

    the plugin with the given name or nil if the plugin was not found. gst_object_unref() after usage.

#get_feature_list(type) ⇒ GLib::List<Gst::PluginFeature>

Retrieves a #GList of Gst::PluginFeature of type. MT safe.

Parameters:

  • type (GLib::Type)

    a #GType.

Returns:

  • (GLib::List<Gst::PluginFeature>)

    a #GList of Gst::PluginFeature of type. Use gst_plugin_feature_list_free() after use

#get_feature_list_by_plugin(name) ⇒ GLib::List<Gst::PluginFeature>

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

Parameters:

  • name (String)

    a plugin name.

Returns:

  • (GLib::List<Gst::PluginFeature>)

    a #GList of Gst::PluginFeature. Use gst_plugin_feature_list_free() after usage.

#get_features(name_or_type) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/gst/registry.rb', line 20

def get_features(name_or_type)
  if name_or_type.is_a?(GLib::Type)
    type = name_or_type
    get_feature_list(type)
  else
    name = name_or_type
    get_feature_list_by_plugin(name)
  end
end

#lookup(filename) ⇒ Gst::Plugin

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

Parameters:

  • filename (String)

    the name of the file to look up

Returns:

  • (Gst::Plugin)

    the Gst::Plugin if found, or nil if not. gst_object_unref() after usage.

#lookup_feature(name) ⇒ Gst::PluginFeature

Find a Gst::PluginFeature with name in registry. MT safe.

Parameters:

  • name (String)

    a Gst::PluginFeature name

Returns:

  • (Gst::PluginFeature)

    a Gst::PluginFeature with its refcount incremented, use gst_object_unref() after usage.

#plugin_filter(filter, first, user_data) ⇒ GLib::List<Gst::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 gst_plugin_list_free() after use, which will unref again. MT safe.

Parameters:

  • filter (Gst::PluginFilter)

    the filter to use

  • first (Boolean)

    only return first match

  • user_data (GObject)

    user data passed to the filter function

Returns:

  • (GLib::List<Gst::Plugin>)

    a #GList of Gst::Plugin. Use gst_plugin_list_free() after usage.

#plugin_listGLib::List<Gst::Plugin> Also known as: plugins

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

Returns:

  • (GLib::List<Gst::Plugin>)

    a #GList of Gst::Plugin. Use gst_plugin_list_free() after usage.

#remove_feature(feature) ⇒ nil

Remove the feature from the registry.

MT safe.

Parameters:

Returns:

  • (nil)

#remove_plugin(plugin) ⇒ nil

Remove the plugin from the registry.

MT safe.

Parameters:

Returns:

  • (nil)

#scan_path(path) ⇒ Boolean

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

Parameters:

  • path (Gst::filename)

    the path to scan

Returns:

  • (Boolean)

    true if registry changed