From 91d7e800d5cb3b28c2440bdbe946baa3eab6288b Mon Sep 17 00:00:00 2001 From: Erik Walthinsen Date: Mon, 25 Jun 2001 06:45:56 +0000 Subject: [PATCH] Reworked the arguments for DEBUG and INFO. Removed -debug-verbose. Original commit message from CVS: Reworked the arguments for DEBUG and INFO. Removed -debug-verbose. Renamed GST_DISABLE_XML to GST_DISABLE_LOADSAVE and added --disable flag. --- acconfig.h | 4 +-- autogen.sh | 2 +- configure.base | 79 ++++++++++++++++++++--------------------- gst/Makefile.am | 8 ++++- gst/gstbin.c | 8 ++--- gst/gstelement.c | 8 ++--- gst/gstelementfactory.c | 2 -- gst/gstinfo.c | 4 --- gst/gstobject.c | 20 +++++------ gst/gstobject.h | 11 +++--- gst/gstpad.c | 12 +++---- gst/gstprops.c | 2 -- gst/gstthread.c | 8 ++--- gst/gstxml.h | 14 ++++++++ 14 files changed, 98 insertions(+), 84 deletions(-) diff --git a/acconfig.h b/acconfig.h index c9b1b8aeac..a964fa97a6 100644 --- a/acconfig.h +++ b/acconfig.h @@ -50,6 +50,6 @@ #undef GST_DEBUG_ENABLED #undef GST_INFO_ENABLED -#undef GST_INFO_ENABLED_VERBOSE -#undef GST_INFO_FORCE_DISABLE #undef GST_DEBUG_COLOR + +#undef GST_DISABLE_LOADSAVE diff --git a/autogen.sh b/autogen.sh index bcd79c503f..1a1f63bb9c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -185,7 +185,7 @@ rm -f config.cache # The new configure options for busy application developers (Hadess) #./configure --enable-maintainer-mode --enable-debug --enable-debug-verbose -./configure --enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-debug-verbose "$@" || { +./configure --enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG "$@" || { echo echo "configure failed" exit 1 diff --git a/configure.base b/configure.base index 1d41064d8b..989ba4f51b 100644 --- a/configure.base +++ b/configure.base @@ -828,41 +828,41 @@ AC_ARG_ENABLE(debug, esac], [USE_DEBUG=no]) dnl Default value -AC_ARG_ENABLE(debug-verbose, -[ --enable-debug-verbose spews lots of useless debugging info at runtime], +AC_ARG_ENABLE(DEBUG, +[ --enable-DEBUG compiles in a large number of debugging messages], [case "${enableval}" in - yes) USE_DEBUG_VERBOSE=yes ;; - no) USE_DEBUG_VERBOSE=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-verbose) ;; + yes) ENABLE_DEBUG=yes ;; + no) ENABLE_DEBUG=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;; esac], -[USE_DEBUG_VERBOSE=no]) dnl Default value +[ENABLE_DEBUG=no]) dnl Default value +if test x$ENABLE_DEBUG = xyes; then + AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in]) +fi -AC_ARG_ENABLE(info, -[ --enable-info turns verbose info at runtime on by default], +AC_ARG_ENABLE(INFO, +[ --disable-INFO disables compilation of informational messages], [case "${enableval}" in - yes) USE_DEBUG_INFO_VERBOSE=yes ;; - no) USE_DEBUG_INFO_VERBOSE=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-info) ;; + yes) ENABLE_INFO=yes ;; + no) ENABLE_INFO=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;; esac], -[USE_DEBUG_INFO_VERBOSE=no]) dnl Default value - -AC_ARG_ENABLE(info-system, -[ --disable-info-system entirely disables the info debugging system], -[case "${enableval}" in - yes) DISABLE_DEBUG_INFO=no ;; - no) DISABLE_DEBUG_INFO=yes ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-info) ;; -esac], -[DISABLE_DEBUG_INFO=no]) dnl Default value +[ENABLE_INFO=yes]) dnl Default value +if test x$ENABLE_INFO = xyes; then + AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in]) +fi AC_ARG_ENABLE(debug-color, [ --disable-debug-color disables color output of DEBUG and INFO output], [case "${enableval}" in - yes) DISABLE_DEBUG_COLOR=no ;; - no) DISABLE_DEBUG_COLOR=yes ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-info) ;; + yes) ENABLE_DEBUG_COLOR=yes ;; + no) ENABLE_DEBUG_COLOR=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;; esac], -[DISABLE_DEBUG_COLOR=no]) dnl Default value +[ENABLE_DEBUG_COLOR=yes]) dnl Default value +if test "x$ENABLE_DEBUG_COLOR" = xyes; then + AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized]) +fi AC_ARG_ENABLE(profiling, [ --enable-profiling adds -pg to compiler commandline, for profiling], @@ -932,6 +932,20 @@ AC_ARG_ENABLE(examples, esac], [BUILD_EXAMPLES=yes]) dnl Default value +AC_ARG_ENABLE(loadsave, +[ --disable-loadsave disable pipeline XML load/save code], +[case "${enableval}" in + yes) GST_DISABLE_LOADSAVE=no ;; + no) GST_DISABLE_LOADSAVE=yes ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-loadsave) ;; +esac], +[GST_DISABLE_LOADSAVE=no]) dnl Default value +if test x$GST_DISABLE_LOADSAVE = xyes; then + AC_DEFINE(GST_DISABLE_LOADSAVE, 1, [Disable pipeline XML load/save code.]) +fi +AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test x$GST_DISABLE_LOADSAVE = xyes) + + dnl ################################################ dnl # Set defines according to variables set above # @@ -964,21 +978,6 @@ if test "x$USE_DEBUG" = xyes; then CFLAGS="$CFLAGS -g" fi -if test "x$USE_DEBUG_VERBOSE" = xyes; then - AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if code to assist debugging should be compiled in]) -fi - -if test "x$DISABLE_DEBUG_INFO" = xno; then - AC_DEFINE(GST_INFO_ENABLED, 1, [Define if code to produce informative messages should be compiled]) - if test "x$USE_DEBUG_INFO_VERBOSE" = xyes; then - AC_DEFINE(GST_INFO_ENABLED_VERBOSE, 1, [Define if default should be to display all informative messages]) - fi -fi - -if test "x$DISABLE_DEBUG_COLOR" = xno; then - AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorised]) -fi - if test "x$USE_PROFILING" = xyes; then CFLAGS="$CFLAGS -pg" FOMIT_FRAME_POINTER="" diff --git a/gst/Makefile.am b/gst/Makefile.am index 790a0cc3d6..64833c5201 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -20,6 +20,12 @@ GST_OBJECT_MODEL_SRC = gobject2gtk.c GST_OBJECT_MODEL_HDR = gobject2gtk.h endif +if GST_DISABLE_LOADSAVE +GST_LOADSAVE_SRC = +else +GST_LOADSAVE_SRC = gstxml.c +endif + libgst_la_SOURCES = \ cothreads.c \ gst.c \ @@ -50,7 +56,7 @@ libgst_la_SOURCES = \ gstutils.c \ gstparse.c \ $(GSTARCH_SRCS) \ - gstxml.c + $(GST_LOADSAVE_SRC) ##### Oh this sucks so badly. This isn't funny. ##### diff --git a/gst/gstbin.c b/gst/gstbin.c index 58a66d6aa9..e73f045906 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -48,7 +48,7 @@ static gboolean gst_bin_change_state_type (GstBin *bin, static gboolean gst_bin_iterate_func (GstBin *bin); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_bin_save_thyself (GstObject *object, xmlNodePtr parent); static void gst_bin_restore_thyself (GstObject *object, xmlNodePtr self); #endif @@ -116,7 +116,7 @@ gst_bin_class_init (GstBinClass *klass) klass->change_state_type = gst_bin_change_state_type; klass->iterate = gst_bin_iterate_func; -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gstobject_class->save_thyself = gst_bin_save_thyself; gstobject_class->restore_thyself = gst_bin_restore_thyself; #endif @@ -596,7 +596,7 @@ gst_bin_get_list (GstBin *bin) return bin->children; } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_bin_save_thyself (GstObject *object, xmlNodePtr parent) @@ -648,7 +648,7 @@ gst_bin_restore_thyself (GstObject *object, field = field->next; } } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE /** diff --git a/gst/gstelement.c b/gst/gstelement.c index 15d4f0a2d0..2b07591f9b 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -59,7 +59,7 @@ static void gst_element_real_destroy (GObject *object); static GstElementStateReturn gst_element_change_state (GstElement *element); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_element_save_thyself (GstObject *object, xmlNodePtr parent); GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent); #endif @@ -141,7 +141,7 @@ gst_element_class_init (GstElementClass *klass) // FIXME! // gobject_class->destroy = GST_DEBUG_FUNCPTR(gst_element_real_destroy); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_element_save_thyself); gstobject_class->restore_thyself = GST_DEBUG_FUNCPTR(gst_element_restore_thyself); #endif @@ -953,7 +953,7 @@ static gchar *_gst_element_type_names[] = { }; */ -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE /** * gst_element_save_thyself: * @element: GstElement to save @@ -1155,7 +1155,7 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent) return element; } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE /** * gst_element_set_sched: diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index 62e207290f..3f9d9162d7 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -287,7 +287,6 @@ gst_elementfactory_can_sink_caps (GstElementFactory *factory, return FALSE; } -#ifndef GST_DISABLE_XML /** * gst_elementfactory_save_thyself: * @factory: factory to save @@ -381,4 +380,3 @@ gst_elementfactory_load_thyself (xmlNodePtr parent) return factory; } -#endif // GST_DISABLE_XML diff --git a/gst/gstinfo.c b/gst/gstinfo.c index d5d4480844..c3dfffd7a3 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -238,11 +238,7 @@ gst_debug_disable_category (gint category) { /***** INFO system *****/ GstInfoHandler _gst_info_handler = gst_default_info_handler; -#ifdef GST_INFO_ENABLED_VERBOSE -guint32 _gst_info_categories = 0xffffffff; -#else guint32 _gst_info_categories = 0x00000001; -#endif /** diff --git a/gst/gstobject.c b/gst/gstobject.c index 2463e86fc4..25fe786600 100644 --- a/gst/gstobject.c +++ b/gst/gstobject.c @@ -27,7 +27,7 @@ /* Object signals and args */ enum { PARENT_SET, -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE OBJECT_SAVED, #endif LAST_SIGNAL @@ -98,7 +98,7 @@ gst_object_class_init (GstObjectClass *klass) G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL, g_cclosure_marshal_VOID__OBJECT,G_TYPE_NONE,1, G_TYPE_OBJECT); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gst_object_signals[OBJECT_SAVED] = g_signal_newc("object_saved", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, object_saved), NULL, NULL, @@ -467,7 +467,7 @@ gst_object_check_uniqueness (GList *list, const gchar *name) } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE /** * gst_object_save_thyself: @@ -492,14 +492,14 @@ gst_object_save_thyself (GstObject *object, xmlNodePtr parent) if (oclass->save_thyself) oclass->save_thyself (object, parent); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE g_signal_emit (G_OBJECT (object), gst_object_signals[OBJECT_SAVED], 0, parent); #endif return parent; } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE /** * gst_object_get_path_string: @@ -580,9 +580,9 @@ struct _GstSignalObjectClass { GObjectClass parent_class; /* signals */ -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE void (*object_loaded) (GstSignalObject *object, GstObject *new, xmlNodePtr self); -#endif GST_DISABLE_XML +#endif GST_DISABLE_LOADSAVE }; static GType @@ -616,7 +616,7 @@ gst_signal_object_class_init (GstSignalObjectClass *klass) parent_class = g_type_class_ref (G_TYPE_OBJECT); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gst_signal_object_signals[SO_OBJECT_LOADED] = g_signal_newc("object_loaded", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstObjectClass, parent_set), NULL, NULL, @@ -650,7 +650,7 @@ gst_class_signal_connect (GstObjectClass *klass, return g_signal_connectc (klass->signal_object, name, func, func_data, FALSE); } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE /** * gst_class_signal_emit_by_name: * @object: the object that sends the signal @@ -671,4 +671,4 @@ gst_class_signal_emit_by_name (GstObject *object, g_signal_emit_by_name (oclass->signal_object, name, object, self); } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE diff --git a/gst/gstobject.h b/gst/gstobject.h index ed6c6df354..d3c9ce87b7 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -103,14 +103,14 @@ struct _GstObjectClass { /* signals */ void (*parent_set) (GstObject *object, GstObject *parent); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE void (*object_saved) (GstObject *object, xmlNodePtr parent); #endif /* functions go here */ void (*destroy) (GstObject *object); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent); void (*restore_thyself) (GstObject *object, xmlNodePtr self); #endif @@ -149,8 +149,10 @@ void gst_object_unparent (GstObject *object); gboolean gst_object_check_uniqueness (GList *list, const gchar *name); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_object_save_thyself (GstObject *object, xmlNodePtr parent); +#else +#pragma GCC poison gst_object_save_thyself #endif /* refcounting */ @@ -169,10 +171,11 @@ guint gst_class_signal_connect (GstObjectClass *klass, gpointer func, gpointer func_data); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE void gst_class_signal_emit_by_name (GstObject *object, const gchar *name, xmlNodePtr self); +#pragma GCC poison gst_class_signal_emit_by_name #endif diff --git a/gst/gstpad.c b/gst/gstpad.c index 2bdd4f7fe7..53653beec0 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -34,7 +34,7 @@ static void gst_pad_class_init (GstPadClass *klass); static void gst_pad_init (GstPad *pad); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_pad_save_thyself (GstObject *object, xmlNodePtr parent); #endif @@ -178,7 +178,7 @@ gst_real_pad_class_init (GstRealPadClass *klass) g_param_spec_boolean("active","Active","Whether the pad is active.", TRUE,G_PARAM_READWRITE)); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_pad_save_thyself); #endif gstobject_class->path_string_separator = "."; @@ -1091,7 +1091,7 @@ gst_real_pad_destroy (GObject *object) } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE /** * gst_pad_load_and_connect: * @self: the XML node to read the description from @@ -1148,7 +1148,7 @@ gst_pad_load_and_connect (xmlNodePtr self, cleanup: g_strfreev (split); } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE static gboolean gst_pad_renegotiate_func (GstPad *pad, gpointer *data1, GstPad *peerpad, gpointer *data2, GstCaps **newcaps) @@ -1396,7 +1396,7 @@ gst_pad_negotiate_proxy (GstPad *srcpad, GstPad *destpad, GstCaps **caps) return GST_PAD_NEGOTIATE_AGREE; } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE /** * gst_pad_save_thyself: * @pad: the pad to save @@ -1457,7 +1457,7 @@ gst_pad_ghost_save_thyself (GstPad *pad, return self; } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE #ifndef gst_pad_push /** diff --git a/gst/gstprops.c b/gst/gstprops.c index 97dec7c24d..4f73d87bd9 100644 --- a/gst/gstprops.c +++ b/gst/gstprops.c @@ -986,7 +986,6 @@ end: return compatible; } -#ifndef GST_DISABLE_XML static xmlNodePtr gst_props_save_thyself_func (GstPropsEntry *entry, xmlNodePtr parent) { @@ -1241,4 +1240,3 @@ gst_props_load_thyself (xmlNodePtr parent) return props; } -#endif // GST_DISABLE_XML diff --git a/gst/gstthread.c b/gst/gstthread.c index 983a30042e..8d297d0e6f 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -68,7 +68,7 @@ static void gst_thread_get_property (GObject *object, guint prop_id, GValue * static GstElementStateReturn gst_thread_change_state (GstElement *element); -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_thread_save_thyself (GstObject *object, xmlNodePtr parent); static void gst_thread_restore_thyself (GstObject *object, xmlNodePtr self); #endif @@ -123,7 +123,7 @@ gst_thread_class_init (GstThreadClass *klass) // FIXME! // gobject_class->destroy = gst_thread_real_destroy; -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE gstobject_class->save_thyself = gst_thread_save_thyself; gstobject_class->restore_thyself = gst_thread_restore_thyself; #endif @@ -674,7 +674,7 @@ gst_thread_signal_thread (GstThread *thread, gboolean spinning) } -#ifndef GST_DISABLE_XML +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_thread_save_thyself (GstObject *object, xmlNodePtr self) @@ -693,4 +693,4 @@ gst_thread_restore_thyself (GstObject *object, if (GST_OBJECT_CLASS (parent_class)->restore_thyself) GST_OBJECT_CLASS (parent_class)->restore_thyself (object, self); } -#endif // GST_DISABLE_XML +#endif // GST_DISABLE_LOADSAVE diff --git a/gst/gstxml.h b/gst/gstxml.h index 35528cea9b..f3fd8d0437 100644 --- a/gst/gstxml.h +++ b/gst/gstxml.h @@ -23,6 +23,8 @@ #ifndef __GST_XML_H__ #define __GST_XML_H__ +#ifndef GST_DISABLE_LOADSAVE + #include // Include compatability defines: if libxml hasn't already defined these, @@ -88,4 +90,16 @@ GList* gst_xml_get_topelements (GstXML *xml); } #endif /* __cplusplus */ +#else // GST_DISABLE_LOADSAVE + +#pragma GCC poison gst_xml_write +#pragma GCC poison gst_xml_new +#pragma GCC poison gst_xml_parse_doc +#pragma GCC poison gst_xml_parse_file +#pragma GCC poison gst_xml_parse_memory +#pragma GCC poison gst_xml_get_element +#pragma GCC poison gst_xml_get_topelements + +#endif // GST_DISABLE_LOADSAVE + #endif /* __GST_XML_H__ */