Gst::Registry Class Reference

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

`#include <gstreamermm/registry.h>`

Inheritance diagram for Gst::Registry:
[legend]

## Public Member Functions

| Registry (Registry&& src) noexcept
Registry& | operator= (Registry&& src) noexcept
| ~Registry () noexcept override
GstRegistry* | gobj ()
| Provides access to the underlying C GObject. More...
const GstRegistry* | gobj () const
| Provides access to the underlying C GObject. More...
GstRegistry* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
Glib::ListHandle< Glib::RefPtr< Gst::PluginFeature > > | get_feature_list (GType type)
| Retrieves a List of Gst::PluginFeature of type. More...
Glib::ListHandle< Glib::RefPtr< const Gst::PluginFeature > > | get_feature_list (GType type) const
| Retrieves a List of Gst::PluginFeature of type. More...
guint32 | get_feature_list_cookie () const
| Returns the registry's feature list cookie. More...
Glib::ListHandle< Glib::RefPtr< Gst::PluginFeature > > | get_feature_list (const Glib::ustring& name)
| Retrieves a List of features of the plugin with name name. More...
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. More...
Glib::ListHandle< Glib::RefPtr< Gst::Plugin > > | get_plugin_list ()
| Get a copy of all plugins registered in the given registry. More...
Glib::ListHandle< Glib::RefPtr< const Gst::Plugin > > | get_plugin_list () const
| Get a copy of all plugins registered in the given registry. More...
void | remove_plugin (const Glib::RefPtr< Gst::Plugin >& plugin)
| Remove the plugin from the registry. More...
bool | add_plugin (Glib::RefPtr< Gst::Plugin >&& plugin)
| Add the plugin to the registry. More...
void | add_plugin (const Glib::RefPtr< Gst::Plugin >& plugin)
| A add_plugin() convenience overload. Allows to re-use plugin parameter after function call. More...
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. More...
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. More...
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. More...
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. More...
Glib::RefPtr< Gst::Plugin > | find_plugin (const Glib::ustring& name)
| Find the plugin with the given name in the registry. More...
Glib::RefPtr< const Gst::Plugin > | find_plugin (const Glib::ustring& name) const
| Find the plugin with the given name in the registry. More...
Glib::RefPtr< Gst::PluginFeature > | find_feature (const Glib::ustring& name, GType type)
| Find the pluginfeature with the given name and type in the registry. More...
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. More...
Glib::RefPtr< Gst::PluginFeature > | lookup_feature (const Glib::ustring& name)
| Find a Gst::PluginFeature with name in registry. More...
Glib::RefPtr< const Gst::PluginFeature > | lookup_feature (const Glib::ustring& name) const
| Find a Gst::PluginFeature with name in registry. More...
bool | scan_path (const Glib::ustring& path)
| Scan the given path for plugins to add to the registry. More...
Glib::RefPtr< Gst::Plugin > | lookup (const Glib::ustring& filename)
| Look up a plugin in the given registry with the given filename. More...
Glib::RefPtr< const Gst::Plugin > | lookup (const Glib::ustring& filename) const
| Look up a plugin in the given registry with the given filename. More...
void | remove_feature (const Glib::RefPtr< Gst::PluginFeature >& feature)
| Remove the feature from the registry. More...
void | add_feature (Glib::RefPtr< Gst::PluginFeature >&& feature)
| Add the feature to the registry. More...
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 registry and whether its version is at least the version required. More...
void | add_feature (const Glib::RefPtr< Gst::PluginFeature >& feature)
| This methods appear in .defs file, because they are removed from API using #if 0 directive. More...
Public Member Functions inherited from Gst::Object
| Object (Object&& src) noexcept
Object& | operator= (Object&& src) noexcept
| ~Object () noexcept override
GstObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GstObject* | gobj () const
| Provides access to the underlying C GObject. More...
GstObject* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
bool | is_element () const
bool | is_element_factory () const
bool | is_pad () const
bool | is_pad_template () const
bool | is_bin () const
guint32 | get_flags () const
| Returns the entire set of flags for the object. More...
bool | set_name (const Glib::ustring& name)
| Sets the name of object, or gives object a guaranteed unique name (if name is `nullptr`). More...
Glib::ustring | get_name () const
| Returns a copy of the name of object. More...
bool | set_parent (const Glib::RefPtr< Gst::Object >& parent)
| Sets the parent of object to parent. More...
Glib::RefPtr< Gst::Object > | get_parent ()
| Returns the parent of object. More...
Glib::RefPtr< const Gst::Object > | get_parent () const
| Returns the parent of object. More...
void | unparent ()
| Clear the parent of object, removing the associated reference. More...
void | set_control_rate (Gst::ClockTime control_rate)
| Change the control-rate for this object. More...
Gst::ClockTime | get_control_rate () const
| Obtain the control-rate for this object. More...
Gst::ClockTime | suggest_next_sync () const
| Returns a suggestion for timestamps where buffers should be split to get best controller results. More...
bool | sync_values (Gst::ClockTime timestamp)
| Sets the properties of the object, according to the Gst::ControlSources that (maybe) handle them and for the given timestamp. More...
void | set_control_bindings_disabled (bool disabled)
| This function is used to disable all controlled properties of the object for some time, i.e. sync_values() will do nothing. More...
bool | has_asctive_control_bindings () const
| Check if the object has an active controlled properties. More...
bool | has_ancestor (const Glib::RefPtr< const Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_ancestor (const Glib::RefPtr< Gst::Object >& ancestor) const
| Check if object has an ancestor ancestor somewhere up in the hierarchy. More...
bool | has_as_parent (const Glib::RefPtr< Gst::Object >& parent) const
| Check if parent is the parent of object. More...
Glib::ustring | get_path_string ()
| Generates a string describing the path of object in the object hierarchy. More...
Glib::PropertyProxy< Glib::ustring > | property_name ()
| The name of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const
| The name of the object. More...
Glib::PropertyProxy< Glib::RefPtr< Gst::Object > > | property_parent ()
| The parent of the object. More...
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gst::Object > > | property_parent () const
| The parent of the object. More...
Glib::SignalProxy< void, const Glib::RefPtr< Gst::Object >&, GParamSpec*> | signal_deep_notify ()
int | get_refcount () const

## Static Public Member Functions

static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Gst::Registry > | get ()
Static Public Member Functions inherited from Gst::Object
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static bool | check_uniqueness (const Glib::ListHandle< const Gst::Object >& list, const Glib::ustring& name)
| Checks to see if there is any object named name in list. More...

## 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. More...
Related Functions inherited from Gst::Object
Glib::RefPtr< Gst::Object > | wrap (GstObject* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members

Protected Member Functions inherited from Gst::Object
virtual void | on_deep_notify (const Glib::RefPtr< Gst::Object >& prop_object, GParamSpec* prop)
| This is a default handler for the signal signal_deep_notify(). More...

## Detailed Description

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

One registry holds the metadata of a set of plugins.

Design:

The Gst::Registry object is a list of plugins and some functions for dealing with them. Each Gst::Plugin 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: ~/.gstreamer-$GST_API_VERSION/plugins/ and $prefix/libs/gstreamer-$GST_API_VERSION/.

The registry cache file is loaded from ~/.gstreamer-$GST_API_VERSION/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 "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.

Last reviewed on 2012-03-29 (0.11.3)

## Constructor & Destructor Documentation

## Registry()

Gst::Registry::Registry | ( | Registry&& | src | ) |

noexcept

## ~Registry()

Gst::Registry::~Registry | ( |  | ) |

override noexcept

## Member Function Documentation

## add_feature() [1/2]

void Gst::Registry::add_feature | ( | 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.

## add_feature() [2/2]

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

This methods appear in .defs file, because they are removed from API using #if 0 directive.

h2def.py script can't detect that case, so methods have to be ignored manually. A add_feature() convenience overload. Allows to re-use feature parameter after function call.

## add_plugin() [1/2]

bool Gst::Registry::add_plugin | ( | 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.

## add_plugin() [2/2]

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

A add_plugin() convenience overload. Allows to re-use plugin parameter after function call.

## check_feature_version()

bool Gst::Registry::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 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.

## find_feature() [1/2]

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 `nullptr` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

## find_feature() [2/2]

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 `nullptr` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

## find_plugin() [1/2]

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 `nullptr` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

## find_plugin() [2/2]

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 `nullptr` if the plugin was not found. Gst::Object::unref() after usage.

MT safe.

## get()

static Glib::RefPtr<Gst::Registry> Gst::Registry::get | ( |  | ) |

static

## get_feature_list() [1/6]

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 use

MT safe.

## get_feature_list() [2/6]

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 use

MT safe.

## get_feature_list() [3/6]

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.

## get_feature_list() [4/6]

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.

## get_feature_list() [5/6]

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

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

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

## get_feature_list() [6/6]

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

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

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

## get_feature_list_cookie()

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

Returns the registry's feature list cookie.

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

Returns
  The feature list cookie.

## get_plugin_list() [1/4]

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.

## get_plugin_list() [2/4]

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.

## get_plugin_list() [3/4]

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.

## get_plugin_list() [4/4]

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.

## get_type()

static GType Gst::Registry::get_type | ( |  | ) |

static

Get the GType for this class, for use with the underlying GObject type system.

## gobj() [1/2]

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

inline

Provides access to the underlying C GObject.

## gobj() [2/2]

const GstRegistry* Gst::Registry::gobj | ( |  | ) | const

inline

Provides access to the underlying C GObject.

## gobj_copy()

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.

## lookup() [1/2]

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 `nullptr` if not. Gst::Object::unref() after usage.

## lookup() [2/2]

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 `nullptr` if not. Gst::Object::unref() after usage.

## lookup_feature() [1/2]

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.

## lookup_feature() [2/2]

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.

## operator=()

Registry& Gst::Registry::operator= | ( | Registry&& | src | ) |

noexcept

## remove_feature()

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.

## remove_plugin()

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.

## scan_path()

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

## Friends And Related Function Documentation

## wrap()

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.