GstRegistry

GstRegistry — Abstract base class for management of GstPlugin objects.

Synopsis


#include <gst/gst.h>


                    GstRegistry;
#define             GLOBAL_REGISTRY_DIR
#define             GLOBAL_REGISTRY_FILE
#define             GLOBAL_REGISTRY_FILE_TMP
#define             LOCAL_REGISTRY_DIR
#define             LOCAL_REGISTRY_FILE
#define             LOCAL_REGISTRY_FILE_TMP
#define             REGISTRY_DIR_PERMS
#define             REGISTRY_TMPFILE_PERMS
#define             REGISTRY_FILE_PERMS
enum                GstRegistryReturn;
enum                GstRegistryFlags;
gboolean            gst_registry_load                   (GstRegistry *registry);
gboolean            gst_registry_is_loaded              (GstRegistry *registry);
gboolean            gst_registry_save                   (GstRegistry *registry);
gboolean            gst_registry_rebuild                (GstRegistry *registry);
gboolean            gst_registry_unload                 (GstRegistry *registry);
void                gst_registry_add_path               (GstRegistry *registry,
                                                         const gchar *path);
GList*              gst_registry_get_path_list          (GstRegistry *registry);
void                gst_registry_clear_paths            (GstRegistry *registry);
gboolean            gst_registry_add_plugin             (GstRegistry *registry,
                                                         GstPlugin *plugin);
void                gst_registry_remove_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);
GList*              gst_registry_plugin_filter          (GstRegistry *registry,
                                                         GstPluginFilter filter,
                                                         gboolean first,
                                                         gpointer user_data);
GList*              gst_registry_feature_filter         (GstRegistry *registry,
                                                         GstPluginFeatureFilter filter,
                                                         gboolean first,
                                                         gpointer user_data);
GstPlugin*          gst_registry_find_plugin            (GstRegistry *registry,
                                                         const gchar *name);
GstPluginFeature*   gst_registry_find_feature           (GstRegistry *registry,
                                                         const gchar *name,
                                                         GType type);
GstRegistryReturn   gst_registry_load_plugin            (GstRegistry *registry,
                                                         GstPlugin *plugin);
GstRegistryReturn   gst_registry_unload_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);
GstRegistryReturn   gst_registry_update_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);


Object Hierarchy


  GObject
   +----GstRegistry

Description

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

Details

GstRegistry

typedef struct _GstRegistry GstRegistry;


GLOBAL_REGISTRY_DIR

#define GLOBAL_REGISTRY_DIR      GST_CACHE_DIR


GLOBAL_REGISTRY_FILE

#define GLOBAL_REGISTRY_FILE     GLOBAL_REGISTRY_DIR"/registry.xml"


GLOBAL_REGISTRY_FILE_TMP

#define GLOBAL_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.registry.xml.tmp"


LOCAL_REGISTRY_DIR

#define LOCAL_REGISTRY_DIR       ".gstreamer-"GST_MAJORMINOR


LOCAL_REGISTRY_FILE

#define LOCAL_REGISTRY_FILE      LOCAL_REGISTRY_DIR"/registry.xml"


LOCAL_REGISTRY_FILE_TMP

#define LOCAL_REGISTRY_FILE_TMP  LOCAL_REGISTRY_DIR"/.registry.xml.tmp"


REGISTRY_DIR_PERMS

#define             REGISTRY_DIR_PERMS


REGISTRY_TMPFILE_PERMS

#define             REGISTRY_TMPFILE_PERMS


REGISTRY_FILE_PERMS

#define             REGISTRY_FILE_PERMS


enum GstRegistryReturn

typedef enum {
  GST_REGISTRY_OK			= (0),
  GST_REGISTRY_LOAD_ERROR		= (1 << 1),
  GST_REGISTRY_SAVE_ERROR		= (1 << 2),
  GST_REGISTRY_PLUGIN_LOAD_ERROR	= (1 << 3),
  GST_REGISTRY_PLUGIN_SIGNATURE_ERROR	= (1 << 4)
} GstRegistryReturn;

The return value of registry operations

GST_REGISTRY_OK The registry reported no error.
GST_REGISTRY_LOAD_ERROR There was a load error
GST_REGISTRY_SAVE_ERROR There was an error saving the registry
GST_REGISTRY_PLUGIN_LOAD_ERROR There was an error loading a plugin
GST_REGISTRY_PLUGIN_SIGNATURE_ERROR There was an error saving a plugin

enum GstRegistryFlags

typedef enum {
  GST_REGISTRY_READABLE			= (1 << 1),
  GST_REGISTRY_WRITABLE			= (1 << 2),
  GST_REGISTRY_EXISTS			= (1 << 3),
  GST_REGISTRY_REMOTE			= (1 << 4),
  GST_REGISTRY_DELAYED_LOADING		= (1 << 5)
} GstRegistryFlags;

Flags for the registry

GST_REGISTRY_READABLE The registry can be read
GST_REGISTRY_WRITABLE The registry can be written to
GST_REGISTRY_EXISTS The registry exists
GST_REGISTRY_REMOTE The registry is remote and might be slower
GST_REGISTRY_DELAYED_LOADING The registry will be loaded on demand.

gst_registry_load ()

gboolean            gst_registry_load                   (GstRegistry *registry);

Load the given registry

registry : the registry to load
Returns : TRUE on success.

gst_registry_is_loaded ()

gboolean            gst_registry_is_loaded              (GstRegistry *registry);

Check if the given registry is loaded

registry : the registry to check
Returns : TRUE if loaded.

gst_registry_save ()

gboolean            gst_registry_save                   (GstRegistry *registry);

Save the contents of the given registry

registry : the registry to save
Returns : TRUE on success

gst_registry_rebuild ()

gboolean            gst_registry_rebuild                (GstRegistry *registry);

Rebuild the given registry

registry : the registry to rebuild
Returns : TRUE on success

gst_registry_unload ()

gboolean            gst_registry_unload                 (GstRegistry *registry);

Unload the given registry

registry : the registry to unload
Returns : TRUE on success

gst_registry_add_path ()

void                gst_registry_add_path               (GstRegistry *registry,
                                                         const gchar *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.

registry : the registry to add the path to
path : the path to add to the registry

gst_registry_get_path_list ()

GList*              gst_registry_get_path_list          (GstRegistry *registry);

Get the list of paths for the given registry.

registry : the registry to get the pathlist of
Returns : A Glist of paths as strings. g_list_free after use.

gst_registry_clear_paths ()

void                gst_registry_clear_paths            (GstRegistry *registry);

Clear the paths of the given registry

registry : the registry to clear the paths of

gst_registry_add_plugin ()

gboolean            gst_registry_add_plugin             (GstRegistry *registry,
                                                         GstPlugin *plugin);

Add the plugin to the registry. The plugin-added signal will be emitted.

registry : the registry to add the plugin to
plugin : the plugin to add
Returns : TRUE on success.

gst_registry_remove_plugin ()

void                gst_registry_remove_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);

Remove the plugin from the registry.

registry : the registry to remove the plugin from
plugin : the plugin to remove

gst_registry_plugin_filter ()

GList*              gst_registry_plugin_filter          (GstRegistry *registry,
                                                         GstPluginFilter filter,
                                                         gboolean first,
                                                         gpointer 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).

registry : registry to query
filter : the filter to use
first : only return first match
user_data : user data passed to the filter function
Returns : a GList of plugins, g_list_free after use.

gst_registry_feature_filter ()

GList*              gst_registry_feature_filter         (GstRegistry *registry,
                                                         GstPluginFeatureFilter filter,
                                                         gboolean first,
                                                         gpointer 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).

registry : registry to query
filter : the filter to use
first : only return first match
user_data : user data passed to the filter function
Returns : a GList of plugin features, g_list_free after use.

gst_registry_find_plugin ()

GstPlugin*          gst_registry_find_plugin            (GstRegistry *registry,
                                                         const gchar *name);

Find the plugin with the given name in the registry.

registry : the registry to search
name : the plugin name to find
Returns : The plugin with the given name or NULL if the plugin was not found.

gst_registry_find_feature ()

GstPluginFeature*   gst_registry_find_feature           (GstRegistry *registry,
                                                         const gchar *name,
                                                         GType type);

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

registry : the registry to search
name : the pluginfeature name to find
type : the pluginfeature type to find
Returns : The pluginfeature with the given name and type or NULL if the plugin was not found.

gst_registry_load_plugin ()

GstRegistryReturn   gst_registry_load_plugin            (GstRegistry *registry,
                                                         GstPlugin *plugin);

Bring the plugin from the registry into memory.

registry : the registry to load the plugin from
plugin : the plugin to load
Returns : a value indicating the result

gst_registry_unload_plugin ()

GstRegistryReturn   gst_registry_unload_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);

Unload the plugin from the given registry.

registry : the registry to unload the plugin from
plugin : the plugin to unload
Returns : a value indicating the result

gst_registry_update_plugin ()

GstRegistryReturn   gst_registry_update_plugin          (GstRegistry *registry,
                                                         GstPlugin *plugin);

Update the plugin in the given registry.

registry : the registry to update
plugin : the plugin to update
Returns : a value indicating the result

See Also

GstPlugin, GstPluginFeature