gst/gstmessage.c: Fixed a few forgotten variables on previous commit
[platform/upstream/gstreamer.git] / gst / gstregistry.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wim.taymans@chello.be>
4  *
5  * gstregistry.h: Header for registry handling
6  *
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.
11  *
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.
16  *
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.
21  */
22
23
24 #ifndef __GST_REGISTRY_H__
25 #define __GST_REGISTRY_H__
26
27 #include <gst/gstplugin.h>
28 #include <gst/gstpluginfeature.h>
29
30 G_BEGIN_DECLS
31
32 #define GST_TYPE_REGISTRY               (gst_registry_get_type ())
33 #define GST_REGISTRY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REGISTRY, GstRegistry))
34 #define GST_IS_REGISTRY(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REGISTRY))
35 #define GST_REGISTRY_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REGISTRY, GstRegistryClass))
36 #define GST_IS_REGISTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REGISTRY))
37 #define GST_REGISTRY_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_REGISTRY, GstRegistryClass))
38
39 typedef struct _GstRegistry GstRegistry;
40 typedef struct _GstRegistryClass GstRegistryClass;
41
42 struct _GstRegistry {
43   GstObject      object;
44
45   GList         *plugins;
46   GList *features;
47
48   GList         *paths;
49
50   /* FIXME move elsewhere */
51   FILE          *cache_file;
52
53   gpointer _gst_reserved[GST_PADDING];
54 };
55
56 struct _GstRegistryClass {
57   GstObjectClass        parent_class;
58
59   /* signals */
60   void                  (*plugin_added)         (GstRegistry *registry, GstPlugin *plugin);
61   void                  (*feature_added)        (GstRegistry *registry, GstPluginFeature *feature);
62
63   gpointer _gst_reserved[GST_PADDING];
64 };
65
66
67 /* normal GObject stuff */
68 GType                   gst_registry_get_type           (void);
69
70 GstRegistry *           gst_registry_get_default        (void);
71
72 void                    gst_registry_scan_path          (GstRegistry *registry, const gchar *path);
73 GList*                  gst_registry_get_path_list      (GstRegistry *registry);
74
75 gboolean                gst_registry_add_plugin         (GstRegistry *registry, GstPlugin *plugin);
76 void                    gst_registry_remove_plugin      (GstRegistry *registry, GstPlugin *plugin);
77 gboolean                gst_registry_add_feature        (GstRegistry * registry, GstPluginFeature * feature);
78 void                    gst_registry_remove_feature     (GstRegistry * registry, GstPluginFeature * feature);
79
80 GList*                  gst_registry_get_plugin_list    (GstRegistry *registry);
81 GList*                  gst_registry_plugin_filter      (GstRegistry *registry, 
82                                                          GstPluginFilter filter, 
83                                                          gboolean first, 
84                                                          gpointer user_data);
85 GList*                  gst_registry_feature_filter     (GstRegistry *registry, 
86                                                          GstPluginFeatureFilter filter, 
87                                                          gboolean first,
88                                                          gpointer user_data);
89 GList *                 gst_registry_get_feature_list   (GstRegistry *registry,
90                                                          GType type);
91 GList *                 gst_registry_get_feature_list_by_plugin (GstRegistry *registry, const gchar *name);
92
93 GstPlugin*              gst_registry_find_plugin        (GstRegistry *registry, const gchar *name);
94 GstPluginFeature*       gst_registry_find_feature       (GstRegistry *registry, const gchar *name, GType type);
95
96 GstPlugin *             gst_registry_lookup             (GstRegistry *registry, const char *filename);
97 GstPluginFeature *      gst_registry_lookup_feature     (GstRegistry *registry, const char *name);
98
99 gboolean                gst_registry_xml_read_cache     (GstRegistry * registry, const char *location);
100 gboolean                gst_registry_xml_write_cache    (GstRegistry * registry, const char *location);
101
102 void                    gst_registry_scan_paths         (GstRegistry *registry);
103 void                    _gst_registry_remove_cache_plugins (GstRegistry *registry);
104
105 void                    _gst_registry_cleanup           (void);
106
107 #define gst_default_registry_add_plugin(plugin) \
108   gst_registry_add_plugin (gst_registry_get_default(), plugin)
109 #define gst_default_registry_add_path(path) \
110   gst_registry_add_path (gst_registry_get_default(), path)
111 #define gst_default_registry_get_path_list() \
112   gst_registry_get_path_list (gst_registry_get_default())
113 #define gst_default_registry_get_plugin_list() \
114   gst_registry_get_plugin_list (gst_registry_get_default())
115 #define gst_default_registry_find_feature(name,type) \
116   gst_registry_find_feature (gst_registry_get_default(),name,type)
117 #define gst_default_registry_find_plugin(name) \
118   gst_registry_find_plugin (gst_registry_get_default(),name)
119 #define gst_default_registry_feature_filter(filter,first,user_data) \
120   gst_registry_feature_filter (gst_registry_get_default(),filter,first,user_data)
121
122 G_END_DECLS
123
124 #endif /* __GST_REGISTRY_H__ */
125