1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
/* 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__
#include <stdio.h> /* FIXME: because of cache_file below */
#include <gst/gstconfig.h>
#include <gst/gstplugin.h>
#include <gst/gstpluginfeature.h>
G_BEGIN_DECLS
#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))
typedef struct _GstRegistry GstRegistry;
typedef struct _GstRegistryClass GstRegistryClass;
/**
* GstRegistry:
*
* Opaque #GstRegistry structure.
*/
struct _GstRegistry {
GstObject object;
/*< private >*/
/* FIXME: shouldn't we use GTree for these to speedup
* gst_registry_lookup_feature_locked(), gst_registry_lookup_locked()
*/
GList *plugins;
GList *features;
GList *paths;
/* FIXME move these elsewhere */
int cache_file;
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
struct _GstRegistryClass {
GstObjectClass parent_class;
/* signals */
void (*plugin_added) (GstRegistry *registry, GstPlugin *plugin);
void (*feature_added) (GstRegistry *registry, GstPluginFeature *feature);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
};
/* normal GObject stuff */
GType gst_registry_get_type (void);
GstRegistry * gst_registry_get_default (void);
gboolean gst_registry_scan_path (GstRegistry *registry, const gchar *path);
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);
gboolean gst_registry_add_feature (GstRegistry * registry, GstPluginFeature * feature);
void gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature);
GList* gst_registry_get_plugin_list (GstRegistry *registry);
GList* gst_registry_plugin_filter (GstRegistry *registry,
GstPluginFilter filter,
gboolean first,
gpointer user_data);
GList* gst_registry_feature_filter (GstRegistry *registry,
GstPluginFeatureFilter filter,
gboolean first,
gpointer user_data);
GList * gst_registry_get_feature_list (GstRegistry *registry,
GType type);
GList * gst_registry_get_feature_list_by_plugin (GstRegistry *registry, const gchar *name);
GstPlugin* gst_registry_find_plugin (GstRegistry *registry, const gchar *name);
GstPluginFeature* gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type);
GstPlugin * gst_registry_lookup (GstRegistry *registry, const char *filename);
GstPluginFeature * gst_registry_lookup_feature (GstRegistry *registry, const char *name);
#ifdef USE_BINARY_REGISTRY
gboolean gst_registry_binary_read_cache (GstRegistry * registry, const char *location);
gboolean gst_registry_binary_write_cache (GstRegistry * registry, const char *location);
#else
gboolean gst_registry_xml_read_cache (GstRegistry * registry, const char *location);
gboolean gst_registry_xml_write_cache (GstRegistry * registry, const char *location);
#endif
/* 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.
*/
#define gst_default_registry_add_plugin(plugin) \
gst_registry_add_plugin (gst_registry_get_default(), plugin)
/**
* 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.
*/
#define gst_default_registry_add_path(path) \
gst_registry_add_path (gst_registry_get_default(), path)
/**
* 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.
*/
#define gst_default_registry_get_path_list() \
gst_registry_get_path_list (gst_registry_get_default())
/**
* 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.
*/
#define gst_default_registry_get_plugin_list() \
gst_registry_get_plugin_list (gst_registry_get_default())
/**
* 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.
*/
#define gst_default_registry_find_feature(name,type) \
gst_registry_find_feature (gst_registry_get_default(),name,type)
/**
* 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.
*/
#define gst_default_registry_find_plugin(name) \
gst_registry_find_plugin (gst_registry_get_default(),name)
/**
* 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.
*/
#define gst_default_registry_feature_filter(filter,first,user_data) \
gst_registry_feature_filter (gst_registry_get_default(),filter,first,user_data)
gboolean gst_default_registry_check_feature_version (const gchar *feature_name,
guint min_major,
guint min_minor,
guint min_micro);
G_END_DECLS
#endif /* __GST_REGISTRY_H__ */
|