summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2003-02-10 20:32:32 +0000
committerWim Taymans <wim.taymans@gmail.com>2003-02-10 20:32:32 +0000
commitb030b5cef270a7498c62d734d853012bb84e062b (patch)
tree8363b479c9a9d2860e7ce4945833f28476a3d910
parent136e5d254e37ac2854d396ef724d1f1344fe7134 (diff)
- Add more --disable options
Original commit message from CVS: - Add more --disable options - fix makefiles to only compile non-disabled features - some compile fixes. - removed extratypes, added gsturitype - make get/set clock on a bin overridable - some portability fixes for GUINT64 - separate pools from gstregistry.[ch] into gstregistrypool.[ch] - make gstobject size fixed, even if we disabled load/save - don't use 'new' as a variable as it is not a valib C++ variable
-rw-r--r--configure.ac8
-rw-r--r--docs/random/wtay/strip_down18
-rw-r--r--examples/Makefile.am10
-rw-r--r--examples/launch/mp3parselaunch.c1
-rw-r--r--examples/manual/Makefile.am14
-rw-r--r--examples/thread/thread.c1
-rw-r--r--gst/Makefile.am72
-rw-r--r--gst/gst.c116
-rw-r--r--gst/gst.h3
-rw-r--r--gst/gstbin.c37
-rw-r--r--gst/gstbuffer.c26
-rw-r--r--gst/gstcaps.c14
-rw-r--r--gst/gstclock.c32
-rw-r--r--gst/gstelement.c3
-rw-r--r--gst/gstelement.h1
-rw-r--r--gst/gstelementfactory.c2
-rw-r--r--gst/gstevent.c15
-rw-r--r--gst/gstobject.h17
-rw-r--r--gst/gstpad.h2
-rw-r--r--gst/gstplugin.c2
-rw-r--r--gst/gstpluginfeature.c2
-rw-r--r--gst/gstprops.c17
-rw-r--r--gst/gstregistry.c305
-rw-r--r--gst/gstregistry.h17
-rw-r--r--gst/gstregistrypool.c296
-rw-r--r--gst/gstregistrypool.h48
-rw-r--r--gst/gstscheduler.c17
-rw-r--r--gst/gsttrace.c3
-rw-r--r--gst/gsttrace.h16
-rw-r--r--gst/gsttype.c2
-rw-r--r--gst/gstutils.c5
-rw-r--r--libs/gst/bytestream/bstest.c1
-rw-r--r--tests/old/examples/Makefile.am10
-rw-r--r--tests/old/examples/launch/mp3parselaunch.c1
-rw-r--r--tests/old/examples/manual/Makefile.am14
-rw-r--r--tests/old/examples/thread/thread.c1
-rw-r--r--tools/Makefile.am16
-rw-r--r--tools/gst-inspect.c24
-rw-r--r--tools/gst-launch.c10
39 files changed, 767 insertions, 432 deletions
diff --git a/configure.ac b/configure.ac
index 13d7994f9..508b7174b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -327,6 +327,14 @@ translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
+translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, true)
+GST_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
+translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_INDEX, true)
+GST_SUBSYSTEM_DISABLE(INDEX,[index])
+translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PLUGIN, true)
+GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
+translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
+GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
diff --git a/docs/random/wtay/strip_down b/docs/random/wtay/strip_down
index 5c91c572a..a3493ff54 100644
--- a/docs/random/wtay/strip_down
+++ b/docs/random/wtay/strip_down
@@ -4,17 +4,26 @@ Howto strip gstreamer
subsystems that can disabled:
+ * load/save (gstxml.h, various other files)
+ - no object serialisation to XML
+
+ * typefind (gsttypefind.h)
+ - typefind element is not compiled in the core
+
* autoplugging (gstautoplug.h)
- autoplugging functions not available
+ * parse (gstparse.h)
+ - no parsing can be done
+
+ * trace (gsttrace.h)
+ - no tracing features
+
* registry (gstregistry.h)
- can't instantiate registry objects
- registry pool only contains statically
registered plugins
- * typefind (gsttypefind.h)
- - typefind element is not compiled in the core
-
* enumtypes (gstenumtypes.h)
- code not linked into the core
@@ -29,7 +38,4 @@ subsystems that can disabled:
* URI (gsturi.h)
- no urihandler pluginfeature
- * load/save (gstxml.h, various other files)
- - no object serialisation to XML
-
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 858713392..9751930a0 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -4,8 +4,14 @@ else
GST_LOADSAVE_DIRS = xml typefind
endif
-SUBDIRS = autoplug $(GST_LOADSAVE_DIRS) \
- helloworld helloworld2 \
+if GST_DISABLE_AUTOPLUG
+GST_AUTOPLUG_DIRS =
+else
+GST_AUTOPLUG_DIRS = autoplug helloworld2
+endif
+
+SUBDIRS = $(GST_AUTOPLUG_DIRS) $(GST_LOADSAVE_DIRS) \
+ helloworld \
queue queue2 queue3 queue4 \
launch thread plugins mixer cutter pingpong manual
diff --git a/examples/launch/mp3parselaunch.c b/examples/launch/mp3parselaunch.c
index 5489b2652..a0cb19036 100644
--- a/examples/launch/mp3parselaunch.c
+++ b/examples/launch/mp3parselaunch.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <gst/gst.h>
int
diff --git a/examples/manual/Makefile.am b/examples/manual/Makefile.am
index 370d6a6cd..b8da46a2c 100644
--- a/examples/manual/Makefile.am
+++ b/examples/manual/Makefile.am
@@ -4,7 +4,19 @@ else
GNOME=
endif
-EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
+if GST_DISABLE_AUTOPLUG
+GST_AUTOPLUG_SRC =
+else
+GST_AUTOPLUG_SRC = helloworld2
+endif
+
+if GST_DISABLE_LOADSAVE
+GST_LOADSAVE_SRC =
+else
+GST_LOADSAVE_SRC = xml-mp3
+endif
+
+EXAMPLES = dynamic $(GNOME) helloworld $(GST_AUTOPLUG_SRC) queue threads $(GST_LOADSAVE_SRC)
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
diff --git a/examples/thread/thread.c b/examples/thread/thread.c
index 62d4b1071..b16d5aa89 100644
--- a/examples/thread/thread.c
+++ b/examples/thread/thread.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <gst/gst.h>
/* eos will be called when the src element has an end of stream */
diff --git a/gst/Makefile.am b/gst/Makefile.am
index 7150ff935..e6e7e0ebe 100644
--- a/gst/Makefile.am
+++ b/gst/Makefile.am
@@ -21,12 +21,6 @@ else
GST_TYPEFIND_SRC = gsttypefind.c
endif
-if GST_DISABLE_PARSE
-GST_PARSE_SRC =
-else
-GST_PARSE_SRC = gstparse.c
-endif
-
if GST_DISABLE_AUTOPLUG
GST_AUTOPLUG_SRC =
GST_AUTOPLUG_DIRS =
@@ -35,21 +29,67 @@ GST_AUTOPLUG_SRC = gstautoplug.c
GST_AUTOPLUG_DIRS = autoplug
endif
+if GST_DISABLE_PARSE
+GST_PARSE_SRC =
+GST_PARSE_DIRS =
+GST_PARSE_LIBADD =
+else
+GST_PARSE_SRC = gstparse.c
+GST_PARSE_DIRS = parse
+GST_PARSE_LIBADD = parse/libgstparse.la
+endif
+
if GST_DISABLE_TRACE
GST_TRACE_SRC =
else
GST_TRACE_SRC = gsttrace.c
endif
+if GST_DISABLE_REGISTRY
+GST_REGISTRY_SRC =
+GST_REGISTRY_DIRS =
+GST_REGISTRY_LIBADD =
+else
+GST_REGISTRY_SRC = gstregistry.c
+GST_REGISTRY_DIRS = registries
+GST_REGISTRY_LIBADD = registries/libgstxmlregistry.la
+endif
+
+if GST_DISABLE_ENUMTYPES
+GST_ENUMTYPES_SRC =
+else
+GST_ENUMTYPES_SRC = gstenumtypes.c
+endif
+
+if GST_DISABLE_INDEX
+GST_INDEX_SRC =
+GST_INDEX_DIRS =
+else
+GST_INDEX_SRC = gstindex.c
+GST_INDEX_DIRS = indexers
+endif
+
+if GST_DISABLE_PLUGIN
+GST_PLUGIN_SRC =
+else
+GST_PLUGIN_SRC = gstplugin.c
+endif
+
+if GST_DISABLE_URI
+GST_URI_SRC =
+else
+GST_URI_SRC = gsturi.c
+endif
+
EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = gstcpuid_i386.s gstmarshal.list gstxml.c gsttypefind.c gstparse.c gstautoplug.c gsttrace.c
-SUBDIRS = parse registries . $(GST_AUTOPLUG_DIRS) elements schedulers types indexers
+SUBDIRS = $(GST_PARSE_DIRS) $(GST_REGISTRY_DIRS) . $(GST_AUTOPLUG_DIRS) elements schedulers types $(GST_INDEX_DIRS)
DIST_SUBDIRS = autoplug elements parse registries schedulers types indexers
libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gst.c \
gstmarshal.c \
- gstenumtypes.c \
+ $(GST_ENUMTYPES_SRC) \
gstobject.c \
$(GST_AUTOPLUG_SRC) \
gstatomic.c \
@@ -63,9 +103,8 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gstelement.c \
gstelementfactory.c \
gstevent.c \
- gstextratypes.c \
gstformat.c \
- gstindex.c \
+ $(GST_INDEX_SRC) \
gstinfo.c \
gstmemchunk.c \
gstpad.c \
@@ -84,21 +123,23 @@ libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
gsttrashstack.c \
gsttype.c \
$(GST_TYPEFIND_SRC) \
- gsturi.c \
+ $(GST_URI_SRC) \
+ gsturitype.c \
gstutils.c \
- gstregistry.c \
+ $(GST_REGISTRY_SRC) \
+ gstregistrypool.c \
$(GST_PARSE_SRC) \
$(GSTARCH_SRCS) \
$(GST_LOADSAVE_SRC)
-BUILT_SOURCES = gstmarshal.h gstmarshal.c gstenumtypes.h gstenumtypes.c
+BUILT_SOURCES = gstmarshal.h gstmarshal.c gstenumtypes.h $(GST_ENUMTYPES_SRC)
libgstreamer_@GST_MAJORMINOR@_la_CFLAGS = -D_GNU_SOURCE \
$(GST_CFLAGS) \
-DG_LOG_DOMAIN=g_log_domain_gstreamer \
-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
-libgstreamer_@GST_MAJORMINOR@_la_LIBADD = $(LIBGST_LIBS) parse/libgstparse.la registries/libgstxmlregistry.la
+libgstreamer_@GST_MAJORMINOR@_la_LIBADD = $(LIBGST_LIBS) $(GST_PARSE_LIBADD) $(GST_REGISTRY_LIBADD)
libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS = @GST_LT_LDFLAGS@ -version-info @GST_LIBVERSION@
@@ -122,7 +163,6 @@ gst_headers = \
gstdata.h \
gstelement.h \
gstevent.h \
- gstextratypes.h \
gstformat.h \
gstindex.h \
gstinfo.h \
@@ -145,8 +185,10 @@ gst_headers = \
gsttype.h \
gsttypefind.h \
gsturi.h \
+ gsturitype.h \
gstutils.h \
gstregistry.h \
+ gstregistrypool.h \
gstparse.h \
gstxml.h
diff --git a/gst/gst.c b/gst/gst.c
index 5a4ffb421..17748a186 100644
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -27,20 +27,26 @@
#include "gst.h"
#include "gstqueue.h"
-#ifndef GST_DISABLE_TYPE_FIND
+#ifndef GST_DISABLE_TYPEFIND
#include "gsttypefind.h"
-#endif
+#endif /* GST_DISABLE_TYPEFIND */
+#ifndef GST_DISABLE_REGISTRY
#include "registries/gstxmlregistry.h"
+#endif /* GST_DISABLE_REGISTRY */
+#include "gstregistrypool.h"
#define MAX_PATH_SPLIT 16
#define GST_PLUGIN_SEPARATOR ","
gchar *_gst_progname;
+#ifndef GST_DISABLE_REGISTRY
gboolean _gst_registry_auto_load = TRUE;
static GstRegistry *_global_registry;
static GstRegistry *_user_registry;
static gboolean _gst_registry_fixed = FALSE;
+#endif
+
static gboolean _gst_use_threads = TRUE;
static gboolean gst_initialized = FALSE;
@@ -303,6 +309,7 @@ gst_init_with_popt_table (int *argc, char **argv[],
return TRUE;
}
+#ifndef GST_DISABLE_REGISTRY
static void
add_path_func (gpointer data, gpointer user_data)
{
@@ -311,6 +318,7 @@ add_path_func (gpointer data, gpointer user_data)
GST_INFO (GST_CAT_GST_INIT, "Adding plugin path: \"%s\"", (gchar *)data);
gst_registry_add_path (registry, (gchar *)data);
}
+#endif
static void
prepare_for_load_plugin_func (gpointer data, gpointer user_data)
@@ -322,13 +330,21 @@ static void
load_plugin_func (gpointer data, gpointer user_data)
{
gboolean ret;
- //ret = gst_plugin_load ((gchar *)data);
- ret = FALSE;
+ GstPlugin *plugin;
+ const gchar *filename;
+
+ filename = (const gchar *) data;
- if (ret)
- GST_INFO (GST_CAT_GST_INIT, "Loaded plugin: \"%s\"", (gchar *)data);
+ plugin = gst_plugin_new (filename);
+ ret = gst_plugin_load_plugin (plugin, NULL);
+
+ if (ret) {
+ GST_INFO (GST_CAT_GST_INIT, "Loaded plugin: \"%s\"", filename);
+
+ gst_registry_pool_add_plugin (plugin);
+ }
else
- GST_INFO (GST_CAT_GST_INIT, "Failed to load plugin: \"%s\"", (gchar *)data);
+ GST_INFO (GST_CAT_GST_INIT, "Failed to load plugin: \"%s\"", filename);
g_free (data);
}
@@ -372,47 +388,48 @@ split_and_iterate (const gchar *stringlist, gchar *separator, GFunc iterator, gp
static gboolean
init_pre (void)
{
- const gchar *homedir;
- gchar *user_reg;
-
g_type_init ();
- _global_registry = gst_xml_registry_new ("global_registry", GLOBAL_REGISTRY_FILE);
+#ifndef GST_DISABLE_REGISTRY
+ {
+ gchar *user_reg;
+ const gchar *homedir;
+
+ _global_registry = gst_xml_registry_new ("global_registry", GLOBAL_REGISTRY_FILE);
#ifdef PLUGINS_USE_BUILDDIR
- /* location libgstelements.so */
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/libs/gst");
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/elements");
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/types");
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/autoplug");
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/schedulers");
- gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers");
+ /* location libgstelements.so */
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/libs/gst");
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/elements");
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/types");
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/autoplug");
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/schedulers");
+ gst_registry_add_path (_global_registry, PLUGINS_BUILDDIR "/gst/indexers");
#else
- /* add the main (installed) library path */
- gst_registry_add_path (_global_registry, PLUGINS_DIR);
+ /* add the main (installed) library path */
+ gst_registry_add_path (_global_registry, PLUGINS_DIR);
#endif /* PLUGINS_USE_BUILDDIR */
- homedir = g_get_home_dir ();
- user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL);
- _user_registry = gst_xml_registry_new ("user_registry", user_reg);
-
-#ifndef GST_DISABLE_REGISTRY
- /* this test is a hack; gst-register sets this to false
- * so this is a test for the current instance being gst-register */
- if (_gst_registry_auto_load == TRUE)
- {
- /* do a sanity check here; either one of the two registries should exist */
- if (!g_file_test (user_reg, G_FILE_TEST_IS_REGULAR))
- if (!g_file_test (GLOBAL_REGISTRY_FILE, G_FILE_TEST_IS_REGULAR))
- {
- g_print ("Couldn't find user registry %s or global registry %s\n",
- user_reg, GLOBAL_REGISTRY_FILE);
- g_error ("Please run gst-register either as root or user");
+ homedir = g_get_home_dir ();
+ user_reg = g_strjoin ("/", homedir, LOCAL_REGISTRY_FILE, NULL);
+ _user_registry = gst_xml_registry_new ("user_registry", user_reg);
+
+ /* this test is a hack; gst-register sets this to false
+ * so this is a test for the current instance being gst-register */
+ if (_gst_registry_auto_load == TRUE) {
+ /* do a sanity check here; either one of the two registries should exist */
+ if (!g_file_test (user_reg, G_FILE_TEST_IS_REGULAR)) {
+ if (!g_file_test (GLOBAL_REGISTRY_FILE, G_FILE_TEST_IS_REGULAR))
+ {
+ g_print ("Couldn't find user registry %s or global registry %s\n",
+ user_reg, GLOBAL_REGISTRY_FILE);
+ g_error ("Please run gst-register either as root or user");
+ }
}
+ }
+ g_free (user_reg);
}
-#endif
-
- g_free (user_reg);
+#endif /* GST_DISABLE_REGISTRY */
return TRUE;
}
@@ -431,10 +448,10 @@ gst_register_core_elements (GModule *module, GstPlugin *plugin)
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
factory = gst_element_factory_new ("queue", gst_queue_get_type (), &gst_queue_details);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-#ifndef GST_DISABLE_TYPE_FIND
+#ifndef GST_DISABLE_TYPEFIND
factory = gst_element_factory_new ("typefind", gst_type_find_get_type (), &gst_type_find_details);
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-#endif
+#endif /* GST_DISABLE_TYPEFIND */
return TRUE;
}
@@ -464,7 +481,7 @@ init_post (void)
const gchar *plugin_path;
#ifndef GST_DISABLE_TRACE
GstTrace *gst_trace;
-#endif
+#endif /* GST_DISABLE_TRACE */
if (!g_thread_supported ()) {
if (_gst_use_threads)
@@ -493,13 +510,18 @@ init_post (void)
gst_bin_get_type ();
#ifndef GST_DISABLE_AUTOPLUG
gst_autoplug_factory_get_type ();
-#endif
+#endif /* GST_DISABLE_AUTOPLUG */
+#ifndef GST_DISABLE_INDEX
gst_index_factory_get_type ();
+#endif /* GST_DISABLE_INDEX */
+#ifndef GST_DISABLE_URI
gst_uri_handler_get_type ();
-
+#endif /* GST_DISABLE_URI */
plugin_path = g_getenv ("GST_PLUGIN_PATH");
+#ifndef GST_DISABLE_REGISTRY
split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry);
+#endif /* GST_DISABLE_REGISTRY */
/* register core plugins */
_gst_plugin_register_static (&plugin_desc);
@@ -511,6 +533,7 @@ init_post (void)
_gst_event_initialize ();
_gst_buffer_initialize ();
+#ifndef GST_DISABLE_REGISTRY
if (!_gst_registry_fixed) {
/* don't override command-line options */
if (g_getenv ("GST_REGISTRY")) {
@@ -529,6 +552,7 @@ init_post (void)
if (_gst_registry_auto_load) {
gst_registry_pool_load_all ();
}
+#endif /* GST_DISABLE_REGISTRY */
/* if we need to preload plugins */
if (preload_plugins) {
@@ -620,7 +644,9 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
case ARG_PLUGIN_SPEW:
break;
case ARG_PLUGIN_PATH:
+#ifndef GST_DISABLE_REGISTRY
split_and_iterate (arg, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry);
+#endif /* GST_DISABLE_REGISTRY */
break;
case ARG_PLUGIN_LOAD:
split_and_iterate (arg, ",", prepare_for_load_plugin_func, NULL);
@@ -632,8 +658,10 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
gst_use_threads (FALSE);
break;
case ARG_REGISTRY:
+#ifndef GST_DISABLE_REGISTRY
g_object_set (G_OBJECT (_user_registry), "location", arg, NULL);
_gst_registry_fixed = TRUE;
+#endif /* GST_DISABLE_REGISTRY */
break;
default:
g_warning ("option %d not recognized", option->val);
diff --git a/gst/gst.h b/gst/gst.h
index 113ef2a1f..7f8dc8b8c 100644
--- a/gst/gst.h
+++ b/gst/gst.h
@@ -47,6 +47,7 @@
#include <gst/gstprops.h>
#include <gst/gstplugin.h>
#include <gst/gsturi.h>
+#include <gst/gsturitype.h>
#include <gst/gstutils.h>
#include <gst/gsttrace.h>
#include <gst/gstxml.h>
@@ -57,7 +58,7 @@
#include <gst/gstparse.h>
#include <gst/gstregistry.h>
-#include <gst/gstextratypes.h>
+#include <gst/gstregistrypool.h>
#include <gst/gstenumtypes.h>
/* API compatibility stuff */
diff --git a/gst/gstbin.c b/gst/gstbin.c
index a8208df18..37bb8abf4 100644
--- a/gst/gstbin.c
+++ b/gst/gstbin.c
@@ -49,12 +49,17 @@ static void gst_bin_dispose (GObject * object);
static GstElementStateReturn gst_bin_change_state (GstElement *element);
static GstElementStateReturn gst_bin_change_state_norecurse (GstBin *bin);
+#ifndef GST_DISABLE_INDEX
static void gst_bin_set_index (GstElement *element, GstIndex *index);
+#endif
static void gst_bin_add_func (GstBin *bin, GstElement *element);
static void gst_bin_remove_func (GstBin *bin, GstElement *element);
-static gboolean gst_bin_iterate_func (GstBin * bin);
+static GstClock* gst_bin_get_clock_func (GstBin *bin);
+static void gst_bin_set_clock_func (GstBin *bin, GstClock *clock);
+
+static gboolean gst_bin_iterate_func (GstBin *bin);
#ifndef GST_DISABLE_LOADSAVE
static xmlNodePtr gst_bin_save_thyself (GstObject * object, xmlNodePtr parent);
@@ -133,7 +138,11 @@ gst_bin_class_init (GstBinClass * klass)
#endif
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_bin_change_state);
+#ifndef GST_DISABLE_INDEX
gstelement_class->set_index = GST_DEBUG_FUNCPTR (gst_bin_set_index);
+#endif
+ gstelement_class->set_clock = GST_DEBUG_FUNCPTR (gst_bin_set_clock_func);
+ gstelement_class->get_clock = GST_DEBUG_FUNCPTR (gst_bin_get_clock_func);
klass->add_element = GST_DEBUG_FUNCPTR (gst_bin_add_func);
klass->remove_element = GST_DEBUG_FUNCPTR (gst_bin_remove_func);
@@ -169,6 +178,22 @@ gst_bin_new (const gchar * name)
return gst_element_factory_make ("bin", name);
}
+static GstClock*
+gst_bin_get_clock_func (GstBin *bin)
+{
+ if (GST_ELEMENT_SCHED (bin))
+ return gst_scheduler_get_clock (GST_ELEMENT_SCHED (bin));
+
+ return NULL;
+}
+
+static void
+gst_bin_set_clock_func (GstBin *bin, GstClock *clock)
+{
+ if (GST_ELEMENT_SCHED (bin))
+ gst_scheduler_use_clock (GST_ELEMENT_SCHED (bin), clock);
+}
+
/**
* gst_bin_get_clock:
* @bin: a #GstBin to get the clock of
@@ -183,10 +208,7 @@ gst_bin_get_clock (GstBin *bin)
g_return_val_if_fail (bin != NULL, NULL);
g_return_val_if_fail (GST_IS_BIN (bin), NULL);
- if (GST_ELEMENT_SCHED (bin))
- return gst_scheduler_get_clock (GST_ELEMENT_SCHED (bin));
-
- return NULL;
+ return gst_bin_get_clock_func (bin);
}
/**
@@ -203,8 +225,7 @@ gst_bin_use_clock (GstBin *bin, GstClock *clock)
g_return_if_fail (bin != NULL);
g_return_if_fail (GST_IS_BIN (bin));
- if (GST_ELEMENT_SCHED (bin))
- gst_scheduler_use_clock (GST_ELEMENT_SCHED (bin), clock);
+ return gst_bin_set_clock_func (bin, clock);
}
/**
@@ -223,6 +244,7 @@ gst_bin_auto_clock (GstBin *bin)
gst_scheduler_auto_clock (GST_ELEMENT_SCHED (bin));
}
+#ifndef GST_DISABLE_INDEX
static void
gst_bin_set_index (GstElement *element, GstIndex *index)
{
@@ -239,6 +261,7 @@ gst_bin_set_index (GstElement *element, GstIndex *index)
gst_element_set_index (child, index);
}
}
+#endif
static void
gst_bin_set_element_sched (GstElement *element, GstScheduler *sched)
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c
index b590af5dc..bd747a9d6 100644
--- a/gst/gstbuffer.c
+++ b/gst/gstbuffer.c
@@ -31,14 +31,16 @@
#include "gstlog.h"
#include "gstbufferpool-default.h"
-/* #define GST_WITH_ALLOC_TRACE */
-#include "gsttrace.h"
-
GType _gst_buffer_type;
GType _gst_buffer_pool_type;
+#ifndef GST_DISABLE_TRACE
+/* #define GST_WITH_ALLOC_TRACE */
+#include "gsttrace.h"
+
static GstAllocTrace *_gst_buffer_trace;
static GstAllocTrace *_gst_buffer_pool_trace;
+#endif
static GstMemChunk *chunk;
@@ -53,8 +55,10 @@ _gst_buffer_initialize (void)
(GBoxedCopyFunc) gst_data_ref,
(GBoxedFreeFunc) gst_data_unref);
+#ifndef GST_DISABLE_TRACE
_gst_buffer_trace = gst_alloc_trace_register (GST_BUFFER_TRACE_NAME);
_gst_buffer_pool_trace = gst_alloc_trace_register (GST_BUFFER_POOL_TRACE_NAME);
+#endif
chunk = gst_mem_chunk_new ("GstBufferChunk", sizeof (GstBuffer),
sizeof (GstBuffer) * 200, 0);
@@ -83,7 +87,9 @@ _gst_buffer_sub_free (GstBuffer *buffer)
_GST_DATA_DISPOSE (GST_DATA (buffer));
gst_mem_chunk_free (chunk, GST_DATA (buffer));
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_buffer_trace, buffer);
+#endif
}
/**
@@ -110,7 +116,9 @@ gst_buffer_default_free (GstBuffer *buffer)
_GST_DATA_DISPOSE (GST_DATA (buffer));
gst_mem_chunk_free (chunk, GST_DATA (buffer));
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_buffer_trace, buffer);
+#endif
}
static GstBuffer*
@@ -162,7 +170,11 @@ gst_buffer_new (void)
GstBuffer *buf;
buf = gst_mem_chunk_alloc0 (chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_buffer_trace, buf);
+#endif
+
+ GST_DEBUG (GST_CAT_BUFFER, "new %p", buf);
_GST_DATA_INIT (GST_DATA (buf),
_gst_buffer_type,
@@ -270,7 +282,11 @@ gst_buffer_create_sub (GstBuffer *parent, guint offset, guint size)
/* create the new buffer */
buffer = gst_mem_chunk_alloc0 (chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_buffer_trace, buffer);
+#endif
+
+ GST_DEBUG (GST_CAT_BUFFER, "new %p", buf);
/* make sure nobody overwrites data in the new buffer
* by setting the READONLY flag */
@@ -416,7 +432,9 @@ gst_buffer_pool_default_free (GstBufferPool *pool)
_GST_DATA_DISPOSE (GST_DATA (pool));
g_free (pool);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_buffer_pool_trace, pool);
+#endif
}
/**
@@ -449,7 +467,9 @@ gst_buffer_pool_new (GstDataFreeFunction free,
g_return_val_if_fail (buffer_new != NULL, NULL);
pool = g_new0 (GstBufferPool, 1);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_buffer_pool_trace, pool);
+#endif
GST_DEBUG (GST_CAT_BUFFER, "allocating new buffer pool %p\n", pool);
diff --git a/gst/gstcaps.c b/gst/gstcaps.c
index 57de5684d..29e1ca796 100644
--- a/gst/gstcaps.c
+++ b/gst/gstcaps.c
@@ -28,12 +28,14 @@
#include "gstmemchunk.h"
#include "gstlog.h"
+#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
#include "gsttrace.h"
-static GstMemChunk *_gst_caps_chunk;
-
static GstAllocTrace *_gst_caps_trace;
+#endif
+
+static GstMemChunk *_gst_caps_chunk;
GType _gst_caps_type;
@@ -83,7 +85,9 @@ _gst_caps_initialize (void)
G_TYPE_STRING,
transform_func);
+#ifndef GST_DISABLE_TRACE
_gst_caps_trace = gst_alloc_trace_register (GST_CAPS_TRACE_NAME);
+#endif
}
static guint16
@@ -142,7 +146,9 @@ gst_caps_new_id (const gchar *name, const guint16 id, GstProps *props)
GstCaps *caps;
caps = gst_mem_chunk_alloc (_gst_caps_chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_caps_trace, caps);
+#endif
GST_DEBUG (GST_CAT_CAPS, "new %p", caps);
@@ -219,7 +225,9 @@ gst_caps_destroy (GstCaps *caps)
gst_props_unref (caps->properties);
g_free (caps->name);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_caps_trace, caps);
+#endif
gst_mem_chunk_free (_gst_caps_chunk, caps);
if (next)
@@ -956,7 +964,9 @@ gst_caps_load_thyself (xmlNodePtr parent)
GstCapsFlags fixed = GST_CAPS_FIXED;
caps = gst_mem_chunk_alloc0 (_gst_caps_chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_caps_trace, caps);
+#endif
caps->refcount = 1;
GST_CAPS_FLAG_SET (caps, GST_CAPS_FLOATING);
diff --git a/gst/gstclock.c b/gst/gstclock.c
index a4bd1efa6..21b28c36b 100644
--- a/gst/gstclock.c
+++ b/gst/gstclock.c
@@ -27,8 +27,11 @@
#include "gstlog.h"
#include "gstmemchunk.h"
+#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
-#include "gstmemchunk.h"
+#include "gsttrace.h"
+static GstAllocTrace *_gst_clock_entry_trace;
+#endif
#define DEFAULT_MAX_DIFF (2 * GST_SECOND)
@@ -39,7 +42,6 @@ enum {
};
static GstMemChunk *_gst_clock_entries_chunk;
-static GstAllocTrace *_gst_clock_entry_trace;
static void gst_clock_class_init (GstClockClass *klass);
static void gst_clock_init (GstClock *clock);
@@ -62,7 +64,9 @@ gst_clock_entry_new (GstClock *clock, GstClockTime time,
GstClockEntry *entry;
entry = gst_mem_chunk_alloc (_gst_clock_entries_chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_gst_clock_entry_trace, entry);
+#endif
entry->clock = clock;
entry->time = time;
@@ -283,7 +287,9 @@ gst_clock_id_free (GstClockID id)
{
g_return_if_fail (id != NULL);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_gst_clock_entry_trace, id);
+#endif
gst_mem_chunk_free (_gst_clock_entries_chunk, id);
}
@@ -357,7 +363,9 @@ gst_clock_class_init (GstClockClass *klass)
sizeof (GstClockEntry), sizeof (GstClockEntry) * 32,
G_ALLOC_AND_FREE);
+#ifndef GST_DISABLE_TRACE
_gst_clock_entry_trace = gst_alloc_trace_register (GST_CLOCK_ENTRY_TRACE_NAME);
+#endif
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_clock_dispose);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_clock_set_property);
@@ -454,8 +462,8 @@ gst_clock_set_resolution (GstClock *clock, guint64 resolution)
{
GstClockClass *cclass;
- g_return_val_if_fail (GST_IS_CLOCK (clock), 0LL);
- g_return_val_if_fail (resolution != 0, 0LL);
+ g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0));
+ g_return_val_if_fail (resolution != 0, G_GINT64_CONSTANT (0));
cclass = GST_CLOCK_GET_CLASS (clock);
@@ -478,14 +486,14 @@ gst_clock_get_resolution (GstClock *clock)
{
GstClockClass *cclass;
- g_return_val_if_fail (GST_IS_CLOCK (clock), 0LL);
+ g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0));
cclass = GST_CLOCK_GET_CLASS (clock);
if (cclass->get_resolution)
return cclass->get_resolution (clock);
- return 1LL;
+ return G_GINT64_CONSTANT (1);
}
/**
@@ -499,7 +507,7 @@ gst_clock_get_resolution (GstClock *clock)
void
gst_clock_set_active (GstClock *clock, gboolean active)
{
- GstClockTime time = 0LL;
+ GstClockTime time = G_GINT64_CONSTANT (0);
GstClockClass *cclass;
g_return_if_fail (GST_IS_CLOCK (clock));
@@ -554,7 +562,7 @@ gst_clock_is_active (GstClock *clock)
void
gst_clock_reset (GstClock *clock)
{
- GstClockTime time = 0LL;
+ GstClockTime time = G_GINT64_CONSTANT (0);
GstClockClass *cclass;
g_return_if_fail (GST_IS_CLOCK (clock));
@@ -568,7 +576,7 @@ gst_clock_reset (GstClock *clock)
GST_LOCK (clock);
clock->active = FALSE;
clock->start_time = time;
- clock->last_time = 0LL;
+ clock->last_time = G_GINT64_CONSTANT (0);
g_list_foreach (clock->entries, (GFunc) gst_clock_reschedule_func, NULL);
GST_UNLOCK (clock);
}
@@ -587,7 +595,7 @@ gst_clock_reset (GstClock *clock)
gboolean
gst_clock_handle_discont (GstClock *clock, guint64 time)
{
- GstClockTime itime = 0LL;
+ GstClockTime itime = G_GINT64_CONSTANT (0);
GST_DEBUG (GST_CAT_CLOCK, "clock discont %" G_GUINT64_FORMAT
" %" G_GUINT64_FORMAT " %d",
@@ -642,9 +650,9 @@ gst_clock_handle_discont (GstClock *clock, guint64 time)
GstClockTime
gst_clock_get_time (GstClock *clock)
{
- GstClockTime ret = 0LL;
+ GstClockTime ret = G_GINT64_CONSTANT (0);
- g_return_val_if_fail (GST_IS_CLOCK (clock), 0LL);
+ g_return_val_if_fail (GST_IS_CLOCK (clock), G_GINT64_CONSTANT (0));
if (!clock->active) {
/* clock is not active return previous time */
diff --git a/gst/gstelement.c b/gst/gstelement.c
index 3de74ae93..b6c82bebe 100644
--- a/gst/gstelement.c
+++ b/gst/gstelement.c
@@ -27,7 +27,6 @@
#include "gst_private.h"
#include "gstelement.h"
-#include "gstextratypes.h"
#include "gstbin.h"
#include "gstscheduler.h"
#include "gstevent.h"
@@ -766,6 +765,7 @@ gst_element_clock_wait (GstElement *element, GstClockID id, GstClockTimeDiff *ji
return res;
}
+#ifndef GST_DISABLE_INDEX
/**
* gst_element_is_indexable:
* @element: a #GstElement.
@@ -826,6 +826,7 @@ gst_element_get_index (GstElement *element)
return NULL;
}
+#endif
/**
* gst_element_release_locks:
diff --git a/gst/gstelement.h b/gst/gstelement.h
index cf828be66..fe9a5448a 100644
--- a/gst/gstelement.h
+++ b/gst/gstelement.h
@@ -258,6 +258,7 @@ GstClock* gst_element_get_clock (GstElement *element);
void gst_element_set_clock (GstElement *element, GstClock *clock);
GstClockReturn gst_element_clock_wait (GstElement *element,
GstClockID id, GstClockTimeDiff *jitter);
+
/* indexs */
gboolean gst_element_is_indexable (GstElement *element);
void gst_element_set_index (GstElement *element, GstIndex *index);
diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c
index 425464621..757bd0275 100644
--- a/gst/gstelementfactory.c
+++ b/gst/gstelementfactory.c
@@ -24,7 +24,7 @@
#include "gst_private.h"
#include "gstelement.h"
-#include "gstregistry.h"
+#include "gstregistrypool.h"
#include "gstlog.h"
static void gst_element_factory_class_init (GstElementFactoryClass *klass);
diff --git a/gst/gstevent.c b/gst/gstevent.c
index cb537c3d1..43a7704ed 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -27,15 +27,16 @@
#include "gstevent.h"
#include "gstlog.h"
+#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
#include "gsttrace.h"
+static GstAllocTrace *_event_trace;
+#endif
/* #define MEMPROF */
GType _gst_event_type;
-static GstAllocTrace *_event_trace;
-
void
_gst_event_initialize (void)
{
@@ -44,7 +45,9 @@ _gst_event_initialize (void)
(GBoxedCopyFunc) gst_data_ref,
(GBoxedFreeFunc) gst_data_unref);
+#ifndef GST_DISABLE_TRACE
_event_trace = gst_alloc_trace_register (GST_EVENT_TRACE_NAME);
+#endif
}
static GstEvent*
@@ -53,7 +56,9 @@ _gst_event_copy (GstEvent *event)
GstEvent *copy;
copy = g_new0(GstEvent, 1);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_event_trace, copy);
+#endif
memcpy (copy, event, sizeof (GstEvent));
@@ -75,7 +80,9 @@ _gst_event_free (GstEvent* event)
break;
}
_GST_DATA_DISPOSE (GST_DATA (event));
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_event_trace, event);
+#endif
g_free (event);
}
@@ -122,7 +129,9 @@ gst_event_new (GstEventType type)
GstEvent *event;
event = g_new0(GstEvent, 1);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_event_trace, event);
+#endif
GST_INFO (GST_CAT_EVENT, "creating new event %p %d", event, type);
@@ -133,7 +142,7 @@ gst_event_new (GstEventType type)
(GstDataCopyFunction) _gst_event_copy);
GST_EVENT_TYPE (event) = type;
- GST_EVENT_TIMESTAMP (event) = 0LL;
+ GST_EVENT_TIMESTAMP (event) = G_GINT64_CONSTANT (0);
GST_EVENT_SRC (event) = NULL;
return event;
diff --git a/gst/gstobject.h b/gst/gstobject.h
index 433cbccda..f66994f80 100644
--- a/gst/gstobject.h
+++ b/gst/gstobject.h
@@ -29,7 +29,6 @@
#include <glib-object.h> /* note that this gets wrapped in __GST_OBJECT_H__ */
#include <gst/gstmarshal.h>
-#include <gst/gsttrace.h>
#include <gst/gsttypes.h>
G_BEGIN_DECLS
@@ -52,6 +51,12 @@ extern GType _gst_object_type;
# define GST_OBJECT_CLASS GST_OBJECT_CLASS_CAST
#endif
+/* make sure we don't change the object size but stil make it compile
+ * without libxml */
+#ifdef GST_DISABLE_LOADSAVE_REGISTRY
+#define xmlNodePtr gpointer
+#endif
+
typedef enum
{
GST_DESTROYED = 0,
@@ -83,18 +88,14 @@ struct _GstObjectClass {
/* signals */
void (*parent_set) (GstObject *object, GstObject *parent);
void (*parent_unset) (GstObject *object, GstObject *parent);
-#ifndef GST_DISABLE_LOADSAVE_REGISTRY
void (*object_saved) (GstObject *object, xmlNodePtr parent);
-#endif
void (*deep_notify) (GstObject *object, GstObject *orig, GParamSpec *pspec);
/* functions go here */
void (*destroy) (GstObject *object);
-#ifndef GST_DISABLE_LOADSAVE_REGISTRY
xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent);
void (*restore_thyself) (GstObject *object, xmlNodePtr self);
-#endif
gpointer dummy[4];
};
@@ -156,13 +157,13 @@ gchar * gst_object_get_path_string (GstObject *object);
guint gst_class_signal_connect (GstObjectClass *klass,
const gchar *name,
- gpointer func,
- gpointer func_data);
+ gpointer func,
+ gpointer func_data);
#ifndef GST_DISABLE_LOADSAVE_REGISTRY
void gst_class_signal_emit_by_name (GstObject *object,
const gchar *name,
- xmlNodePtr self);
+ xmlNodePtr self);
#else
#pragma GCC poison gst_class_signal_emit_by_name
#endif
diff --git a/gst/gstpad.h b/gst/gstpad.h
index 6e6bad1e9..889932751 100644
--- a/gst/gstpad.h
+++ b/gst/gstpad.h
@@ -511,8 +511,10 @@ GstPadTemplate* gst_pad_template_new (const gchar *name_template,
GstCaps* gst_pad_template_get_caps (GstPadTemplate *templ);
GstCaps* gst_pad_template_get_caps_by_name (GstPadTemplate *templ, const gchar *name);
+#ifndef GST_DISABLE_LOADSAVE
xmlNodePtr gst_ghost_pad_save_thyself (GstPad *pad,
xmlNodePtr parent);
+#endif
G_END_DECLS
diff --git a/gst/gstplugin.c b/gst/gstplugin.c
index 051aedc43..89e3bc469 100644
--- a/gst/gstplugin.c
+++ b/gst/gstplugin.c
@@ -28,7 +28,7 @@
#include "gst_private.h"
#include "gstplugin.h"
#include "gstversion.h"
-#include "gstregistry.h"
+#include "gstregistrypool.h"
#include "gstlog.h"
#include "config.h"
diff --git a/gst/gstpluginfeature.c b/gst/gstpluginfeature.c
index c47334829..3a3ce2ed4 100644
--- a/gst/gstpluginfeature.c
+++ b/gst/gstpluginfeature.c
@@ -92,6 +92,7 @@ gst_plugin_feature_ensure_loaded (GstPluginFeature *feature)
plugin = (GstPlugin *) (feature->manager);
if (plugin && !gst_plugin_is_loaded (plugin)) {
+#ifndef GST_DISABLE_REGISTRY
if (GST_IS_REGISTRY (plugin->manager)) {
GST_DEBUG (GST_CAT_PLUGIN_LOADING,
"loading plugin %s for feature", plugin->name);
@@ -100,6 +101,7 @@ gst_plugin_feature_ensure_loaded (GstPluginFeature *feature)
return FALSE;
}
else
+#endif /* GST_DISABLE_REGISTRY */
return FALSE;
}
return TRUE;
diff --git a/gst/gstprops.c b/gst/gstprops.c
index 49a914bae..2e4659d40 100644
--- a/gst/gstprops.c
+++ b/gst/gstprops.c
@@ -27,15 +27,16 @@
#include "gstprops.h"
#include "gstmemchunk.h"
+#ifndef GST_DISABLE_TRACE
/* #define GST_WITH_ALLOC_TRACE */
#include "gsttrace.h"
+static GstAllocTrace *_props_trace;
+static GstAllocTrace *_entries_trace;
+#endif
GType _gst_props_type;
GType _gst_props_entry_type;
-static GstAllocTrace *_props_trace;
-static GstAllocTrace *_entries_trace;
-
#define GST_PROPS_ENTRY_IS_VARIABLE(a) (((GstPropsEntry*)(a))->propstype > GST_PROPS_VAR_TYPE)
struct _GstPropsEntry {
@@ -142,8 +143,10 @@ _gst_props_initialize (void)
(GBoxedCopyFunc) gst_props_entry_copy,
(GBoxedFreeFunc) gst_props_entry_destroy);
+#ifndef GST_DISABLE_TRACE
_props_trace = gst_alloc_trace_register (GST_PROPS_TRACE_NAME);
_entries_trace = gst_alloc_trace_register (GST_PROPS_ENTRY_TRACE_NAME);
+#endif
}
static void
@@ -309,7 +312,9 @@ gst_props_alloc_entry (void)
GstPropsEntry *entry;
entry = gst_mem_chunk_alloc (_gst_props_entries_chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_entries_trace, entry);
+#endif
GST_DEBUG (GST_CAT_PROPERTIES, "new entry %p", entry);
@@ -347,7 +352,9 @@ gst_props_entry_destroy (GstPropsEntry *entry)
gst_props_entry_clean (entry);
gst_mem_chunk_free (_gst_props_entries_chunk, entry);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_entries_trace, entry);
+#endif
}
/**
@@ -363,7 +370,9 @@ gst_props_empty_new (void)
GstProps *props;
props = gst_mem_chunk_alloc (_gst_props_chunk);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_new (_props_trace, props);
+#endif
GST_DEBUG (GST_CAT_PROPERTIES, "new %p", props);
@@ -915,7 +924,9 @@ gst_props_destroy (GstProps *props)
g_list_free (props->properties);
gst_mem_chunk_free (_gst_props_chunk, props);
+#ifndef GST_DISABLE_TRACE
gst_alloc_trace_free (_props_trace, props);
+#endif
}
/*
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index fbbb22af1..2c6707fa3 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -39,10 +39,6 @@ enum {
LAST_SIGNAL
};
-
-static GList *_gst_registry_pool = NULL;
-static GList *_gst_registry_pool_plugins = NULL;
-
static void gst_registry_class_init (GstRegistryClass *klass);
static void gst_registry_init (GstRegistry *registry);
@@ -313,37 +309,6 @@ gst_registry_remove_plugin (GstRegistry *registry, GstPlugin *plugin)
registry->plugins = g_list_remove (registry->plugins, plugin);
}
-static GstPluginFeature*
-gst_plugin_list_find_feature (GList *plugins, const gchar *name, GType type)
-{
- GstPluginFeature *feature = NULL;
-
- while (plugins) {
- GstPlugin *plugin = (GstPlugin *) (plugins->data);
-
- feature = gst_plugin_find_feature (plugin, name, type);
- if (feature)
- return feature;
-
- plugins = g_list_next (plugins);
- }
- return feature;
-}
-
-static GstPlugin*
-gst_plugin_list_find_plugin (GList *plugins, const gchar *name)
-{
- while (plugins) {
- GstPlugin *plugin = (GstPlugin *) (plugins->data);
-
- if (plugin->name && !strcmp (plugin->name, name))
- return plugin;
-
- plugins = g_list_next (plugins);
- }
- return NULL;
-}
-
/**
* gst_registry_find_plugin:
* @registry: the registry to search
@@ -356,10 +321,22 @@ gst_plugin_list_find_plugin (GList *plugins, const gchar *name)
GstPlugin*
gst_registry_find_plugin (GstRegistry *registry, const gchar *name)
{
+ GList *plugins;
+
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
g_return_val_if_fail (name != NULL, NULL);
+
+ plugins = registry->plugins;
- return gst_plugin_list_find_plugin (registry->plugins, name);
+ while (plugins) {
+ GstPlugin *plugin = (GstPlugin *) (plugins->data);
+
+ if (plugin->name && !strcmp (plugin->name, name))
+ return plugin;
+
+ plugins = g_list_next (plugins);
+ }
+ return NULL;
}
/**
@@ -376,10 +353,24 @@ gst_registry_find_plugin (GstRegistry *registry, const gchar *name)
GstPluginFeature*
gst_registry_find_feature (GstRegistry *registry, const gchar *name, GType type)
{
+ GstPluginFeature *feature = NULL;
+ GList *plugins;
+
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
g_return_val_if_fail (name != NULL, NULL);
-
- return gst_plugin_list_find_feature (registry->plugins, name, type);
+
+ plugins = registry->plugins;
+
+ while (plugins) {
+ GstPlugin *plugin = (GstPlugin *) (plugins->data);
+
+ feature = gst_plugin_find_feature (plugin, name, type);
+ if (feature)
+ return feature;
+
+ plugins = g_list_next (plugins);
+ }
+ return feature;
}
@@ -455,241 +446,3 @@ gst_registry_update_plugin (GstRegistry *registry, GstPlugin *plugin)
return GST_REGISTRY_PLUGIN_LOAD_ERROR;
}
-/**
- * gst_registry_pool_list:
- *
- * Get a list of all registries in the pool
- *
- * Returns: a Glist of GstRegistries, g_list_free after use.
- */
-GList*
-gst_registry_pool_list (void)
-{
- return g_list_copy (_gst_registry_pool);
-}
-
-static gint
-gst_registry_compare_func (gconstpointer a, gconstpointer b)
-{
- return GST_REGISTRY (a)->priority - GST_REGISTRY (b)->priority;
-}
-
-/**
- * gst_registry_pool_add:
- * @registry: the registry to add
- * @priority: the priority of the registry
- *
- * Add the registry to the pool with the given priority.
- */
-void
-gst_registry_pool_add (GstRegistry *registry, guint priority)
-{
- g_return_if_fail (GST_IS_REGISTRY (registry));
-
- registry->priority = priority;
-
- _gst_registry_pool = g_list_insert_sorted (_gst_registry_pool, registry, gst_registry_compare_func);
-}
-
-/**
- * gst_registry_pool_remove:
- * @registry: the registry to remove
- *
- * Remove the registry from the pool.
- */
-void
-gst_registry_pool_remove (GstRegistry *registry)
-{
- g_return_if_fail (GST_IS_REGISTRY (registry));
-
- _gst_registry_pool = g_list_remove (_gst_registry_pool, registry);
-}
-
-/**
- * gst_registry_pool_add_plugin:
- * @plugin: the plugin to add
- *
- * Add the plugin to the global pool of plugins.
- */
-void
-gst_registry_pool_add_plugin (GstPlugin *plugin)
-{
- _gst_registry_pool_plugins = g_list_prepend (_gst_registry_pool_plugins, plugin);
-}
-
-
-/**
- * gst_registry_pool_load_all:
- *
- * Load all the registries in the pool. Registries with the
- * GST_REGISTRY_DELAYED_LOADING will not be loaded.
- */
-void
-gst_registry_pool_load_all (void)
-{
- GList *walk = _gst_registry_pool;
-
- while (walk) {
- GstRegistry *registry = GST_REGISTRY (walk->data);
-
- if (registry->flags & GST_REGISTRY_READABLE &&
- !(registry->flags & GST_REGISTRY_DELAYED_LOADING)) {
- gst_registry_load (registry);
- }
-
- walk = g_list_next (walk);
- }
-}
-
-/**
- * gst_registry_pool_plugin_list:
- *
- * Get a list of all plugins in the pool.
- *
- * Returns: a GList of plugins, g_list_free after use.
- */
-GList*
-gst_registry_pool_plugin_list (void)
-{
- GList *result = NULL;
- GList *walk = _gst_registry_pool;
-
- while (walk) {
- GstRegistry *registry = GST_REGISTRY (walk->data);
-
- /* FIXME only include highest priority plugins */
- result = g_list_concat (result, g_list_copy (registry->plugins));
-
- walk = g_list_next (walk);
- }
-
- return g_list_concat (_gst_registry_pool_plugins, result);
-}
-
-/**
- * gst_registry_pool_feature_list:
- * @type: the type of the features to list.
- *
- * Get a list of all pluginfeatures of the given type in the pool.
- *
- * Returns: a GList of pluginfeatures, g_list_free after use.
- */
-GList*
-gst_registry_pool_feature_list (GType type)
-{
- GList *result = NULL;
- GList *plugins = gst_registry_pool_plugin_list ();
-
- while (plugins) {
- GstPlugin *plugin = GST_PLUGIN (plugins->data);
- GList *features = plugin->features;
-
- while (features) {
- GstPluginFeature *feature = GST_PLUGIN_FEATURE (features->data);
-
- if (type == 0 || G_OBJECT_TYPE (feature) == type) {
- result = g_list_prepend (result, feature);
- }
- features = g_list_next (features);
- }
- plugins = g_list_next (plugins);
- }
- result = g_list_reverse (result);
-
- return result;
-}
-
-/**
- * gst_registry_pool_find_plugin:
- * @name: the name of the plugin to find
- *
- * Get the named plugin from the registry pool
- *
- * Returns: The plugin with the given name or NULL if the plugin
- * was not found.
- */
-GstPlugin*
-gst_registry_pool_find_plugin (const gchar *name)
-{
- GstPlugin *result = NULL;
- GList *walk;
-
- result = gst_plugin_list_find_plugin (_gst_registry_pool_plugins, name);
- if (result)
- return result;
-
- walk = _gst_registry_pool;
-
- while (walk) {
- GstRegistry *registry = GST_REGISTRY (walk->data);
-
- /* FIXME only include highest priority plugins */
- result = gst_registry_find_plugin (registry, name);
- if (result)
- return result;
-
- walk = g_list_next (walk);
- }
- return NULL;
-}
-
-/**
- * gst_registry_pool_find_feature:
- * @name: the name of the pluginfeature to find
- * @type: the type of the pluginfeature to find
- *
- * Get the pluginfeature with the given name and type from the pool of
- * registries.
- *
- * Returns: A pluginfeature with the given name and type or NULL if the feature
- * was not found.
- */
-GstPluginFeature*
-gst_registry_pool_find_feature (const gchar *name, GType type)
-{
- GstPluginFeature *result = NULL;
- GList *walk;
-
- result = gst_plugin_list_find_feature (_gst_registry_pool_plugins, name, type);
- if (result)
- return result;
-
- walk = _gst_registry_pool;
-
- while (walk) {
- GstRegistry *registry = GST_REGISTRY (walk->data);
-
- /* FIXME only include highest priority plugins */
- result = gst_registry_find_feature (registry, name, type);
- if (result)
- return result;
-
- walk = g_list_next (walk);
- }
- return NULL;
-}
-
-/**
- * gst_registry_pool_get_prefered:
- * @flags: The flags for the prefered registry
- *
- * Get the prefered registry with the given flags
- *
- * Returns: The registry with the flags.
- */
-GstRegistry*
-gst_registry_pool_get_prefered (GstRegistryFlags flags)
-{
- GList *walk = _gst_registry_pool;
-
- while (walk) {
- GstRegistry *registry = GST_REGISTRY (walk->data);
-
- if (registry->flags & flags)
- return registry;
-
- walk = g_list_next (walk);
- }
- return NULL;
-}
-
diff --git a/gst/gstregistry.h b/gst/gstregistry.h
index 2e2b94ade..6c6df5cb8 100644
--- a/gst/gstregistry.h
+++ b/gst/gstregistry.h
@@ -132,23 +132,6 @@ GstRegistryReturn gst_registry_load_plugin (GstRegistry *registry, GstPlugin *pl
GstRegistryReturn gst_registry_unload_plugin (GstRegistry *registry, GstPlugin *plugin);
GstRegistryReturn gst_registry_update_plugin (GstRegistry *registry, GstPlugin *plugin);
-/* the pool of registries */
-GList* gst_registry_pool_list (void);
-void gst_registry_pool_add (GstRegistry *registry, guint priority);
-void gst_registry_pool_remove (GstRegistry *registry);
-
-void gst_registry_pool_add_plugin (GstPlugin *plugin);
-
-void gst_registry_pool_load_all (void);
-
-GList* gst_registry_pool_plugin_list (void);
-GList* gst_registry_pool_feature_list (GType type);
-
-GstPlugin* gst_registry_pool_find_plugin (const gchar *name);
-GstPluginFeature* gst_registry_pool_find_feature (const gchar *name, GType type);
-
-GstRegistry* gst_registry_pool_get_prefered (GstRegistryFlags flags);
-
G_END_DECLS
#endif /* __GST_REGISTRY_H__ */
diff --git a/gst/gstregistrypool.c b/gst/gstregistrypool.c
new file mode 100644
index 000000000..f484ac725
--- /dev/null
+++ b/gst/gstregistrypool.c
@@ -0,0 +1,296 @@
+/* GStreamer
+ * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
+ * 2000 Wim Taymans <wtay@chello.be>
+ *
+ * gstregistry.c: handle registry
+ *
+ * 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.
+ */
+
+#include <string.h>
+
+#include "gstinfo.h"
+#include "gstregistrypool.h"
+#include "gstlog.h"
+
+static GList *_gst_registry_pool = NULL;
+static GList *_gst_registry_pool_plugins = NULL;
+
+/**
+ * gst_registry_pool_list:
+ *
+ * Get a list of all registries in the pool
+ *
+ * Returns: a Glist of GstRegistries, g_list_free after use.
+ */
+GList*
+gst_registry_pool_list (void)
+{
+ return g_list_copy (_gst_registry_pool);
+}
+
+#ifndef GST_DISABLE_REGISTRY
+static gint
+gst_registry_compare_func (gconstpointer a, gconstpointer b)
+{
+ return GST_REGISTRY (a)->priority - GST_REGISTRY (b)->priority;
+}
+
+/**
+ * gst_registry_pool_add:
+ * @registry: the registry to add
+ * @priority: the priority of the registry
+ *
+ * Add the registry to the pool with the given priority.
+ */
+void
+gst_registry_pool_add (GstRegistry *registry, guint priority)
+{
+ g_return_if_fail (GST_IS_REGISTRY (registry));
+
+ registry->priority = priority;
+
+ _gst_registry_pool = g_list_insert_sorted (_gst_registry_pool, registry, gst_registry_compare_func);
+}
+
+/**
+ * gst_registry_pool_remove:
+ * @registry: the registry to remove
+ *
+ * Remove the registry from the pool.
+ */
+void
+gst_registry_pool_remove (GstRegistry *registry)
+{
+ g_return_if_fail (GST_IS_REGISTRY (registry));
+
+ _gst_registry_pool = g_list_remove (_gst_registry_pool, registry);
+}
+#endif /* GST_DISABLE_REGISTRY */
+
+/**
+ * gst_registry_pool_add_plugin:
+ * @plugin: the plugin to add
+ *
+ * Add the plugin to the global pool of plugins.
+ */
+void
+gst_registry_pool_add_plugin (GstPlugin *plugin)
+{
+ _gst_registry_pool_plugins = g_list_prepend (_gst_registry_pool_plugins, plugin);
+}
+
+
+/**
+ * gst_registry_pool_load_all:
+ *
+ * Load all the registries in the pool. Registries with the
+ * GST_REGISTRY_DELAYED_LOADING will not be loaded.
+ */
+void
+gst_registry_pool_load_all (void)
+{
+#ifndef GST_DISABLE_REGISTRY
+ GList *walk = _gst_registry_pool;
+
+ while (walk) {
+ GstRegistry *registry = GST_REGISTRY (walk->data);
+
+ if (registry->flags & GST_REGISTRY_READABLE &&
+ !(registry->flags & GST_REGISTRY_DELAYED_LOADING)) {
+ gst_registry_load (registry);
+ }
+
+ walk = g_list_next (walk);
+ }
+#endif /* GST_DISABLE_REGISTRY */
+}
+
+/**
+ * gst_registry_pool_plugin_list:
+ *
+ * Get a list of all plugins in the pool.
+ *
+ * Returns: a GList of plugins, g_list_free after use.
+ */
+GList*
+gst_registry_pool_plugin_list (void)
+{
+ GList *result = NULL;
+#ifndef GST_DISABLE_REGISTRY
+ GList *walk = _gst_registry_pool;
+
+ while (walk) {
+ GstRegistry *registry = GST_REGISTRY (walk->data);
+
+ /* FIXME only include highest priority plugins */
+ result = g_list_concat (result, g_list_copy (registry->plugins));
+
+ walk = g_list_next (walk);
+ }
+#endif /* GST_DISABLE_REGISTRY */
+
+ return g_list_concat (_gst_registry_pool_plugins, result);
+}
+
+/**
+ * gst_registry_pool_feature_list:
+ * @type: the type of the features to list.
+ *
+ * Get a list of all pluginfeatures of the given type in the pool.
+ *
+ * Returns: a GList of pluginfeatures, g_list_free after use.
+ */
+GList*
+gst_registry_pool_feature_list (GType type)
+{
+ GList *result = NULL;
+ GList *plugins = gst_registry_pool_plugin_list ();
+
+ while (plugins) {
+ GstPlugin *plugin = GST_PLUGIN (plugins->data);
+ GList *features = plugin->features;
+
+ while (features) {
+ GstPluginFeature *feature = GST_PLUGIN_FEATURE (features->data);
+
+ if (type == 0 || G_OBJECT_TYPE (feature) == type) {
+ result = g_list_prepend (result, feature);
+ }
+ features = g_list_next (features);
+ }
+ plugins = g_list_next (plugins);
+ }
+ result = g_list_reverse (result);
+
+ return result;
+}
+
+/**
+ * gst_registry_pool_find_plugin:
+ * @name: the name of the plugin to find
+ *
+ * Get the named plugin from the registry pool
+ *
+ * Returns: The plugin with the given name or NULL if the plugin
+ * was not found.
+ */
+GstPlugin*
+gst_registry_pool_find_plugin (const gchar *name)
+{
+ GstPlugin *result = NULL;
+ GList *walk;
+
+ g_return_val_if_fail (name != NULL, NULL);
+
+ walk = _gst_registry_pool_plugins;
+ while (walk) {
+ result = (GstPlugin *) (walk->data);
+
+ if (result->name && !strcmp (result->name, name))
+ return result;
+
+ walk = g_list_next (walk);
+ }
+
+#ifndef GST_DISABLE_REGISTRY
+ walk = _gst_registry_pool;
+ while (walk) {
+ GstRegistry *registry = GST_REGISTRY (walk->data);
+
+ /* FIXME only include highest priority plugins */
+ result = gst_registry_find_plugin (registry, name);
+ if (result)
+ return result;
+
+ walk = g_list_next (walk);
+ }
+#endif /* GST_DISABLE_REGISTRY */
+ return NULL;
+}
+
+/**
+ * gst_registry_pool_find_feature:
+ * @name: the name of the pluginfeature to find
+ * @type: the type of the pluginfeature to find
+ *
+ * Get the pluginfeature with the given name and type from the pool of
+ * registries.
+ *
+ * Returns: A pluginfeature with the given name and type or NULL if the feature
+ * was not found.
+ */
+GstPluginFeature*
+gst_registry_pool_find_feature (const gchar *name, GType type)
+{
+ GstPluginFeature *result = NULL;
+ GList *walk;
+
+ g_return_val_if_fail (name != NULL, NULL);
+
+ walk = _gst_registry_pool_plugins;
+ while (walk) {
+ GstPlugin *plugin = (GstPlugin *) (walk->data);
+
+ result = gst_plugin_find_feature (plugin, name, type);
+ if (result)
+ return result;
+
+ walk = g_list_next (walk);
+ }
+
+#ifndef GST_DISABLE_REGISTRY
+ walk = _gst_registry_pool;
+ while (walk) {
+ GstRegistry *registry = GST_REGISTRY (walk->data);
+
+ /* FIXME only include highest priority plugins */
+ result = gst_registry_find_feature (registry, name, type);
+ if (result)
+ return result;
+
+ walk = g_list_next (walk);
+ }
+#endif /* GST_DISABLE_REGISTRY */
+ return NULL;
+}
+
+/**
+ * gst_registry_pool_get_prefered:
+ * @flags: The flags for the prefered registry
+ *
+ * Get the prefered registry with the given flags
+ *
+ * Returns: The registry with the flags.
+ */
+GstRegistry*
+gst_registry_pool_get_prefered (GstRegistryFlags flags)
+{
+#ifndef GST_DISABLE_REGISTRY
+ GList *walk = _gst_registry_pool;
+
+ while (walk) {
+ GstRegistry *registry = GST_REGISTRY (walk->data);
+
+ if (registry->flags & flags)
+ return registry;
+
+ walk = g_list_next (walk);
+ }
+#endif /* GST_DISABLE_REGISTRY */
+ return NULL;
+}
+
diff --git a/gst/gstregistrypool.h b/gst/gstregistrypool.h
new file mode 100644
index 000000000..bcc7fbd54
--- /dev/null
+++ b/gst/gstregistrypool.h
@@ -0,0 +1,48 @@
+/* GStreamer
+ * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
+ * 2000 Wim Taymans <wim.taymans@chello.be>
+ *
+ * gstregistrypool.h: maintain list of registries and plugins
+ *
+ * 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_POOL_H__
+#define __GST_REGISTRY_POOL_H__
+
+#include <gst/gstregistry.h>
+
+/* the pool of registries */
+GList* gst_registry_pool_list (void);
+void gst_registry_pool_add (GstRegistry *registry, guint priority);
+void gst_registry_pool_remove (GstRegistry *registry);
+
+void gst_registry_pool_add_plugin (GstPlugin *plugin);
+
+void gst_registry_pool_load_all (void);
+
+GList* gst_registry_pool_plugin_list (void);
+GList* gst_registry_pool_feature_list (GType type);
+
+GstPlugin* gst_registry_pool_find_plugin (const gchar *name);
+GstPluginFeature* gst_registry_pool_find_feature (const gchar *name, GType type);
+
+GstRegistry* gst_registry_pool_get_prefered (GstRegistryFlags flags);
+
+G_END_DECLS
+
+#endif /* __GST_REGISTRY_POOL_H__ */
diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c
index 8e2d3b85f..53f78a1fb 100644
--- a/gst/gstscheduler.c
+++ b/gst/gstscheduler.c
@@ -25,7 +25,7 @@
#include "gstsystemclock.h"
#include "gstscheduler.h"
#include "gstlog.h"
-#include "gstregistry.h"
+#include "gstregistrypool.h"
static void gst_scheduler_class_init (GstSchedulerClass *klass);
static void gst_scheduler_init (GstScheduler *sched);
@@ -897,26 +897,25 @@ gst_scheduler_factory_find (const gchar *name)
GstScheduler*
gst_scheduler_factory_create (GstSchedulerFactory *factory, GstElement *parent)
{
- GstScheduler *new = NULL;
+ GstScheduler *sched = NULL;
g_return_val_if_fail (factory != NULL, NULL);
g_return_val_if_fail (GST_IS_ELEMENT (parent), NULL);
- g_return_val_if_fail (GST_ELEMENT_SCHED (parent) == NULL, NULL);
if (gst_plugin_feature_ensure_loaded (GST_PLUGIN_FEATURE (factory))) {
g_return_val_if_fail (factory->type != 0, NULL);
- new = GST_SCHEDULER (g_object_new (factory->type, NULL));
- new->parent = parent;
+ sched = GST_SCHEDULER (g_object_new (factory->type, NULL));
+ sched->parent = parent;
- GST_ELEMENT_SCHED (parent) = new;
+ GST_ELEMENT_SCHED (parent) = sched;
/* let's refcount the scheduler */
- gst_object_ref (GST_OBJECT (new));
- gst_object_sink (GST_OBJECT (new));
+ gst_object_ref (GST_OBJECT (sched));
+ gst_object_sink (GST_OBJECT (sched));
}
- return new;
+ return sched;
}
/**
diff --git a/gst/gsttrace.c b/gst/gsttrace.c
index ec846fab6..25670d371 100644
--- a/gst/gsttrace.c
+++ b/gst/gsttrace.c
@@ -252,6 +252,7 @@ gst_alloc_trace_set_flags_all (GstAllocTraceFlags flags)
while (walk) {
GstAllocTrace *trace = (GstAllocTrace *) walk->data;
+ g_print ("set flags on %p\n", trace);
gst_alloc_trace_set_flags (trace, flags);
walk = g_list_next (walk);
@@ -299,7 +300,7 @@ gst_alloc_trace_print (const GstAllocTrace *trace)
g_return_if_fail (trace != NULL);
- g_print ("%s: flags %d", trace->name, trace->flags);
+ g_print ("%s (%p): flags %d", trace->name, trace, trace->flags);
if (trace->flags & GST_ALLOC_TRACE_LIVE) {
g_print (", live %d", trace->live);
diff --git a/gst/gsttrace.h b/gst/gsttrace.h
index 2e0abcbd8..f947da5ee 100644
--- a/gst/gsttrace.h
+++ b/gst/gsttrace.h
@@ -148,6 +148,22 @@ extern gint _gst_trace_on;
#pragma GCC poison gst_trace_read_tsc
#pragma GCC poison gst_trace_add_entry
+#define gst_alloc_trace_register(name)
+#define gst_alloc_trace_new(trace, mem)
+#define gst_alloc_trace_free(trace, mem)
+
+#define gst_alloc_trace_available() FALSE
+#define gst_alloc_trace_list() NULL
+#define _gst_alloc_trace_register(name) NULL
+
+#define gst_alloc_trace_print_all()
+#define gst_alloc_trace_set_flags_all(flags)
+
+#define gst_alloc_trace_get(name) NULL
+#define gst_alloc_trace_print(trace)
+#define gst_alloc_trace_set_flags(trace,flags)
+
+
#endif /* GST_DISABLE_TRACE */
G_END_DECLS
diff --git a/gst/gsttype.c b/gst/gsttype.c
index fc1ac6a52..29c883737 100644
--- a/gst/gsttype.c
+++ b/gst/gsttype.c
@@ -30,7 +30,7 @@
#include "gst_private.h"
#include "gsttype.h"
-#include "gstregistry.h"
+#include "gstregistrypool.h"
#include "gstobject.h"
#include "gstlog.h"
diff --git a/gst/gstutils.c b/gst/gstutils.c
index 9e665a9aa..3f1da8843 100644
--- a/gst/gstutils.c
+++ b/gst/gstutils.c
@@ -26,10 +26,9 @@
#include "gst_private.h"
#include "gstutils.h"
+#include "gsturitype.h"
#include "gstlog.h"
-#include "gstextratypes.h"
-
/**
* gst_util_dump_mem:
* @mem: a pointer to the memory to dump
@@ -254,7 +253,7 @@ gst_util_set_object_arg (GObject * object, const gchar * name, const gchar * val
sscanf (value, "%d", &i);
g_object_set (G_OBJECT (object), name, i, NULL);
}
- else if (paramspec->value_type == GST_TYPE_FILENAME) {
+ else if (paramspec->value_type == GST_TYPE_URI) {
g_object_set (G_OBJECT (object), name, value, NULL);
}
break;
diff --git a/libs/gst/bytestream/bstest.c b/libs/gst/bytestream/bstest.c
index 1e939ee70..0a5b41eb9 100644
--- a/libs/gst/bytestream/bstest.c
+++ b/libs/gst/bytestream/bstest.c
@@ -20,6 +20,7 @@
* Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
#include <gst/gst.h>
#include "bytestream.h"
diff --git a/tests/old/examples/Makefile.am b/tests/old/examples/Makefile.am
index 858713392..9751930a0 100644
--- a/tests/old/examples/Makefile.am
+++ b/tests/old/examples/Makefile.am
@@ -4,8 +4,14 @@ else
GST_LOADSAVE_DIRS = xml typefind
endif
-SUBDIRS = autoplug $(GST_LOADSAVE_DIRS) \
- helloworld helloworld2 \
+if GST_DISABLE_AUTOPLUG
+GST_AUTOPLUG_DIRS =
+else
+GST_AUTOPLUG_DIRS = autoplug helloworld2
+endif
+
+SUBDIRS = $(GST_AUTOPLUG_DIRS) $(GST_LOADSAVE_DIRS) \
+ helloworld \
queue queue2 queue3 queue4 \
launch thread plugins mixer cutter pingpong manual
diff --git a/tests/old/examples/launch/mp3parselaunch.c b/tests/old/examples/launch/mp3parselaunch.c
index 5489b2652..a0cb19036 100644
--- a/tests/old/examples/launch/mp3parselaunch.c
+++ b/tests/old/examples/launch/mp3parselaunch.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <gst/gst.h>
int
diff --git a/tests/old/examples/manual/Makefile.am b/tests/old/examples/manual/Makefile.am
index 370d6a6cd..b8da46a2c 100644
--- a/tests/old/examples/manual/Makefile.am
+++ b/tests/old/examples/manual/Makefile.am
@@ -4,7 +4,19 @@ else
GNOME=
endif
-EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
+if GST_DISABLE_AUTOPLUG
+GST_AUTOPLUG_SRC =
+else
+GST_AUTOPLUG_SRC = helloworld2
+endif
+
+if GST_DISABLE_LOADSAVE
+GST_LOADSAVE_SRC =
+else
+GST_LOADSAVE_SRC = xml-mp3
+endif
+
+EXAMPLES = dynamic $(GNOME) helloworld $(GST_AUTOPLUG_SRC) queue threads $(GST_LOADSAVE_SRC)
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
diff --git a/tests/old/examples/thread/thread.c b/tests/old/examples/thread/thread.c
index 62d4b1071..b16d5aa89 100644
--- a/tests/old/examples/thread/thread.c
+++ b/tests/old/examples/thread/thread.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <gst/gst.h>
/* eos will be called when the src element has an end of stream */
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 1e38f1d45..0c658b5e3 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -7,15 +7,15 @@ endif
if GST_DISABLE_LOADSAVE
GST_LOADSAVE_SRC =
else
-GST_LOADSAVE_SRC = gst-compprep gst-xmllaunch
+GST_LOADSAVE_SRC = gst-compprep gst-xmllaunch gst-complete
endif
bin_PROGRAMS = gst-launch \
$(GST_REGISTRY_SRC) \
gst-inspect \
$(GST_LOADSAVE_SRC) \
- gst-md5sum \
- gst-complete
+ gst-md5sum
+
bin_SCRIPTS = gst-feedback
man_MANS = gst-launch.1 gst-md5sum.1 gst-register.1 gst-inspect.1 \
@@ -30,21 +30,19 @@ gst_md5sum_LDADD = $(GST_LIBS) #-lefence
gst_md5sum_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
+gst_inspect_LDADD = $(GST_LIBS) ../libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la
+gst_inspect_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
+ -DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
+
if !GST_DISABLE_REGISTRY
gst_register_LDADD = $(GST_LIBS)
gst_register_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
-endif
-
-gst_inspect_LDADD = $(GST_LIBS) ../libs/gst/control/libgstcontrol-@GST_MAJORMINOR@.la
-gst_inspect_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
- -DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
gst_complete_LDADD = $(GST_LIBS)
gst_complete_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
-if !GST_DISABLE_LOADSAVE
gst_compprep_LDADD = $(GST_LIBS)
gst_compprep_CFLAGS = $(GST_CFLAGS) -DGST_CONFIG_DIR=\"$(GST_CONFIG_DIR)\" \
-DGST_CACHE_DIR=\""$(GST_CACHE_DIR)"\"
diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index 89990f274..3dc38bce1 100644
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
@@ -170,6 +170,7 @@ print_query_types (const GstQueryType *types)
static void
print_event_masks (const GstEventMask *masks)
{
+#ifndef GST_DISABLE_ENUMTYPES
GType event_type;
GEnumClass *klass;
GType event_flags;
@@ -213,6 +214,7 @@ print_event_masks (const GstEventMask *masks)
masks++;
}
+#endif
}
static void
@@ -342,8 +344,8 @@ print_element_properties (GstElement *element)
break;
}
default:
- if (param->value_type == GST_TYPE_FILENAME) {
- g_print("%-23.23s Filename", "");
+ if (param->value_type == GST_TYPE_URI) {
+ g_print("%-23.23s URI", "");
}
if (param->value_type == GST_TYPE_CAPS) {
GstCaps *caps = g_value_peek_pointer (&value);
@@ -586,6 +588,7 @@ print_element_info (GstElementFactory *factory)
g_print (" none\n");
}
+#ifndef GST_DISABLE_INDEX
g_print ("\nIndexing capabilities:\n");
if (gst_element_is_indexable (element)) {
g_print (" element can do indexing\n");
@@ -593,6 +596,7 @@ print_element_info (GstElementFactory *factory)
else {
g_print (" none\n");
}
+#endif
g_print ("\nPads:\n");
if (element->numpads) {
@@ -807,6 +811,7 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory) ,factory->details->longname);
}
+#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
@@ -814,6 +819,8 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
+#endif
+#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@@ -821,6 +828,7 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
+#endif
else if (GST_IS_TYPE_FACTORY (feature)) {
GstTypeFactory *factory;
@@ -839,6 +847,7 @@ print_element_list (void)
g_print ("%s: %s: %s\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (factory), factory->longdesc);
}
+#ifndef GST_DISABLE_URI
else if (GST_IS_URI_HANDLER (feature)) {
GstURIHandler *handler;
@@ -847,6 +856,7 @@ print_element_list (void)
GST_PLUGIN_FEATURE_NAME (handler), handler->uri, handler->longdesc,
handler->element, handler->property);
}
+#endif
else {
g_print ("%s: %s (%s)\n", plugin->name,
GST_PLUGIN_FEATURE_NAME (feature),
@@ -891,6 +901,7 @@ print_plugin_info (GstPlugin *plugin)
factory->details->longname);
num_elements++;
}
+#ifndef GST_DISABLE_AUTOPLUG
else if (GST_IS_AUTOPLUG_FACTORY (feature)) {
GstAutoplugFactory *factory;
@@ -898,6 +909,8 @@ print_plugin_info (GstPlugin *plugin)
g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
num_autoplug++;
}
+#endif
+#ifndef GST_DISABLE_INDEX
else if (GST_IS_INDEX_FACTORY (feature)) {
GstIndexFactory *factory;
@@ -905,6 +918,7 @@ print_plugin_info (GstPlugin *plugin)
g_print (" %s: %s\n", GST_OBJECT_NAME (factory), factory->longdesc);
num_indexes++;
}
+#endif
else if (GST_IS_TYPE_FACTORY (feature)) {
GstTypeFactory *factory;
@@ -997,26 +1011,32 @@ main (int argc, char *argv[])
g_print ("%s: a scheduler\n", argv[1]);
return 0;
}
+#ifndef GST_DISABLE_INDEX
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_INDEX_FACTORY);
if (feature) {
g_print ("%s: an index\n", argv[1]);
return 0;
}
+#endif
+#ifndef GST_DISABLE_AUTOPLUG
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_AUTOPLUG_FACTORY);
if (feature) {
g_print ("%s: an autoplugger\n", argv[1]);
return 0;
}
+#endif
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_TYPE_FACTORY);
if (feature) {
g_print ("%s: an type\n", argv[1]);
return 0;
}
+#ifndef GST_DISABLE_URI
feature = gst_registry_pool_find_feature (argv[1], GST_TYPE_URI_HANDLER);
if (feature) {
g_print ("%s: an uri handler\n", argv[1]);
return 0;
}
+#endif
}
} else {
/* strip the .so */
diff --git a/tools/gst-launch.c b/tools/gst-launch.c
index 6a551770f..d237f2a34 100644
--- a/tools/gst-launch.c
+++ b/tools/gst-launch.c
@@ -42,6 +42,7 @@ idle_func (gpointer data)
return busy;
}
+#ifndef GST_DISABLE_LOADSAVE
static GstElement*
xmllaunch_parse_cmdline (const gchar **argv)
{
@@ -105,6 +106,7 @@ xmllaunch_parse_cmdline (const gchar **argv)
else
return l->data;
}
+#endif
extern volatile gboolean glib_on_error_halt;
static void fault_restore(void);
@@ -191,8 +193,10 @@ main(int argc, char *argv[])
"output status information and property notifications", NULL},
{"exclude", 'X', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, &exclude_args, 0,
"do not output status information of TYPE", "TYPE1,TYPE2,..."},
+#ifndef GST_DISABLE_LOADSAVE
{"output", 'o', POPT_ARG_STRING|POPT_ARGFLAG_STRIP, &savefile, 0,
"save xml representation of pipeline to FILE and exit", "FILE"},
+#endif
{"no_fault", 'f', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &no_fault, 0,
"Do not install a fault handler", NULL},
{"trace", 't', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &trace, 0,
@@ -224,9 +228,13 @@ main(int argc, char *argv[])
/* make a null-terminated version of argv */
argvn = g_new0 (char*, argc);
memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
+#ifndef GST_DISABLE_LOADSAVE
if (strstr (argv[0], "gst-xmllaunch")) {
pipeline = xmllaunch_parse_cmdline ((const gchar**)argvn);
- } else {
+ }
+ else
+#endif
+ {
pipeline = (GstElement*) gst_parse_launchv ((const gchar**)argvn, &error);
}
g_free (argvn);