Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions

# Gst::Registry Class Reference

An abstract base class for management of Gst::Plugin objects. More...

Inheritance diagram for Gst::Registry:
[legend]
Collaboration diagram for Gst::Registry:
[legend]

List of all members.

## Public Member Functions
virtual | ~Registry ()
GstRegistry* | gobj ()
| Provides access to the underlying C GObject.
const GstRegistry* | gobj () const
| Provides access to the underlying C GObject.
GstRegistry* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::ListHandle< Glib::RefPtr < Gst::PluginFeature > > | get_feature_list (GType type)
| Retrieves a List of Gst::PluginFeature of type.
Glib::ListHandle< Glib::RefPtr < const Gst::PluginFeature > > | get_feature_list (GType type) const
| Retrieves a List of Gst::PluginFeature of type.
guint32 | get_feature_list_cookie () const
| Returns the registrys feature list cookie.
Glib::ListHandle< Glib::RefPtr < Gst::PluginFeature > > | get_feature_list (const Glib::ustring& name)
| Retrieves a List of features of the plugin with name name.
Glib::ListHandle< Glib::RefPtr < const Gst::PluginFeature > > | get_feature_list (const Glib::ustring& name) const
| Retrieves a List of features of the plugin with name name.
Glib::ListHandle< Glib::ustring > | get_path_list () const
| Get the list of paths for the given registry.
Glib::ListHandle< Glib::RefPtr < Gst::Plugin > > | get_plugin_list ()
| Get a copy of all plugins registered in the given registry.
Glib::ListHandle< Glib::RefPtr < const Gst::Plugin > > | get_plugin_list () const
| Get a copy of all plugins registered in the given registry.
bool | add_plugin (const Glib::RefPtr< Gst::Plugin >& plugin)
| Add the plugin to the registry.
void | remove_plugin (const Glib::RefPtr< Gst::Plugin >& plugin)
| Remove the plugin from the registry.
Glib::ListHandle< Glib::RefPtr < Gst::Plugin > > | get_plugin_list (const Plugin::SlotFilter& filter, bool first)
| Runs a filter against all plugins in the registry and returns a List with the results.
Glib::ListHandle< Glib::RefPtr < const Gst::Plugin > > | get_plugin_list (const Plugin::SlotFilter& filter, bool first) const
| Runs a filter against all plugins in the registry and returns a List with the results.
Glib::ListHandle< Glib::RefPtr < Gst::PluginFeature > > | get_feature_list (const PluginFeature::SlotFilter& filter, bool first)
| Runs a filter against all features of the plugins in the registry and returns a List with the results.
Glib::ListHandle< Glib::RefPtr < const Gst::PluginFeature > > | get_feature_list (const PluginFeature::SlotFilter& filter, bool first) const
| Runs a filter against all features of the plugins in the registry and returns a List with the results.
Glib::RefPtr< Gst::Plugin > | find_plugin (const Glib::ustring& name)
| Find the plugin with the given name in the registry.
Glib::RefPtr< const Gst::Plugin > | find_plugin (const Glib::ustring& name) const
| Find the plugin with the given name in the registry.
Glib::RefPtr< Gst::PluginFeature > | find_feature (const Glib::ustring& name, GType type)
| Find the pluginfeature with the given name and type in the registry.
Glib::RefPtr< const Gst::PluginFeature > | find_feature (const Glib::ustring& name, GType type) const
| Find the pluginfeature with the given name and type in the registry.
Glib::RefPtr< Gst::PluginFeature > | lookup_feature (const Glib::ustring& name)
| Find a Gst::PluginFeature with name in registry.
Glib::RefPtr< const Gst::PluginFeature > | lookup_feature (const Glib::ustring& name) const
| Find a Gst::PluginFeature with name in registry.
void | add_path (const Glib::ustring& path)
| Add the given path to the registry.
void | scan_path (const Glib::ustring& path)
| Scan the given path for plugins to add to the registry.
bool | xml_read_cache (const Glib::ustring& location)
| Read the contents of the XML cache file at location into registry.
bool | xml_write_cache (const Glib::ustring& location) const
| Write registry in an XML format at the location given by location.
Glib::RefPtr< Gst::Plugin > | lookup (const Glib::ustring& filename)
| Look up a plugin in the given registry with the given filename.
Glib::RefPtr< const Gst::Plugin > | lookup (const Glib::ustring& filename) const
| Look up a plugin in the given registry with the given filename.
void | remove_feature (const Glib::RefPtr< Gst::PluginFeature >& feature)
| Remove the feature from the registry.
void | add_feature (const Glib::RefPtr< Gst::PluginFeature >& feature)
| Add the feature to the registry.
Glib::SignalProxy1< void, const Glib::RefPtr < Gst::PluginFeature >& > | signal_feature_added ()
| Signals that a feature has been added to the registry (possibly replacing a previously-added one by the same name)
Glib::SignalProxy1< void, const Glib::RefPtr < Gst::Plugin >& > | signal_plugin_added ()
| Signals that a plugin has been added to the registry (possibly replacing a previously-added one by the same name)
## Static Public Member Functions
static Glib::RefPtr < Gst::Registry > | get_default ()
| Retrieves the default registry.
static bool | check_feature_version (const Glib::ustring& feature_name, guint min_major, guint min_minor, guint min_micro)
| Checks whether a plugin feature by the given name exists in the default registry and whether its version is at least the version required.
## Protected Member Functions
virtual void | on_feature_added (const Glib::RefPtr< Gst::PluginFeature >& feature)
virtual void | on_plugin_added (const Glib::RefPtr< Gst::Plugin >& plugin)
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::Registry > | wrap (GstRegistry* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

An abstract base class for management of Gst::Plugin objects.

One registry holds the metadata of a set of plugins. All registries build the GstRegistryPool.

Design:

The Gst::Registry object is a list of plugins and some functions for dealing with them. Gst::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 Gst::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 env var. 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:

- 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 GST_PLUGIN_FLAG_CACHED bit. These plugins are removed at the end of intitialization.

## Constructor & Destructor Documentation

virtual Gst::Registry::~Registry | ( | ) | `[virtual]`

## Member Function Documentation

void Gst::Registry::add_feature | ( | const Glib::RefPtr< Gst::PluginFeature >& | feature ) |

Add the feature to the registry.

The feature-added signal will be emitted. This function sinks feature.

Parameters:

  feature | The feature to add.

Returns:
  `true` on success.

MT safe.

void Gst::Registry::add_path | ( | const Glib::ustring & | 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.

Parameters:

  path | The path to add to the registry.

bool Gst::Registry::add_plugin | ( | const Glib::RefPtr< Gst::Plugin >& | plugin ) |

Add the plugin to the registry.

The plugin-added signal will be emitted. This function will sink plugin.

Parameters:

  plugin | The plugin to add.

Returns:
  `true` on success.

MT safe.

static bool Gst::Registry::check_feature_version | ( | const Glib::ustring & | feature_name,
|  | guint | min_major,
|  | guint | min_minor,
|  | guint | min_micro
| ) |  | `[static]`

Checks whether a plugin feature by the given name exists in the default 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.

Returns:
  #`true` if the feature could be found and the version is the same as the required version or newer, and #`false` otherwise.

Glib::RefPtr<Gst::PluginFeature> Gst::Registry::find_feature | ( | const Glib::ustring & | name,
|  | GType | type
| ) |  |

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.

Returns:
  The pluginfeature with the given name and type or `0` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

Glib::RefPtr<const Gst::PluginFeature> Gst::Registry::find_feature | ( | const Glib::ustring & | name,
|  | GType | type
| ) |  | const

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.

Returns:
  The pluginfeature with the given name and type or `0` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

Glib::RefPtr<const Gst::Plugin> Gst::Registry::find_plugin | ( | const Glib::ustring & | name ) | const

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.

Returns:
  The plugin with the given name or `0` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

Glib::RefPtr<Gst::Plugin> Gst::Registry::find_plugin | ( | const Glib::ustring & | name ) |

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.

Returns:
  The plugin with the given name or `0` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

static Glib::RefPtr<Gst::Registry> Gst::Registry::get_default | ( | ) | `[static]`

Retrieves the default registry.

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

Returns:
  The default Gst::Registry.

Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | GType | type ) |

Retrieves a List of Gst::PluginFeature of type.

Parameters:

  type | A Type.

Returns:
  A List of Gst::PluginFeature of type. Use Gst::PluginFeature::list_free() after usage.

MT safe.

Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | const PluginFeature::SlotFilter & | filter,
|  | bool | first
| ) |  |

Runs a filter against all features of the 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).

Parameters:

  registry | Registry to query.
  filter | The filter to use.
  first | Only return first match.

Returns:
  A list of Gst::PluginFeature. MT safe.

Glib::ListHandle< Glib::RefPtr<Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | const Glib::ustring & | name ) |

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

Parameters:

  name | A plugin name.

Returns:
  A List of Gst::PluginFeature. Use Gst::PluginFeature::list_free() after usage.

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | const PluginFeature::SlotFilter & | filter,
|  | bool | first
| ) |  | const

Runs a filter against all features of the 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).

Parameters:

  registry | Registry to query.
  filter | The filter to use.
  first | Only return first match.

Returns:
  A list of Gst::PluginFeature. MT safe.

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | const Glib::ustring & | name ) | const

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

Parameters:

  name | A plugin name.

Returns:
  A List of Gst::PluginFeature. Use Gst::PluginFeature::list_free() after usage.

Glib::ListHandle< Glib::RefPtr<const Gst::PluginFeature> > Gst::Registry::get_feature_list | ( | GType | type ) | const

Retrieves a List of Gst::PluginFeature of type.

Parameters:

  type | A Type.

Returns:
  A List of Gst::PluginFeature of type. Use Gst::PluginFeature::list_free() after usage.

MT safe.

guint32 Gst::Registry::get_feature_list_cookie | ( | ) | const

Returns the registrys feature list cookie.

This changes every time a feature is added or removed from the registry.

Since gstreamermm 0.10:
  .26

Returns:
  The feature list cookie.

Glib::ListHandle< Glib::ustring > Gst::Registry::get_path_list | ( | ) | const

Get the list of paths for the given registry.

Returns:
  A Glist of paths as strings. g_list_free after use.

MT safe.

Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> > Gst::Registry::get_plugin_list | ( | const Plugin::SlotFilter & | filter,
|  | bool | first
| ) |  | const

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).

Parameters:

  filter | The filter to use.
  first | Only return first match.

Returns:
  A list of Gst::Plugin. MT safe.

Glib::ListHandle< Glib::RefPtr<Gst::Plugin> > Gst::Registry::get_plugin_list | ( | ) |

Get a copy of all plugins registered in the given registry.

The refcount of each element in the list in incremented.

Returns:
  A List of Gst::Plugin. Use Gst::Plugin::list_free() after usage.

MT safe.

Glib::ListHandle< Glib::RefPtr<const Gst::Plugin> > Gst::Registry::get_plugin_list | ( | ) | const

Get a copy of all plugins registered in the given registry.

The refcount of each element in the list in incremented.

Returns:
  A List of Gst::Plugin. Use Gst::Plugin::list_free() after usage.

MT safe.

Glib::ListHandle< Glib::RefPtr<Gst::Plugin> > Gst::Registry::get_plugin_list | ( | const Plugin::SlotFilter & | 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).

Parameters:

  filter | The filter to use.
  first | Only return first match.

Returns:
  A list of Gst::Plugin. MT safe.

const GstRegistry* Gst::Registry::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Object.

GstRegistry* Gst::Registry::gobj | ( | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gst::Object.

GstRegistry* Gst::Registry::gobj_copy | ( | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gst::Object.

Glib::RefPtr<const Gst::Plugin> Gst::Registry::lookup | ( | const Glib::ustring & | filename ) | const

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.

Returns:
  The Gst::Plugin if found, or `0` if not. Gst::Object::unref() after usage.

Glib::RefPtr<Gst::Plugin> Gst::Registry::lookup | ( | const Glib::ustring & | filename ) |

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.

Returns:
  The Gst::Plugin if found, or `0` if not. Gst::Object::unref() after usage.

Glib::RefPtr<Gst::PluginFeature> Gst::Registry::lookup_feature | ( | const Glib::ustring & | name ) |

Find a Gst::PluginFeature with name in registry.

Parameters:

  name | A Gst::PluginFeature name.

Returns:
  A Gst::PluginFeature with its refcount incremented, use Gst::Object::unref() after usage.

MT safe.

Glib::RefPtr<const Gst::PluginFeature> Gst::Registry::lookup_feature | ( | const Glib::ustring & | name ) | const

Find a Gst::PluginFeature with name in registry.

Parameters:

  name | A Gst::PluginFeature name.

Returns:
  A Gst::PluginFeature with its refcount incremented, use Gst::Object::unref() after usage.

MT safe.

virtual void Gst::Registry::on_feature_added | ( | const Glib::RefPtr< Gst::PluginFeature >& | feature ) | `[protected, virtual]`

virtual void Gst::Registry::on_plugin_added | ( | const Glib::RefPtr< Gst::Plugin >& | plugin ) | `[protected, virtual]`

void Gst::Registry::remove_feature | ( | const Glib::RefPtr< Gst::PluginFeature >& | feature ) |

Remove the feature from the registry.

MT safe.

Parameters:

  feature | The feature to remove.

void Gst::Registry::remove_plugin | ( | const Glib::RefPtr< Gst::Plugin >& | plugin ) |

Remove the plugin from the registry.

MT safe.

Parameters:

  plugin | The plugin to remove.

void Gst::Registry::scan_path | ( | const Glib::ustring & | path ) |

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.

Returns:
  `true` if registry changed.

Glib::SignalProxy1< void,const Glib::RefPtr<Gst::PluginFeature>& > Gst::Registry::signal_feature_added | ( | ) |

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

Prototype:
  `void on_my_feature_added(const Glib::RefPtr<Gst::PluginFeature>& feature)`

Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Plugin>& > Gst::Registry::signal_plugin_added | ( | ) |

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

Prototype:
  `void on_my_plugin_added(const Glib::RefPtr<Gst::Plugin>& plugin)`

bool Gst::Registry::xml_read_cache | ( | const Glib::ustring & | location ) |

Read the contents of the XML cache file at location into registry.

Parameters:

  location | A filename.

Returns:
  true on success.

bool Gst::Registry::xml_write_cache | ( | const Glib::ustring & | location ) | const

Write registry in an XML format at the location given by location.

Directories are automatically created.

Parameters:

  location | A filename.

Returns:
  true on success.

## Friends And Related Function Documentation

Glib::RefPtr< Gst::Registry > wrap | ( | GstRegistry * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gstreamermm/registry.h