diff --git a/gst/Makefile.am b/gst/Makefile.am index 7e6d74e6de..da6c2c49b5 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -160,6 +160,7 @@ libgstincludedir = $(includedir)/gst libgstinclude_HEADERS = \ cothreads.h \ gst.h \ + gstconfig.h \ $(GST_OBJECT_MODEL_HDR) \ gstobject.h \ gsttypes.h \ diff --git a/gst/autoplug/gstautoplugger.c b/gst/autoplug/gstautoplugger.c index 68ed930915..6138ff3657 100644 --- a/gst/autoplug/gstautoplugger.c +++ b/gst/autoplug/gstautoplugger.c @@ -430,7 +430,7 @@ gst_autoplugger_cache_empty(GstElement *element, GstAutoplugger *autoplugger) // try to PLAY the whole thing gst_element_set_state(GST_ELEMENT_SCHED(autoplugger)->parent,GST_STATE_PLAYING); - xmlSaveFile("autoplugger.gst", gst_xml_write(GST_ELEMENT_SCHED(autoplugger)->parent)); +// xmlSaveFile("autoplugger.gst", gst_xml_write(GST_ELEMENT_SCHED(autoplugger)->parent)); GST_INFO(GST_CAT_AUTOPLUG, "autoplugger_cache_empty finished"); } diff --git a/gst/gstautoplug.c b/gst/gstautoplug.c index 3904845f58..20377fda36 100644 --- a/gst/gstautoplug.c +++ b/gst/gstautoplug.c @@ -21,6 +21,9 @@ */ //#define GST_DEBUG_ENABLED + +#include + #include "gst_private.h" #include "gstautoplug.h" @@ -167,8 +170,10 @@ gst_autoplug_to_renderers (GstAutoplug *autoplug, GstCaps *srccaps, GstElement * static void gst_autoplugfactory_class_init (GstAutoplugFactoryClass *klass); static void gst_autoplugfactory_init (GstAutoplugFactory *factory); +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_autoplugfactory_save_thyself (GstObject *object, xmlNodePtr parent); static void gst_autoplugfactory_restore_thyself (GstObject *object, xmlNodePtr parent); +#endif static GstPluginFeatureClass *factory_parent_class = NULL; //static guint gst_autoplugfactory_signals[LAST_SIGNAL] = { 0 }; @@ -209,8 +214,10 @@ gst_autoplugfactory_class_init (GstAutoplugFactoryClass *klass) factory_parent_class = g_type_class_ref (GST_TYPE_PLUGIN_FEATURE); +#ifndef GST_DISABLE_LOADSAVE gstobject_class->save_thyself = GST_DEBUG_FUNCPTR (gst_autoplugfactory_save_thyself); gstobject_class->restore_thyself = GST_DEBUG_FUNCPTR (gst_autoplugfactory_restore_thyself); +#endif _gst_autoplugfactories = NULL; } @@ -359,6 +366,7 @@ gst_autoplugfactory_make (const gchar *name) return gst_autoplugfactory_create (factory);; } +#ifndef GST_DISABLE_LOADSAVE static xmlNodePtr gst_autoplugfactory_save_thyself (GstObject *object, xmlNodePtr parent) { @@ -405,3 +413,4 @@ gst_autoplugfactory_restore_thyself (GstObject *object, xmlNodePtr parent) children = children->next; } } +#endif diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 70628baee4..c4794623e1 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -444,8 +444,6 @@ gst_buffer_span (GstBuffer *buf1, guint32 offset, GstBuffer *buf2, guint32 len) } // if the two buffers have the same parent and are adjacent -// if ((buf1->parent == buf2->parent) && -// ((buf1->data + buf1->size) == buf2->data)) { if (gst_buffer_is_span_fast(buf1,buf2)) { // we simply create a subbuffer of the common parent newbuf = gst_buffer_create_sub (buf1->parent, buf1->data - (buf1->parent->data) + offset, len); diff --git a/gst/gstcaps.h b/gst/gstcaps.h index 87482751be..77a8767d98 100644 --- a/gst/gstcaps.h +++ b/gst/gstcaps.h @@ -24,14 +24,7 @@ #ifndef __GST_CAPS_H__ #define __GST_CAPS_H__ -#include // NOTE: this is xml-config's fault - -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif +#include #include @@ -118,7 +111,9 @@ GstCaps* gst_caps_prepend (GstCaps *caps, GstCaps *capstoadd); gboolean gst_caps_check_compatibility (GstCaps *fromcaps, GstCaps *tocaps); +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_caps_save_thyself (GstCaps *caps, xmlNodePtr parent); GstCaps* gst_caps_load_thyself (xmlNodePtr parent); +#endif #endif /* __GST_CAPS_H__ */ diff --git a/gst/gstconfig.h b/gst/gstconfig.h new file mode 100644 index 0000000000..ea0629330e --- /dev/null +++ b/gst/gstconfig.h @@ -0,0 +1,36 @@ +/* This header interprets the various GST_* macros that are typically * + * provided by the gstreamer-config or gstreamer.pc files. */ + +#ifndef __GST_CONFIG_H__ +#define __GST_CONFIG_H__ + + +/***** We include config.h in case someone perhaps used a gstreamer.m4 or + something else that provides funky overrides. BEWARE! *****/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + + +/***** Deal with XML stuff, we have to handle both loadsave and registry *****/ + +// TEMPORARY!! +#define GST_DISABLE_LOADSAVE +#define GST_DISABLE_REGISTRY + +#if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) ) + #include + + // Include compatability defines: if libxml hasn't already defined these, + // we have an old version 1.x + #ifndef xmlChildrenNode + #define xmlChildrenNode childs + #define xmlRootNode root + #endif + +#else + #define GST_DISABLE_LOADSAVE_REGISTRY +#endif + +#endif /* __GST_CONFIG_H__ */ diff --git a/gst/gstelement.h b/gst/gstelement.h index 313ca9e3df..d7ceb7a914 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -24,14 +24,7 @@ #ifndef __GST_ELEMENT_H__ #define __GST_ELEMENT_H__ -#include // NOTE: this is xml-config's fault - -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif +#include #include #include @@ -234,8 +227,10 @@ void gst_element_error (GstElement *element, const gchar *error); GstElementFactory* gst_element_get_factory (GstElement *element); +#ifndef GST_DISABLE_LOADSAVE /* XML write and read */ GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent); +#endif /* diff --git a/gst/gstobject.h b/gst/gstobject.h index e3b25b352e..413cf4db96 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -24,10 +24,7 @@ #ifndef __GST_OBJECT_H__ #define __GST_OBJECT_H__ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - +#include #ifdef USE_GLIB2 #include // note that this gets wrapped in __GST_OBJECT_H__ @@ -36,15 +33,13 @@ #include #endif -#include -#include - -#include - #ifdef HAVE_ATOMIC_H #include #endif +#include +#include + // FIXME #include "gstlog.h" @@ -107,13 +102,17 @@ struct _GstObjectClass { /* signals */ void (*parent_set) (GstObject *object, GstObject *parent); +#ifndef GST_DISABLE_LOADSAVE void (*object_saved) (GstObject *object, xmlNodePtr parent); +#endif /* functions go here */ void (*destroy) (GstObject *object); +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent); void (*restore_thyself) (GstObject *object, xmlNodePtr self); +#endif }; #define GST_FLAGS(obj) (GST_OBJECT (obj)->flags) @@ -153,6 +152,7 @@ xmlNodePtr gst_object_save_thyself (GstObject *object, xmlNodePtr parent); void gst_object_restore_thyself (GstObject *object, xmlNodePtr parent); #else #pragma GCC poison gst_object_save_thyself +#pragma GCC poison gst_object_restore_thyself #endif /* refcounting */ diff --git a/gst/gstpad.h b/gst/gstpad.h index 3ca0649ec1..a93ed0146a 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -24,14 +24,7 @@ #ifndef __GST_PAD_H__ #define __GST_PAD_H__ -#include // NOTE: This is xml-config's fault - -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif +#include #include #include @@ -424,7 +417,9 @@ GstBuffer* gst_pad_peek (GstPad *pad); GstPad* gst_pad_select (GList *padlist); GstPad* gst_pad_selectv (GstPad *pad, ...); +#ifndef GST_DISABLE_LOADSAVE void gst_pad_load_and_connect (xmlNodePtr self, GstObject *parent); +#endif /* ghostpads */ @@ -441,8 +436,10 @@ GstPadTemplate* gst_padtemplate_new (gchar *name_template, GstCaps* gst_padtemplate_get_caps (GstPadTemplate *templ); GstCaps* gst_padtemplate_get_caps_by_name (GstPadTemplate *templ, const gchar *name); +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_padtemplate_save_thyself (GstPadTemplate *templ, xmlNodePtr parent); GstPadTemplate* gst_padtemplate_load_thyself (xmlNodePtr parent); +#endif #ifdef __cplusplus diff --git a/gst/gstplugin.h b/gst/gstplugin.h index e678f58a3b..58eb018f2e 100644 --- a/gst/gstplugin.h +++ b/gst/gstplugin.h @@ -24,15 +24,9 @@ #ifndef __GST_PLUGIN_H__ #define __GST_PLUGIN_H__ -#include -#include // NOTE: this is xml-config's fault +#include -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif +#include #include diff --git a/gst/gstprops.h b/gst/gstprops.h index 1d7730994a..9fc6dce2e3 100644 --- a/gst/gstprops.h +++ b/gst/gstprops.h @@ -24,16 +24,9 @@ #ifndef __GST_PROPS_H__ #define __GST_PROPS_H__ +#include + #include -#include // NOTE: this is xml-config's fault - -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif - typedef struct _GstProps GstProps; @@ -95,7 +88,9 @@ gulong gst_props_get_fourcc_int (GstProps *props, const gchar *name); gboolean gst_props_get_boolean (GstProps *props, const gchar *name); const gchar* gst_props_get_string (GstProps *props, const gchar *name); +#ifndef GST_DISABLE_LOADSAVE xmlNodePtr gst_props_save_thyself (GstProps *props, xmlNodePtr parent); GstProps* gst_props_load_thyself (xmlNodePtr parent); +#endif #endif /* __GST_PROPS_H__ */ diff --git a/gst/gstxml.h b/gst/gstxml.h index f3fd8d0437..b66aba2608 100644 --- a/gst/gstxml.h +++ b/gst/gstxml.h @@ -23,17 +23,10 @@ #ifndef __GST_XML_H__ #define __GST_XML_H__ +#include + #ifndef GST_DISABLE_LOADSAVE -#include - -// Include compatability defines: if libxml hasn't already defined these, -// we have an old version 1.x -#ifndef xmlChildrenNode -#define xmlChildrenNode childs -#define xmlRootNode root -#endif - #include #ifdef __cplusplus