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/gstplugin.h>
29 #define GLOBAL_REGISTRY_DIR GST_CACHE_DIR
30 #define GLOBAL_REGISTRY_FILE GLOBAL_REGISTRY_DIR"/registry.xml"
31 #define GLOBAL_REGISTRY_FILE_TMP GLOBAL_REGISTRY_DIR"/.registry.xml.tmp"
33 #define LOCAL_REGISTRY_DIR ".gstreamer-"GST_MAJORMINOR
34 #define LOCAL_REGISTRY_FILE LOCAL_REGISTRY_DIR"/registry.xml"
35 #define LOCAL_REGISTRY_FILE_TMP LOCAL_REGISTRY_DIR"/.registry.xml.tmp"
37 #define REGISTRY_DIR_PERMS (S_ISGID | \
38 S_IRUSR | S_IWUSR | S_IXUSR | \
41 #define REGISTRY_TMPFILE_PERMS (S_IRUSR | S_IWUSR)
42 #define REGISTRY_FILE_PERMS (S_IRUSR | S_IWUSR | \
49 GST_REGISTRY_OK = (0),
50 GST_REGISTRY_LOAD_ERROR = (1 << 1),
51 GST_REGISTRY_SAVE_ERROR = (1 << 2),
52 GST_REGISTRY_PLUGIN_LOAD_ERROR = (1 << 3),
53 GST_REGISTRY_PLUGIN_SIGNATURE_ERROR = (1 << 4)
57 GST_REGISTRY_READABLE = (1 << 1),
58 GST_REGISTRY_WRITABLE = (1 << 2),
59 GST_REGISTRY_EXISTS = (1 << 3),
60 GST_REGISTRY_REMOTE = (1 << 4),
61 GST_REGISTRY_DELAYED_LOADING = (1 << 5)
65 #define GST_TYPE_REGISTRY (gst_registry_get_type ())
66 #define GST_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REGISTRY, GstRegistry))
67 #define GST_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REGISTRY))
68 #define GST_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REGISTRY, GstRegistryClass))
69 #define GST_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REGISTRY))
70 #define GST_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_REGISTRY, GstRegistryClass))
72 typedef struct _GstRegistry GstRegistry;
73 typedef struct _GstRegistryClass GstRegistryClass;
79 GstRegistryFlags flags;
89 gpointer _gst_reserved[GST_PADDING];
92 struct _GstRegistryClass {
93 GObjectClass parent_class;
96 gboolean (*load) (GstRegistry *registry);
97 gboolean (*save) (GstRegistry *registry);
98 gboolean (*rebuild) (GstRegistry *registry);
99 gboolean (*unload) (GstRegistry *registry);
101 GstRegistryReturn (*load_plugin) (GstRegistry *registry, GstPlugin *plugin);
102 GstRegistryReturn (*unload_plugin) (GstRegistry *registry, GstPlugin *plugin);
103 GstRegistryReturn (*update_plugin) (GstRegistry *registry, GstPlugin *plugin);
106 void (*plugin_added) (GstRegistry *registry, GstPlugin *plugin);
108 gpointer _gst_reserved[GST_PADDING];
112 /* normal GObject stuff */
113 GType gst_registry_get_type (void);
115 gboolean gst_registry_load (GstRegistry *registry);
116 gboolean gst_registry_is_loaded (GstRegistry *registry);
117 gboolean gst_registry_save (GstRegistry *registry);
118 gboolean gst_registry_rebuild (GstRegistry *registry);
119 gboolean gst_registry_unload (GstRegistry *registry);
121 void gst_registry_add_path (GstRegistry *registry, const gchar *path);
122 GList* gst_registry_get_path_list (GstRegistry *registry);
123 void gst_registry_clear_paths (GstRegistry *registry);
125 gboolean gst_registry_add_plugin (GstRegistry *registry, GstPlugin *plugin);
126 void gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin);
128 GList* gst_registry_plugin_filter (GstRegistry *registry,
129 GstPluginFilter filter,
132 GList* gst_registry_feature_filter (GstRegistry *registry,
133 GstPluginFeatureFilter filter,
137 GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name);
138 GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type);
140 GstRegistryReturn gst_registry_load_plugin (GstRegistry *registry, GstPlugin *plugin);
141 GstRegistryReturn gst_registry_unload_plugin (GstRegistry *registry, GstPlugin *plugin);
142 GstRegistryReturn gst_registry_update_plugin (GstRegistry *registry, GstPlugin *plugin);
146 #endif /* __GST_REGISTRY_H__ */