423e937540aa5c944f9b53da669142e0c1828137
1 /* GStreamer
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
4 *
5 * gst_private.h: Private header for within libgst
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 */
23 #ifndef __GST_PRIVATE_H__
24 #define __GST_PRIVATE_H__
26 #ifdef HAVE_CONFIG_H
27 # ifndef GST_LICENSE /* don't include config.h twice, it has no guards */
28 # include "config.h"
29 # endif
30 #endif
32 /* This needs to be before glib.h, since it might be used in inline
33 * functions */
34 extern const char g_log_domain_gstreamer[];
36 #include <glib.h>
38 #include <stdlib.h>
39 #include <string.h>
41 /* Needed for GstRegistry * */
42 #include "gstregistry.h"
43 #include "gststructure.h"
45 /* we need this in pretty much all files */
46 #include "gstinfo.h"
48 /* for the flags in the GstPluginDep structure below */
49 #include "gstplugin.h"
51 G_BEGIN_DECLS
53 /* used by gstparse.c and grammar.y */
54 struct _GstParseContext {
55 GList * missing_elements;
56 };
58 /* used by gstplugin.c and gstregistrybinary.c */
59 typedef struct {
60 /* details registered via gst_plugin_add_dependency() */
61 GstPluginDependencyFlags flags;
62 gchar **env_vars;
63 gchar **paths;
64 gchar **names;
66 /* information saved from the last time the plugin was loaded (-1 = unset) */
67 guint env_hash; /* hash of content of environment variables in env_vars */
68 guint stat_hash; /* hash of stat() on all relevant files and directories */
69 } GstPluginDep;
71 struct _GstPluginPrivate {
72 GList *deps; /* list of GstPluginDep structures */
73 GstStructure *cache_data;
74 };
76 gboolean _priv_plugin_deps_env_vars_changed (GstPlugin * plugin);
77 gboolean _priv_plugin_deps_files_changed (GstPlugin * plugin);
79 gboolean _priv_gst_in_valgrind (void);
81 /* Initialize GStreamer private quark storage */
82 void _priv_gst_quarks_initialize (void);
84 /* Other init functions called from gst_init().
85 * FIXME 0.11: rename to _priv_gst_foo_init() so they don't get exported
86 * (can't do this now because these functions used to be in our public
87 * headers, so at least the symbols need to continue to be available unless
88 * we want enterprise edition packagers dancing on our heads) */
89 void _gst_buffer_initialize (void);
90 void _gst_buffer_list_initialize (void);
91 void _gst_event_initialize (void);
92 void _gst_format_initialize (void);
93 void _gst_message_initialize (void);
94 void _gst_plugin_initialize (void);
95 void _gst_query_initialize (void);
96 void _gst_tag_initialize (void);
97 void _gst_value_initialize (void);
99 /* Private registry functions */
100 gboolean _priv_gst_registry_remove_cache_plugins (GstRegistry *registry);
101 void _priv_gst_registry_cleanup (void);
102 gboolean _gst_plugin_loader_client_run (void);
104 /* used in both gststructure.c and gstcaps.c; numbers are completely made up */
105 #define STRUCTURE_ESTIMATED_STRING_LEN(s) (16 + (s)->fields->len * 22)
107 gboolean priv_gst_structure_append_to_gstring (const GstStructure * structure,
108 GString * s);
109 /* registry cache backends */
110 /* FIXME 0.11: use priv_ prefix */
111 gboolean gst_registry_binary_read_cache (GstRegistry * registry, const char *location);
112 gboolean gst_registry_binary_write_cache (GstRegistry * registry, const char *location);
115 /* used in gstvalue.c and gststructure.c */
116 #define GST_ASCII_IS_STRING(c) (g_ascii_isalnum((c)) || ((c) == '_') || \
117 ((c) == '-') || ((c) == '+') || ((c) == '/') || ((c) == ':') || \
118 ((c) == '.'))
120 #ifndef GST_DISABLE_REGISTRY
121 /* Secret variable to initialise gst without registry cache */
122 extern gboolean _gst_disable_registry_cache;
123 #endif
125 /* provide inline gst_g_value_get_foo_unchecked(), used in gststructure.c */
126 #define DEFINE_INLINE_G_VALUE_GET_UNCHECKED(ret_type,name_type,v_field) \
127 static inline ret_type \
128 gst_g_value_get_##name_type##_unchecked (const GValue *value) \
129 { \
130 return value->data[0].v_field; \
131 }
133 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gboolean,boolean,v_int)
134 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint,int,v_int)
135 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint,uint,v_uint)
136 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gint64,int64,v_int64)
137 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(guint64,uint64,v_uint64)
138 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gfloat,float,v_float)
139 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(gdouble,double,v_double)
140 DEFINE_INLINE_G_VALUE_GET_UNCHECKED(const gchar *,string,v_pointer)
143 /*** debugging categories *****************************************************/
145 #ifndef GST_REMOVE_GST_DEBUG
147 GST_EXPORT GstDebugCategory *GST_CAT_GST_INIT;
148 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG; /* FIXME 0.11: remove? */
149 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT; /* FIXME 0.11: remove? */
150 GST_EXPORT GstDebugCategory *GST_CAT_PARENTAGE;
151 GST_EXPORT GstDebugCategory *GST_CAT_STATES;
152 GST_EXPORT GstDebugCategory *GST_CAT_SCHEDULING;
153 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER;
154 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER_LIST;
155 GST_EXPORT GstDebugCategory *GST_CAT_BUS;
156 GST_EXPORT GstDebugCategory *GST_CAT_CAPS;
157 GST_EXPORT GstDebugCategory *GST_CAT_CLOCK;
158 GST_EXPORT GstDebugCategory *GST_CAT_ELEMENT_PADS;
159 GST_EXPORT GstDebugCategory *GST_CAT_PADS;
160 GST_EXPORT GstDebugCategory *GST_CAT_PERFORMANCE;
161 GST_EXPORT GstDebugCategory *GST_CAT_PIPELINE;
162 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_LOADING;
163 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_INFO;
164 GST_EXPORT GstDebugCategory *GST_CAT_PROPERTIES;
165 GST_EXPORT GstDebugCategory *GST_CAT_XML;
166 GST_EXPORT GstDebugCategory *GST_CAT_NEGOTIATION;
167 GST_EXPORT GstDebugCategory *GST_CAT_REFCOUNTING;
168 GST_EXPORT GstDebugCategory *GST_CAT_ERROR_SYSTEM;
169 GST_EXPORT GstDebugCategory *GST_CAT_EVENT;
170 GST_EXPORT GstDebugCategory *GST_CAT_MESSAGE;
171 GST_EXPORT GstDebugCategory *GST_CAT_PARAMS;
172 GST_EXPORT GstDebugCategory *GST_CAT_CALL_TRACE;
173 GST_EXPORT GstDebugCategory *GST_CAT_SIGNAL;
174 GST_EXPORT GstDebugCategory *GST_CAT_PROBE;
175 GST_EXPORT GstDebugCategory *GST_CAT_REGISTRY;
176 GST_EXPORT GstDebugCategory *GST_CAT_QOS;
177 GST_EXPORT GstDebugCategory *GST_CAT_TYPES; /* FIXME 0.11: remove? */
179 /* Categories that should be completely private to
180 * libgstreamer should be done like this: */
181 #define GST_CAT_POLL _priv_GST_CAT_POLL
182 extern GstDebugCategory *_priv_GST_CAT_POLL;
184 #else
186 #define GST_CAT_GST_INIT NULL
187 #define GST_CAT_AUTOPLUG NULL
188 #define GST_CAT_AUTOPLUG_ATTEMPT NULL
189 #define GST_CAT_PARENTAGE NULL
190 #define GST_CAT_STATES NULL
191 #define GST_CAT_SCHEDULING NULL
192 #define GST_CAT_DATAFLOW NULL
193 #define GST_CAT_BUFFER NULL
194 #define GST_CAT_BUFFER_LIST NULL
195 #define GST_CAT_BUS NULL
196 #define GST_CAT_CAPS NULL
197 #define GST_CAT_CLOCK NULL
198 #define GST_CAT_ELEMENT_PADS NULL
199 #define GST_CAT_PADS NULL
200 #define GST_CAT_PERFORMANCE NULL
201 #define GST_CAT_PIPELINE NULL
202 #define GST_CAT_PLUGIN_LOADING NULL
203 #define GST_CAT_PLUGIN_INFO NULL
204 #define GST_CAT_PROPERTIES NULL
205 #define GST_CAT_XML NULL
206 #define GST_CAT_NEGOTIATION NULL
207 #define GST_CAT_REFCOUNTING NULL
208 #define GST_CAT_ERROR_SYSTEM NULL
209 #define GST_CAT_EVENT NULL
210 #define GST_CAT_MESSAGE NULL
211 #define GST_CAT_PARAMS NULL
212 #define GST_CAT_CALL_TRACE NULL
213 #define GST_CAT_SIGNAL NULL
214 #define GST_CAT_PROBE NULL
215 #define GST_CAT_REGISTRY NULL
216 #define GST_CAT_QOS NULL
217 #define GST_CAT_TYPES NULL
218 #define GST_CAT_POLL NULL
220 #endif
222 G_END_DECLS
223 #endif /* __GST_PRIVATE_H__ */