Commit b030b5ce authored by Wim Taymans's avatar Wim Taymans

- 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
parent 136e5d25
......@@ -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"
......
......@@ -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
......@@ -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
......
#include <stdlib.h>
#include <gst/gst.h>
int
......
......@@ -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)
......
#include <stdlib.h>
#include <gst/gst.h>
/* eos will be called when the src element has an end of stream */
......
......@@ -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
......
......@@ -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);
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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);
......