source: trunk/third/gstreamer/gst/gstregistry.h @ 21448

Revision 21448, 5.7 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21447, which included commits to RCS files with non-trunk default branches.
Line 
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
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"
32
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"
36
37/* compatibility for pre-POSIX defines */
38#ifdef S_IRUSR
39#if defined(_WIN32) && defined(__MINGW32__)
40#define REGISTRY_DIR_PERMS (S_ISGID | \
41                            S_IRUSR | S_IWUSR | S_IXUSR)
42#else
43#define REGISTRY_DIR_PERMS (S_ISGID | \
44                            S_IRUSR | S_IWUSR | S_IXUSR | \
45                            S_IRGRP | S_IXGRP | \
46                            S_IROTH | S_IXOTH)
47#endif
48#define REGISTRY_TMPFILE_PERMS (S_IRUSR | S_IWUSR)
49#if defined(_WIN32) && defined(__MINGW32__)
50#define REGISTRY_FILE_PERMS (S_IRUSR | S_IWUSR
51#else
52#define REGISTRY_FILE_PERMS (S_IRUSR | S_IWUSR | \
53                             S_IRGRP | S_IWGRP | \
54                             S_IROTH | S_IWOTH)
55#endif
56#else
57#define REGISTRY_DIR_PERMS (S_ISGID | \
58                            S_IREAD | S_IWRITE | S_IEXEC)
59#define REGISTRY_TMPFILE_PERMS (S_IREAD | S_IWRITE)
60#define REGISTRY_FILE_PERMS (S_IREAD | S_IWRITE)
61#endif
62
63G_BEGIN_DECLS
64
65typedef enum {
66  GST_REGISTRY_OK                       = (0),
67  GST_REGISTRY_LOAD_ERROR               = (1 << 1),
68  GST_REGISTRY_SAVE_ERROR               = (1 << 2),
69  GST_REGISTRY_PLUGIN_LOAD_ERROR        = (1 << 3),
70  GST_REGISTRY_PLUGIN_SIGNATURE_ERROR   = (1 << 4)
71} GstRegistryReturn;
72
73typedef enum {
74  GST_REGISTRY_READABLE                 = (1 << 1),
75  GST_REGISTRY_WRITABLE                 = (1 << 2),
76  GST_REGISTRY_EXISTS                   = (1 << 3),
77  GST_REGISTRY_REMOTE                   = (1 << 4),
78  GST_REGISTRY_DELAYED_LOADING          = (1 << 5)
79} GstRegistryFlags;
80
81 
82#define GST_TYPE_REGISTRY               (gst_registry_get_type ())
83#define GST_REGISTRY(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_REGISTRY, GstRegistry))
84#define GST_IS_REGISTRY(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_REGISTRY))
85#define GST_REGISTRY_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_REGISTRY, GstRegistryClass))
86#define GST_IS_REGISTRY_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_REGISTRY))
87#define GST_REGISTRY_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_REGISTRY, GstRegistryClass))
88
89typedef struct _GstRegistry GstRegistry;
90typedef struct _GstRegistryClass GstRegistryClass;
91
92struct _GstRegistry {
93  GObject        object;
94
95  gint           priority;
96  GstRegistryFlags flags;
97
98  gchar         *name;
99  gchar         *details;
100
101  gboolean       loaded;
102  GList         *plugins;
103
104  GList         *paths;
105
106  gpointer _gst_reserved[GST_PADDING];
107};
108
109struct _GstRegistryClass {
110  GObjectClass          parent_class;
111
112  /* vtable */
113  gboolean              (*load)                 (GstRegistry *registry);
114  gboolean              (*save)                 (GstRegistry *registry);
115  gboolean              (*rebuild)              (GstRegistry *registry);
116  gboolean              (*unload)               (GstRegistry *registry);
117
118  GstRegistryReturn     (*load_plugin)          (GstRegistry *registry, GstPlugin *plugin);
119  GstRegistryReturn     (*unload_plugin)        (GstRegistry *registry, GstPlugin *plugin);
120  GstRegistryReturn     (*update_plugin)        (GstRegistry *registry, GstPlugin *plugin);
121
122  /* signals */
123  void                  (*plugin_added)         (GstRegistry *registry, GstPlugin *plugin);
124
125  gpointer _gst_reserved[GST_PADDING];
126};
127
128
129/* normal GObject stuff */
130GType                   gst_registry_get_type           (void);
131
132gboolean                gst_registry_load               (GstRegistry *registry);
133gboolean                gst_registry_is_loaded          (GstRegistry *registry);
134gboolean                gst_registry_save               (GstRegistry *registry);
135gboolean                gst_registry_rebuild            (GstRegistry *registry);
136gboolean                gst_registry_unload             (GstRegistry *registry);
137
138void                    gst_registry_add_path           (GstRegistry *registry, const gchar *path);
139GList*                  gst_registry_get_path_list      (GstRegistry *registry);
140void                    gst_registry_clear_paths        (GstRegistry *registry);
141
142gboolean                gst_registry_add_plugin         (GstRegistry *registry, GstPlugin *plugin);
143void                    gst_registry_remove_plugin      (GstRegistry *registry, GstPlugin *plugin);
144
145GList*                  gst_registry_plugin_filter      (GstRegistry *registry,
146                                                         GstPluginFilter filter,
147                                                         gboolean first,
148                                                         gpointer user_data);
149GList*                  gst_registry_feature_filter     (GstRegistry *registry,
150                                                         GstPluginFeatureFilter filter,
151                                                         gboolean first,
152                                                         gpointer user_data);
153
154GstPlugin*              gst_registry_find_plugin        (GstRegistry *registry, const gchar *name);
155GstPluginFeature*       gst_registry_find_feature       (GstRegistry *registry, const gchar *name, GType type);
156
157GstRegistryReturn       gst_registry_load_plugin        (GstRegistry *registry, GstPlugin *plugin);
158GstRegistryReturn       gst_registry_unload_plugin      (GstRegistry *registry, GstPlugin *plugin);
159GstRegistryReturn       gst_registry_update_plugin      (GstRegistry *registry, GstPlugin *plugin);
160
161G_END_DECLS
162
163#endif /* __GST_REGISTRY_H__ */
Note: See TracBrowser for help on using the repository browser.