gst: Add debugging category GST_POLL for gstpoll
[platform/upstream/gstreamer.git] / gst / gst_private.h
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  */
22
23 #ifndef __GST_PRIVATE_H__
24 #define __GST_PRIVATE_H__
25
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
31
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[];
35
36 #include <glib.h>
37
38 #include <stdlib.h>
39 #include <string.h>
40
41 /* Needed for GstRegistry * */
42 #include "gstregistry.h"
43 #include "gststructure.h"
44
45 /* we need this in pretty much all files */
46 #include "gstinfo.h"
47
48 /* for the flags in the GstPluginDep structure below */
49 #include "gstplugin.h"
50
51 G_BEGIN_DECLS
52
53 /* used by gstparse.c and grammar.y */
54 struct _GstParseContext {
55   GList * missing_elements;
56 };
57
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;
65
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;
70
71 struct _GstPluginPrivate {
72   GList *deps;    /* list of GstPluginDep structures */
73   GstStructure *cache_data;
74 };
75
76 gboolean _priv_plugin_deps_env_vars_changed (GstPlugin * plugin);
77 gboolean _priv_plugin_deps_files_changed (GstPlugin * plugin);
78
79 gboolean _priv_gst_in_valgrind (void);
80
81 /* Initialize GStreamer private quark storage */
82 void _priv_gst_quarks_initialize (void);
83
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);
98
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);
103
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)
106
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);
113
114
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) == '.'))
119
120 #ifndef GST_DISABLE_REGISTRY
121 /* Secret variable to initialise gst without registry cache */
122 extern gboolean _gst_disable_registry_cache;
123 #endif
124
125 /*** debugging categories *****************************************************/
126
127 #ifndef GST_REMOVE_GST_DEBUG
128
129 GST_EXPORT GstDebugCategory *GST_CAT_GST_INIT;
130 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG; /* FIXME 0.11: remove? */
131 GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT; /* FIXME 0.11: remove? */
132 GST_EXPORT GstDebugCategory *GST_CAT_PARENTAGE;
133 GST_EXPORT GstDebugCategory *GST_CAT_STATES;
134 GST_EXPORT GstDebugCategory *GST_CAT_SCHEDULING;
135 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER;
136 GST_EXPORT GstDebugCategory *GST_CAT_BUFFER_LIST;
137 GST_EXPORT GstDebugCategory *GST_CAT_BUS;
138 GST_EXPORT GstDebugCategory *GST_CAT_CAPS;
139 GST_EXPORT GstDebugCategory *GST_CAT_CLOCK;
140 GST_EXPORT GstDebugCategory *GST_CAT_ELEMENT_PADS;
141 GST_EXPORT GstDebugCategory *GST_CAT_PADS;
142 GST_EXPORT GstDebugCategory *GST_CAT_PERFORMANCE;
143 GST_EXPORT GstDebugCategory *GST_CAT_PIPELINE;
144 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_LOADING;
145 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_INFO;
146 GST_EXPORT GstDebugCategory *GST_CAT_PROPERTIES;
147 GST_EXPORT GstDebugCategory *GST_CAT_XML;
148 GST_EXPORT GstDebugCategory *GST_CAT_NEGOTIATION;
149 GST_EXPORT GstDebugCategory *GST_CAT_REFCOUNTING;
150 GST_EXPORT GstDebugCategory *GST_CAT_ERROR_SYSTEM;
151 GST_EXPORT GstDebugCategory *GST_CAT_EVENT;
152 GST_EXPORT GstDebugCategory *GST_CAT_MESSAGE;
153 GST_EXPORT GstDebugCategory *GST_CAT_PARAMS;
154 GST_EXPORT GstDebugCategory *GST_CAT_CALL_TRACE;
155 GST_EXPORT GstDebugCategory *GST_CAT_SIGNAL;
156 GST_EXPORT GstDebugCategory *GST_CAT_PROBE;
157 GST_EXPORT GstDebugCategory *GST_CAT_REGISTRY;
158 GST_EXPORT GstDebugCategory *GST_CAT_QOS;
159 GST_EXPORT GstDebugCategory *GST_CAT_TYPES; /* FIXME 0.11: remove? */
160 GST_EXPORT GstDebugCategory *GST_CAT_POLL;
161
162 #else
163
164 #define GST_CAT_GST_INIT         NULL
165 #define GST_CAT_AUTOPLUG         NULL
166 #define GST_CAT_AUTOPLUG_ATTEMPT NULL
167 #define GST_CAT_PARENTAGE        NULL
168 #define GST_CAT_STATES           NULL
169 #define GST_CAT_SCHEDULING       NULL
170 #define GST_CAT_DATAFLOW         NULL
171 #define GST_CAT_BUFFER           NULL
172 #define GST_CAT_BUFFER_LIST      NULL
173 #define GST_CAT_BUS              NULL
174 #define GST_CAT_CAPS             NULL
175 #define GST_CAT_CLOCK            NULL
176 #define GST_CAT_ELEMENT_PADS     NULL
177 #define GST_CAT_PADS             NULL
178 #define GST_CAT_PERFORMANCE      NULL
179 #define GST_CAT_PIPELINE         NULL
180 #define GST_CAT_PLUGIN_LOADING   NULL
181 #define GST_CAT_PLUGIN_INFO      NULL
182 #define GST_CAT_PROPERTIES       NULL
183 #define GST_CAT_XML              NULL
184 #define GST_CAT_NEGOTIATION      NULL
185 #define GST_CAT_REFCOUNTING      NULL
186 #define GST_CAT_ERROR_SYSTEM     NULL
187 #define GST_CAT_EVENT            NULL
188 #define GST_CAT_MESSAGE          NULL
189 #define GST_CAT_PARAMS           NULL
190 #define GST_CAT_CALL_TRACE       NULL
191 #define GST_CAT_SIGNAL           NULL
192 #define GST_CAT_PROBE            NULL
193 #define GST_CAT_REGISTRY         NULL
194 #define GST_CAT_QOS              NULL
195 #define GST_CAT_TYPES            NULL
196 #define GST_CAT_POLL             NULL
197
198 #endif
199
200 G_END_DECLS
201 #endif /* __GST_PRIVATE_H__ */