2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gst_private.h: Private header for within libgst
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.
23 #ifndef __GST_PRIVATE_H__
24 #define __GST_PRIVATE_H__
27 # ifndef GST_LICENSE /* don't include config.h twice, it has no guards */
32 /* This needs to be before glib.h, since it might be used in inline
34 extern const char g_log_domain_gstreamer[];
41 /* Needed for GstRegistry * */
42 #include "gstregistry.h"
43 #include "gststructure.h"
45 /* we need this in pretty much all files */
48 /* for the flags in the GstPluginDep structure below */
49 #include "gstplugin.h"
51 /* for the pad cache */
55 #include "gstelement.h"
62 /* used by gstparse.c and grammar.y */
63 struct _GstParseContext {
64 GList * missing_elements;
67 /* used by gstplugin.c and gstregistrybinary.c */
69 /* details registered via gst_plugin_add_dependency() */
70 GstPluginDependencyFlags flags;
75 /* information saved from the last time the plugin was loaded (-1 = unset) */
76 guint env_hash; /* hash of content of environment variables in env_vars */
77 guint stat_hash; /* hash of stat() on all relevant files and directories */
80 struct _GstPluginPrivate {
81 GList *deps; /* list of GstPluginDep structures */
82 GstStructure *cache_data;
85 gboolean priv_gst_plugin_loading_have_whitelist (void);
87 guint32 priv_gst_plugin_loading_get_whitelist_hash (void);
89 gboolean priv_gst_plugin_desc_is_whitelisted (GstPluginDesc * desc,
90 const gchar * filename);
92 gboolean _priv_plugin_deps_env_vars_changed (GstPlugin * plugin);
93 gboolean _priv_plugin_deps_files_changed (GstPlugin * plugin);
95 gboolean _priv_gst_in_valgrind (void);
97 /* Initialize GStreamer private quark storage */
98 void _priv_gst_quarks_initialize (void);
100 /* Other init functions called from gst_init().
101 * FIXME 0.11: rename to _priv_gst_foo_init() so they don't get exported
102 * (can't do this now because these functions used to be in our public
103 * headers, so at least the symbols need to continue to be available unless
104 * we want enterprise edition packagers dancing on our heads) */
105 void _gst_buffer_initialize (void);
106 void _gst_buffer_list_initialize (void);
107 void _gst_event_initialize (void);
108 void _gst_format_initialize (void);
109 void _gst_message_initialize (void);
110 void _gst_plugin_initialize (void);
111 void _gst_query_initialize (void);
112 void _gst_tag_initialize (void);
113 void _gst_value_initialize (void);
115 void priv_gst_toc_initialize (void);
118 /* These functions are used to parse TOC messages, events and queries */
119 GstToc* priv_gst_toc_from_structure (const GstStructure *toc);
120 GstStructure* priv_gst_toc_to_structure (const GstToc *toc);
121 gboolean priv_gst_toc_structure_get_updated (const GstStructure * toc);
122 void priv_gst_toc_structure_set_updated (GstStructure * toc, gboolean updated);
123 gchar* priv_gst_toc_structure_get_extend_uid (const GstStructure * toc);
124 void priv_gst_toc_structure_set_extend_uid (GstStructure * toc, const gchar * extend_uid);
126 /* Private registry functions */
127 gboolean _priv_gst_registry_remove_cache_plugins (GstRegistry *registry);
128 void _priv_gst_registry_cleanup (void);
129 gboolean _gst_plugin_loader_client_run (void);
131 void _priv_gst_pad_invalidate_cache (GstPad *pad);
133 /* Used in GstBin for manual state handling */
134 void _priv_gst_element_state_changed (GstElement *element, GstState oldstate,
135 GstState newstate, GstState pending);
137 /* used in both gststructure.c and gstcaps.c; numbers are completely made up */
138 #define STRUCTURE_ESTIMATED_STRING_LEN(s) (16 + (s)->fields->len * 22)
140 gboolean priv_gst_structure_append_to_gstring (const GstStructure * structure,
142 /* registry cache backends */
143 /* FIXME 0.11: use priv_ prefix */
144 gboolean gst_registry_binary_read_cache (GstRegistry * registry, const char *location);
145 gboolean gst_registry_binary_write_cache (GstRegistry * registry, const char *location);
148 /* used in gstvalue.c and gststructure.c */
149 #define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
150 ((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
153 /* This is only meant for internal uses */
154 gint priv_gst_date_time_compare (gconstpointer dt1, gconstpointer dt2);
156 #ifndef GST_DISABLE_REGISTRY
157 /* Secret variable to initialise gst without registry cache */
158 GST_EXPORT gboolean _gst_disable_registry_cache;
161 /* provide inline gst_g_value_get_foo_unchecked(), used in gststructure.c */
162 #define DEFINE_INLINE_G_VALUE_GET_UNCHECKED(ret_type,name_type,v_field) \
163 static inline ret_type \
164 gst_g_value_get_##name_type##_unchecked (const GValue *value) \
166 return value->data[0].v_field; \
169 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gboolean,boolean,v_int)
170 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint,int,v_int)
171 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint,uint,v_uint)
172 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint64,int64,v_int64)
173 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint64,uint64,v_uint64)
174 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gfloat,float,v_float)
175 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gdouble,double,v_double)
176 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(const gchar *,string,v_pointer)
179 /*** debugging categories *****************************************************/
181 #ifndef GST_REMOVE_GST_DEBUG
183 GST_EXPORT GstDebugCategory *GST_CAT_GST_INIT;
184 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG; /* FIXME 0.11: remove? */
185 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT; /* FIXME 0.11: remove? */
186 GST_EXPORT GstDebugCategory *GST_CAT_PARENTAGE;
187 GST_EXPORT GstDebugCategory *GST_CAT_STATES;
188 GST_EXPORT GstDebugCategory *GST_CAT_SCHEDULING;
189 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER;
190 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER_LIST;
191 GST_EXPORT GstDebugCategory *GST_CAT_BUS;
192 GST_EXPORT GstDebugCategory *GST_CAT_CAPS;
193 GST_EXPORT GstDebugCategory *GST_CAT_CLOCK;
194 GST_EXPORT GstDebugCategory *GST_CAT_ELEMENT_PADS;
195 GST_EXPORT GstDebugCategory *GST_CAT_PADS;
196 GST_EXPORT GstDebugCategory *GST_CAT_PERFORMANCE;
197 GST_EXPORT GstDebugCategory *GST_CAT_PIPELINE;
198 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_LOADING;
199 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_INFO;
200 GST_EXPORT GstDebugCategory *GST_CAT_PROPERTIES;
201 GST_EXPORT GstDebugCategory *GST_CAT_XML;
202 GST_EXPORT GstDebugCategory *GST_CAT_NEGOTIATION;
203 GST_EXPORT GstDebugCategory *GST_CAT_REFCOUNTING;
204 GST_EXPORT GstDebugCategory *GST_CAT_ERROR_SYSTEM;
205 GST_EXPORT GstDebugCategory *GST_CAT_EVENT;
206 GST_EXPORT GstDebugCategory *GST_CAT_MESSAGE;
207 GST_EXPORT GstDebugCategory *GST_CAT_PARAMS;
208 GST_EXPORT GstDebugCategory *GST_CAT_CALL_TRACE;
209 GST_EXPORT GstDebugCategory *GST_CAT_SIGNAL;
210 GST_EXPORT GstDebugCategory *GST_CAT_PROBE;
211 GST_EXPORT GstDebugCategory *GST_CAT_REGISTRY;
212 GST_EXPORT GstDebugCategory *GST_CAT_QOS;
213 GST_EXPORT GstDebugCategory *GST_CAT_TYPES; /* FIXME 0.11: remove? */
215 /* Categories that should be completely private to
216 * libgstreamer should be done like this: */
217 #define GST_CAT_POLL _priv_GST_CAT_POLL
218 extern GstDebugCategory *_priv_GST_CAT_POLL;
222 #define GST_CAT_GST_INIT NULL
223 #define GST_CAT_AUTOPLUG NULL
224 #define GST_CAT_AUTOPLUG_ATTEMPT NULL
225 #define GST_CAT_PARENTAGE NULL
226 #define GST_CAT_STATES NULL
227 #define GST_CAT_SCHEDULING NULL
228 #define GST_CAT_DATAFLOW NULL
229 #define GST_CAT_BUFFER NULL
230 #define GST_CAT_BUFFER_LIST NULL
231 #define GST_CAT_BUS NULL
232 #define GST_CAT_CAPS NULL
233 #define GST_CAT_CLOCK NULL
234 #define GST_CAT_ELEMENT_PADS NULL
235 #define GST_CAT_PADS NULL
236 #define GST_CAT_PERFORMANCE NULL
237 #define GST_CAT_PIPELINE NULL
238 #define GST_CAT_PLUGIN_LOADING NULL
239 #define GST_CAT_PLUGIN_INFO NULL
240 #define GST_CAT_PROPERTIES NULL
241 #define GST_CAT_XML NULL
242 #define GST_CAT_NEGOTIATION NULL
243 #define GST_CAT_REFCOUNTING NULL
244 #define GST_CAT_ERROR_SYSTEM NULL
245 #define GST_CAT_EVENT NULL
246 #define GST_CAT_MESSAGE NULL
247 #define GST_CAT_PARAMS NULL
248 #define GST_CAT_CALL_TRACE NULL
249 #define GST_CAT_SIGNAL NULL
250 #define GST_CAT_PROBE NULL
251 #define GST_CAT_REGISTRY NULL
252 #define GST_CAT_QOS NULL
253 #define GST_CAT_TYPES NULL
254 #define GST_CAT_POLL NULL
258 #ifdef GST_DISABLE_DEPRECATED
259 typedef GList* (*GstPadIntLinkFunction) (GstPad *pad);
264 #endif /* __GST_PRIVATE_H__ */