2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wim.taymans@chello.be>
5 * gstregistry.h: Header for registry handling
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef __GST_REGISTRY_H__
25 #define __GST_REGISTRY_H__
27 #include <gst/gstconfig.h>
28 #include <gst/gstplugin.h>
29 #include <gst/gstpluginfeature.h>
33 #define GST_TYPE_REGISTRY (gst_registry_get_type ())
34 #define GST_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REGISTRY, GstRegistry))
35 #define GST_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REGISTRY))
36 #define GST_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REGISTRY, GstRegistryClass))
37 #define GST_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REGISTRY))
38 #define GST_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_REGISTRY, GstRegistryClass))
40 typedef struct _GstRegistry GstRegistry;
41 typedef struct _GstRegistryClass GstRegistryClass;
42 typedef struct _GstRegistryPrivate GstRegistryPrivate;
47 * Opaque #GstRegistry structure.
53 GstRegistryPrivate *priv;
56 struct _GstRegistryClass {
57 GstObjectClass parent_class;
60 GType gst_registry_get_type (void);
62 GstRegistry * gst_registry_get_default (void);
64 gboolean gst_registry_scan_path (GstRegistry *registry, const gchar *path);
65 void gst_registry_add_path (GstRegistry * registry, const gchar * path);
66 GList* gst_registry_get_path_list (GstRegistry *registry);
68 gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin);
69 void gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin);
70 gboolean gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature);
71 void gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature);
73 GList* gst_registry_get_plugin_list (GstRegistry *registry);
74 GList* gst_registry_plugin_filter (GstRegistry *registry,
75 GstPluginFilter filter,
78 GList* gst_registry_feature_filter (GstRegistry *registry,
79 GstPluginFeatureFilter filter,
82 GList * gst_registry_get_feature_list (GstRegistry *registry,
84 GList * gst_registry_get_feature_list_by_plugin (GstRegistry *registry, const gchar *name);
85 guint32 gst_registry_get_feature_list_cookie (GstRegistry *registry);
87 GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name);
88 GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type);
90 GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename);
91 GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name);
93 /* convinience defines for the default registry */
96 * gst_default_registry_add_plugin:
97 * @plugin: (transfer full): the plugin to add
99 * Add the plugin to the default registry.
100 * The plugin-added signal will be emitted.
102 * Returns: TRUE on success.
104 #define gst_default_registry_add_plugin(plugin) \
105 gst_registry_add_plugin (gst_registry_get_default(), plugin)
108 * gst_default_registry_add_path:
109 * @path: the path to add to the registry
111 * Add the given path to the default registry. The syntax of the
112 * path is specific to the registry. If the path has already been
115 #define gst_default_registry_add_path(path) \
116 gst_registry_add_path (gst_registry_get_default(), path)
119 * gst_default_registry_get_path_list:
121 * Get the list of paths for the default registry.
123 * Returns: (transfer container) (element-type char*): a #GList of paths as
124 * strings. g_list_free() after use.
126 #define gst_default_registry_get_path_list() \
127 gst_registry_get_path_list (gst_registry_get_default())
130 * gst_default_registry_get_plugin_list:
132 * Get a copy of all plugins registered in the default registry.
134 * Returns: (transfer full) (element-type Gst.Plugin): a copy of the list.
137 #define gst_default_registry_get_plugin_list() \
138 gst_registry_get_plugin_list (gst_registry_get_default())
141 * gst_default_registry_find_feature:
142 * @name: the pluginfeature name to find
143 * @type: the pluginfeature type to find
145 * Find the pluginfeature with the given name and type in the default registry.
147 * Returns: (transfer full): the pluginfeature with the given name and type or
148 * NULL if the plugin was not found.
150 #define gst_default_registry_find_feature(name,type) \
151 gst_registry_find_feature (gst_registry_get_default(),name,type)
154 * gst_default_registry_find_plugin:
155 * @name: the plugin name to find
157 * Find the plugin with the given name in the default registry.
158 * The plugin will be reffed; caller is responsible for unreffing.
160 * Returns: (transfer full): The plugin with the given name or NULL if the
161 * plugin was not found.
163 #define gst_default_registry_find_plugin(name) \
164 gst_registry_find_plugin (gst_registry_get_default(),name)
167 * gst_default_registry_feature_filter:
168 * @filter: the filter to use
169 * @first: only return first match
170 * @user_data: user data passed to the filter function
172 * Runs a filter against all features of the plugins in the default registry
173 * and returns a GList with the results.
174 * If the first flag is set, only the first match is
175 * returned (as a list with a single object).
177 * Returns: (transfer full) (element-type Gst.PluginFeature): a #GList of
178 * plugin features, gst_plugin_feature_list_free after use.
180 #define gst_default_registry_feature_filter(filter,first,user_data) \
181 gst_registry_feature_filter (gst_registry_get_default(),filter,first,user_data)
184 * gst_default_registry_get_feature_list_cookie:
186 * Returns the default registrys feature list cookie. This changes
187 * every time a feature is added or removed from the registry.
189 * Returns: the feature list cookie.
193 #define gst_default_registry_get_feature_list_cookie() \
194 gst_registry_get_feature_list_cookie (gst_registry_get_default())
196 gboolean gst_default_registry_check_feature_version (const gchar *feature_name,
203 #endif /* __GST_REGISTRY_H__ */