2002-04-12 09:53:00 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wim.taymans@chello.be>
|
|
|
|
*
|
|
|
|
* gstregistry.h: Header for registry handling
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_REGISTRY_H__
|
|
|
|
#define __GST_REGISTRY_H__
|
|
|
|
|
2006-07-18 19:01:25 +00:00
|
|
|
#include <gst/gstconfig.h>
|
2002-05-08 20:40:48 +00:00
|
|
|
#include <gst/gstplugin.h>
|
2005-09-20 06:28:33 +00:00
|
|
|
#include <gst/gstpluginfeature.h>
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
#define GST_TYPE_REGISTRY (gst_registry_get_type ())
|
|
|
|
#define GST_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REGISTRY, GstRegistry))
|
|
|
|
#define GST_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REGISTRY))
|
|
|
|
#define GST_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REGISTRY, GstRegistryClass))
|
|
|
|
#define GST_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REGISTRY))
|
|
|
|
#define GST_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_REGISTRY, GstRegistryClass))
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
typedef struct _GstRegistry GstRegistry;
|
|
|
|
typedef struct _GstRegistryClass GstRegistryClass;
|
2009-10-24 08:05:59 +00:00
|
|
|
typedef struct _GstRegistryPrivate GstRegistryPrivate;
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2005-12-02 12:34:47 +00:00
|
|
|
/**
|
|
|
|
* GstRegistry:
|
|
|
|
*
|
|
|
|
* Opaque #GstRegistry structure.
|
|
|
|
*/
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstRegistry {
|
2005-09-15 23:51:24 +00:00
|
|
|
GstObject object;
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2005-12-02 12:34:47 +00:00
|
|
|
/*< private >*/
|
commit binary registry (disabled by default, see #359653)
Original commit message from CVS:
* configure.ac:
* docs/gst/gstreamer-sections.txt:
* gst/Makefile.am:
* gst/gstregistry.c: (gst_registry_lookup_feature_locked),
(gst_registry_lookup_locked):
* gst/gstregistry.h:
* gst/gstregistrybinary.c: (gst_registry_binary_write),
(gst_registry_binary_initialize_magic),
(gst_registry_binary_save_string),
(gst_registry_binary_save_pad_template),
(gst_registry_binary_save_feature),
(gst_registry_binary_save_plugin),
(gst_registry_binary_write_cache),
(gst_registry_binary_check_magic),
(gst_registry_binary_load_pad_template),
(gst_registry_binary_load_feature),
(gst_registry_binary_load_plugin),
(gst_registry_binary_read_cache):
* gst/gstregistrybinary.h:
* gst/gstregistryxml.c: (load_feature),
(gst_registry_xml_read_cache):
commit binary registry (disabled by default, see #359653)
2007-01-11 13:45:51 +00:00
|
|
|
GList *plugins;
|
2005-09-18 06:59:25 +00:00
|
|
|
GList *features;
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GList *paths;
|
2002-12-19 21:31:03 +00:00
|
|
|
|
2006-03-08 12:57:37 +00:00
|
|
|
/* FIXME move these elsewhere */
|
|
|
|
int cache_file;
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2007-07-23 11:42:12 +00:00
|
|
|
/* hash to speedup _lookup_feature_locked() */
|
|
|
|
GHashTable *feature_hash;
|
2009-10-21 03:28:54 +00:00
|
|
|
/* hash to speedup _lookup */
|
|
|
|
GHashTable *basename_hash;
|
2007-07-23 11:42:12 +00:00
|
|
|
|
2009-10-24 09:58:25 +00:00
|
|
|
GstRegistryPrivate *priv;
|
2009-10-24 08:05:59 +00:00
|
|
|
|
2005-12-02 12:34:47 +00:00
|
|
|
/*< private >*/
|
2009-10-24 08:05:59 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING-3];
|
2002-05-08 20:40:48 +00:00
|
|
|
};
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstRegistryClass {
|
2005-09-15 23:51:24 +00:00
|
|
|
GstObjectClass parent_class;
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
/* signals */
|
2004-03-15 14:43:35 +00:00
|
|
|
void (*plugin_added) (GstRegistry *registry, GstPlugin *plugin);
|
2005-09-18 06:59:25 +00:00
|
|
|
void (*feature_added) (GstRegistry *registry, GstPluginFeature *feature);
|
2002-12-19 21:31:03 +00:00
|
|
|
|
2005-10-14 11:09:29 +00:00
|
|
|
/*< private >*/
|
2003-12-09 02:39:31 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2002-05-08 20:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* normal GObject stuff */
|
2004-03-15 14:43:35 +00:00
|
|
|
GType gst_registry_get_type (void);
|
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
GstRegistry * gst_registry_get_default (void);
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2006-04-28 20:47:23 +00:00
|
|
|
gboolean gst_registry_scan_path (GstRegistry *registry, const gchar *path);
|
2007-08-10 14:40:26 +00:00
|
|
|
void gst_registry_add_path (GstRegistry * registry, const gchar * path);
|
2004-03-15 14:43:35 +00:00
|
|
|
GList* gst_registry_get_path_list (GstRegistry *registry);
|
|
|
|
|
|
|
|
gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin);
|
|
|
|
void gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin);
|
2005-09-18 06:59:25 +00:00
|
|
|
gboolean gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature);
|
|
|
|
void gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature);
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
GList* gst_registry_get_plugin_list (GstRegistry *registry);
|
2005-10-15 15:30:24 +00:00
|
|
|
GList* gst_registry_plugin_filter (GstRegistry *registry,
|
|
|
|
GstPluginFilter filter,
|
|
|
|
gboolean first,
|
2004-03-15 14:43:35 +00:00
|
|
|
gpointer user_data);
|
2005-10-15 15:30:24 +00:00
|
|
|
GList* gst_registry_feature_filter (GstRegistry *registry,
|
|
|
|
GstPluginFeatureFilter filter,
|
2004-03-15 14:43:35 +00:00
|
|
|
gboolean first,
|
|
|
|
gpointer user_data);
|
2005-09-15 00:13:26 +00:00
|
|
|
GList * gst_registry_get_feature_list (GstRegistry *registry,
|
|
|
|
GType type);
|
2005-09-18 06:59:25 +00:00
|
|
|
GList * gst_registry_get_feature_list_by_plugin (GstRegistry *registry, const gchar *name);
|
2009-11-10 17:03:43 +00:00
|
|
|
guint32 gst_registry_get_feature_list_cookie (GstRegistry *registry);
|
2004-03-15 14:43:35 +00:00
|
|
|
|
|
|
|
GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name);
|
|
|
|
GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type);
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2005-09-19 15:12:25 +00:00
|
|
|
GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename);
|
|
|
|
GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name);
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2008-03-03 14:43:26 +00:00
|
|
|
/* FIXME 0.11: do we really want to export these? (If yes, we should add a GError argument) */
|
2005-09-19 15:12:25 +00:00
|
|
|
gboolean gst_registry_xml_read_cache (GstRegistry * registry, const char *location);
|
|
|
|
gboolean gst_registry_xml_write_cache (GstRegistry * registry, const char *location);
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2005-11-04 15:02:48 +00:00
|
|
|
/* convinience defines for the default registry */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_add_plugin:
|
|
|
|
* @plugin: the plugin to add
|
|
|
|
*
|
|
|
|
* Add the plugin to the default registry.
|
|
|
|
* The plugin-added signal will be emitted.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_add_plugin(plugin) \
|
|
|
|
gst_registry_add_plugin (gst_registry_get_default(), plugin)
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_add_path:
|
|
|
|
* @path: the path to add to the registry
|
|
|
|
*
|
|
|
|
* Add the given path to the default registry. The syntax of the
|
|
|
|
* path is specific to the registry. If the path has already been
|
|
|
|
* added, do nothing.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_add_path(path) \
|
|
|
|
gst_registry_add_path (gst_registry_get_default(), path)
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_get_path_list:
|
|
|
|
*
|
|
|
|
* Get the list of paths for the default registry.
|
|
|
|
*
|
|
|
|
* Returns: A Glist of paths as strings. g_list_free after use.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_get_path_list() \
|
|
|
|
gst_registry_get_path_list (gst_registry_get_default())
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_get_plugin_list:
|
|
|
|
*
|
|
|
|
* Get a copy of all plugins registered in the default registry.
|
|
|
|
*
|
|
|
|
* Returns: a copy of the list. Free after use.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_get_plugin_list() \
|
|
|
|
gst_registry_get_plugin_list (gst_registry_get_default())
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_find_feature:
|
|
|
|
* @name: the pluginfeature name to find
|
|
|
|
* @type: the pluginfeature type to find
|
|
|
|
*
|
|
|
|
* Find the pluginfeature with the given name and type in the default registry.
|
|
|
|
*
|
|
|
|
* Returns: The pluginfeature with the given name and type or NULL
|
|
|
|
* if the plugin was not found.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_find_feature(name,type) \
|
|
|
|
gst_registry_find_feature (gst_registry_get_default(),name,type)
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_find_plugin:
|
|
|
|
* @name: the plugin name to find
|
|
|
|
*
|
|
|
|
* Find the plugin with the given name in the default registry.
|
|
|
|
* The plugin will be reffed; caller is responsible for unreffing.
|
|
|
|
*
|
|
|
|
* Returns: The plugin with the given name or NULL if the plugin was not found.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_find_plugin(name) \
|
|
|
|
gst_registry_find_plugin (gst_registry_get_default(),name)
|
2005-11-04 15:02:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_default_registry_feature_filter:
|
|
|
|
* @filter: the filter to use
|
|
|
|
* @first: only return first match
|
|
|
|
* @user_data: user data passed to the filter function
|
|
|
|
*
|
|
|
|
* Runs a filter against all features of the plugins in the default 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).
|
|
|
|
*
|
|
|
|
* Returns: a GList of plugin features, gst_plugin_feature_list_free after use.
|
|
|
|
*/
|
2005-09-15 00:13:26 +00:00
|
|
|
#define gst_default_registry_feature_filter(filter,first,user_data) \
|
|
|
|
gst_registry_feature_filter (gst_registry_get_default(),filter,first,user_data)
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2009-11-10 17:03:43 +00:00
|
|
|
/**
|
|
|
|
* gst_default_registry_get_feature_list_cookie:
|
|
|
|
*
|
|
|
|
* Returns the default registrys feature list cookie. This changes
|
|
|
|
* every time a feature is added or removed from the registry.
|
|
|
|
*
|
|
|
|
* Returns: the feature list cookie.
|
|
|
|
*
|
|
|
|
* Since: 0.10.26
|
|
|
|
*/
|
|
|
|
#define gst_default_registry_get_feature_list_cookie() \
|
|
|
|
gst_registry_get_feature_list_cookie (gst_registry_get_default())
|
|
|
|
|
2005-10-14 11:09:29 +00:00
|
|
|
gboolean gst_default_registry_check_feature_version (const gchar *feature_name,
|
|
|
|
guint min_major,
|
|
|
|
guint min_minor,
|
|
|
|
guint min_micro);
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2002-04-12 09:53:00 +00:00
|
|
|
#endif /* __GST_REGISTRY_H__ */
|
2005-09-15 00:13:26 +00:00
|
|
|
|