Commit 27036196 authored by Erik Walthinsen's avatar Erik Walthinsen
Browse files

initial pass at #ifdef'ing xml load/save

Original commit message from CVS:
initial pass at #ifdef'ing xml load/save
parent f19c6342
......@@ -39,9 +39,9 @@ libgst_la_SOURCES = \
gsttype.c \
gsttypefind.c \
gstutils.c \
gstxml.c \
gstparse.c \
$(GSTARCH_SRCS)
$(GSTARCH_SRCS) \
gstxml.c
##### Oh this sucks so badly. This isn't funny. #####
......@@ -117,8 +117,8 @@ libgstinclude_HEADERS = \
gsttypefind.h \
gstutils.h \
gstparse.h \
gstxml.h \
gstversion.h
gstversion.h \
gstxml.h
noinst_HEADERS = \
gst_private.h \
......
......@@ -59,8 +59,6 @@ gst_init (int *argc, char **argv[])
GstTrace *gst_trace;
gchar *display;
GST_INFO (GST_CAT_GST_INIT, "Initializing GStreamer Core Library");
if (!g_thread_supported ()) g_thread_init (NULL);
/* Only initialise gtk fully if we have an X display.
......@@ -75,9 +73,11 @@ gst_init (int *argc, char **argv[])
}
if (!gst_init_check (argc,argv)) {
exit (0);
exit (0); // FIXME!
}
GST_INFO (GST_CAT_GST_INIT, "Initializing GStreamer Core Library");
_gst_cpu_initialize ();
_gst_type_initialize ();
_gst_props_initialize ();
......@@ -134,7 +134,7 @@ gst_init_check (int *argc,
gboolean showhelp = FALSE;
_gst_progname = NULL;
if (argc && argv) {
gint i, j, k;
......
......@@ -357,4 +357,3 @@ gst_autoplugfactory_load_thyself (xmlNodePtr parent)
return factory;
}
......@@ -48,8 +48,10 @@ static gboolean gst_bin_change_state_type (GstBin *bin,
static gboolean gst_bin_iterate_func (GstBin *bin);
#ifndef GST_DISABLE_XML
static xmlNodePtr gst_bin_save_thyself (GstObject *object, xmlNodePtr parent);
static void gst_bin_restore_thyself (GstObject *object, xmlNodePtr self);
#endif
/* Bin signals and args */
enum {
......@@ -114,8 +116,10 @@ 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
gstobject_class->save_thyself = gst_bin_save_thyself;
gstobject_class->restore_thyself = gst_bin_restore_thyself;
#endif
gstelement_class->change_state = gst_bin_change_state;
......@@ -590,6 +594,7 @@ gst_bin_get_list (GstBin *bin)
return bin->children;
}
#ifndef GST_DISABLE_XML
static xmlNodePtr
gst_bin_save_thyself (GstObject *object,
xmlNodePtr parent)
......@@ -641,6 +646,7 @@ gst_bin_restore_thyself (GstObject *object,
field = field->next;
}
}
#endif // GST_DISABLE_XML
/**
......
......@@ -623,6 +623,3 @@ gst_caps_load_thyself (xmlNodePtr parent)
return result;
}
......@@ -59,8 +59,10 @@ static void gst_element_real_destroy (GtkObject *object);
static GstElementStateReturn gst_element_change_state (GstElement *element);
GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent);
#ifndef GST_DISABLE_XML
static xmlNodePtr gst_element_save_thyself (GstObject *object, xmlNodePtr parent);
GstElement* gst_element_restore_thyself (xmlNodePtr self, GstObject *parent);
#endif
static GstObjectClass *parent_class = NULL;
static guint gst_element_signals[LAST_SIGNAL] = { 0 };
......@@ -138,8 +140,10 @@ gst_element_class_init (GstElementClass *klass)
gtkobject_class->shutdown = GST_DEBUG_FUNCPTR(gst_element_shutdown);
gtkobject_class->destroy = GST_DEBUG_FUNCPTR(gst_element_real_destroy);
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_element_save_thyself);
gstobject_class->restore_thyself = GST_DEBUG_FUNCPTR(gst_element_restore_thyself);
#endif
klass->change_state = GST_DEBUG_FUNCPTR(gst_element_change_state);
klass->elementfactory = NULL;
......@@ -947,6 +951,7 @@ static gchar *_gst_element_type_names[] = {
};
*/
#ifndef GST_DISABLE_XML
/**
* gst_element_save_thyself:
* @element: GstElement to save
......@@ -1146,6 +1151,7 @@ gst_element_restore_thyself (xmlNodePtr self, GstObject *parent)
return element;
}
#endif // GST_DISABLE_XML
/**
* gst_element_set_sched:
......
......@@ -287,6 +287,7 @@ gst_elementfactory_can_sink_caps (GstElementFactory *factory,
return FALSE;
}
#ifndef GST_DISABLE_XML
/**
* gst_elementfactory_save_thyself:
* @factory: factory to save
......@@ -380,4 +381,4 @@ gst_elementfactory_load_thyself (xmlNodePtr parent)
return factory;
}
#endif // GST_DISABLE_XML
......@@ -27,7 +27,9 @@
/* Object signals and args */
enum {
PARENT_SET,
#ifndef GST_DISABLE_XML
OBJECT_SAVED,
#endif
LAST_SIGNAL
};
......@@ -100,11 +102,13 @@ gst_object_class_init (GstObjectClass *klass)
GTK_SIGNAL_OFFSET (GstObjectClass, parent_set),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GST_TYPE_OBJECT);
#ifndef GST_DISABLE_XML
gst_object_signals[OBJECT_SAVED] =
gtk_signal_new ("object_saved", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstObjectClass, object_saved),
gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1,
GTK_TYPE_POINTER);
#endif
gtk_object_class_add_signals (gtkobject_class, gst_object_signals, LAST_SIGNAL);
klass->path_string_separator = "/";
......@@ -474,6 +478,8 @@ gst_object_check_uniqueness (GList *list, const gchar *name)
}
#ifndef GST_DISABLE_XML
/**
* gst_object_save_thyself:
* @object: GstObject to save
......@@ -497,11 +503,15 @@ gst_object_save_thyself (GstObject *object, xmlNodePtr parent)
if (oclass->save_thyself)
oclass->save_thyself (object, parent);
#ifndef GST_DISABLE_XML
gtk_signal_emit (GTK_OBJECT (object), gst_object_signals[OBJECT_SAVED], parent);
#endif
return parent;
}
#endif // GST_DISABLE_XML
/**
* gst_object_get_path_string:
* @object: GstObject to get the path from
......@@ -581,7 +591,9 @@ struct _GstSignalObjectClass {
GtkObjectClass parent_class;
/* signals */
#ifndef GST_DISABLE_XML
void (*object_loaded) (GstSignalObject *object, GstObject *new, xmlNodePtr self);
#endif GST_DISABLE_XML
};
static GtkType
......@@ -614,12 +626,14 @@ gst_signal_object_class_init (GstSignalObjectClass *klass)
parent_class = gtk_type_class (gtk_object_get_type ());
#ifndef GST_DISABLE_XML
gst_signal_object_signals[SO_OBJECT_LOADED] =
gtk_signal_new ("object_loaded", GTK_RUN_LAST, gtkobject_class->type,
GTK_SIGNAL_OFFSET (GstSignalObjectClass, object_loaded),
gtk_marshal_NONE__POINTER_POINTER, GTK_TYPE_NONE, 2,
GST_TYPE_OBJECT, GTK_TYPE_POINTER);
gtk_object_class_add_signals (gtkobject_class, gst_signal_object_signals, LAST_SIGNAL);
#endif
}
static void
......@@ -647,6 +661,7 @@ gst_class_signal_connect (GstObjectClass *klass,
return gtk_signal_connect (klass->signal_object, name, func, func_data);
}
#ifndef GST_DISABLE_XML
/**
* gst_class_signal_emit_by_name:
* @object: the object that sends the signal
......@@ -666,3 +681,5 @@ gst_class_signal_emit_by_name (GstObject *object,
gtk_signal_emit_by_name (oclass->signal_object, name, object, self);
}
#endif // GST_DISABLE_XML
......@@ -96,13 +96,17 @@ struct _GstObjectClass {
/* signals */
void (*parent_set) (GstObject *object, GstObject *parent);
#ifndef GST_DISABLE_XML
void (*object_saved) (GstObject *object, xmlNodePtr parent);
#endif
/* functions go here */
void (*destroy) (GstObject *object);
#ifndef GST_DISABLE_XML
xmlNodePtr (*save_thyself) (GstObject *object, xmlNodePtr parent);
void (*restore_thyself) (GstObject *object, xmlNodePtr self);
#endif
};
#define GST_FLAGS(obj) (GST_OBJECT (obj)->flags)
......@@ -138,7 +142,9 @@ void gst_object_unparent (GstObject *object);
gboolean gst_object_check_uniqueness (GList *list, const gchar *name);
#ifndef GST_DISABLE_XML
xmlNodePtr gst_object_save_thyself (GstObject *object, xmlNodePtr parent);
#endif
/* refcounting */
GstObject * gst_object_ref (GstObject *object);
......@@ -156,9 +162,11 @@ guint gst_class_signal_connect (GstObjectClass *klass,
GtkSignalFunc func,
gpointer func_data);
#ifndef GST_DISABLE_XML
void gst_class_signal_emit_by_name (GstObject *object,
const gchar *name,
xmlNodePtr self);
#endif
#ifdef __cplusplus
......
......@@ -34,7 +34,9 @@
static void gst_pad_class_init (GstPadClass *klass);
static void gst_pad_init (GstPad *pad);
#ifndef GST_DISABLE_XML
static xmlNodePtr gst_pad_save_thyself (GstObject *object, xmlNodePtr parent);
#endif
static GstObject *pad_parent_class = NULL;
......@@ -171,7 +173,9 @@ gst_real_pad_class_init (GstRealPadClass *klass)
gtkobject_class->set_arg = GST_DEBUG_FUNCPTR(gst_real_pad_set_arg);
gtkobject_class->get_arg = GST_DEBUG_FUNCPTR(gst_real_pad_get_arg);
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = GST_DEBUG_FUNCPTR(gst_pad_save_thyself);
#endif
gstobject_class->path_string_separator = ".";
}
......@@ -1081,6 +1085,7 @@ gst_real_pad_destroy (GtkObject *object)
}
#ifndef GST_DISABLE_XML
/**
* gst_pad_load_and_connect:
* @self: the XML node to read the description from
......@@ -1137,6 +1142,7 @@ gst_pad_load_and_connect (xmlNodePtr self,
cleanup:
g_strfreev (split);
}
#endif // GST_DISABLE_XML
static gboolean
gst_pad_renegotiate_func (GstPad *pad, gpointer *data1, GstPad *peerpad, gpointer *data2, GstCaps **newcaps)
......@@ -1384,6 +1390,7 @@ gst_pad_negotiate_proxy (GstPad *srcpad, GstPad *destpad, GstCaps **caps)
return GST_PAD_NEGOTIATE_AGREE;
}
#ifndef GST_DISABLE_XML
/**
* gst_pad_save_thyself:
* @pad: the pad to save
......@@ -1444,6 +1451,7 @@ gst_pad_ghost_save_thyself (GstPad *pad,
return self;
}
#endif // GST_DISABLE_XML
#ifndef gst_pad_push
/**
......
......@@ -986,6 +986,7 @@ end:
return compatible;
}
#ifndef GST_DISABLE_XML
static xmlNodePtr
gst_props_save_thyself_func (GstPropsEntry *entry, xmlNodePtr parent)
{
......@@ -1240,3 +1241,4 @@ gst_props_load_thyself (xmlNodePtr parent)
return props;
}
#endif // GST_DISABLE_XML
......@@ -68,8 +68,10 @@ static void gst_thread_get_arg (GtkObject *object, GtkArg *arg, guint id);
static GstElementStateReturn gst_thread_change_state (GstElement *element);
#ifndef GST_DISABLE_XML
static xmlNodePtr gst_thread_save_thyself (GstObject *object, xmlNodePtr parent);
static void gst_thread_restore_thyself (GstObject *object, xmlNodePtr self);
#endif
static void gst_thread_signal_thread (GstThread *thread, gboolean spinning);
......@@ -118,8 +120,10 @@ gst_thread_class_init (GstThreadClass *klass)
gtkobject_class->destroy = gst_thread_real_destroy;
#ifndef GST_DISABLE_XML
gstobject_class->save_thyself = gst_thread_save_thyself;
gstobject_class->restore_thyself = gst_thread_restore_thyself;
#endif
gstelement_class->change_state = gst_thread_change_state;
......@@ -668,6 +672,16 @@ gst_thread_signal_thread (GstThread *thread, gboolean spinning)
}
#ifndef GST_DISABLE_XML
static xmlNodePtr
gst_thread_save_thyself (GstObject *object,
xmlNodePtr self)
{
if (GST_OBJECT_CLASS (parent_class)->save_thyself)
GST_OBJECT_CLASS (parent_class)->save_thyself (object, self);
return NULL;
}
static void
gst_thread_restore_thyself (GstObject *object,
xmlNodePtr self)
......@@ -677,12 +691,4 @@ gst_thread_restore_thyself (GstObject *object,
if (GST_OBJECT_CLASS (parent_class)->restore_thyself)
GST_OBJECT_CLASS (parent_class)->restore_thyself (object, self);
}
static xmlNodePtr
gst_thread_save_thyself (GstObject *object,
xmlNodePtr self)
{
if (GST_OBJECT_CLASS (parent_class)->save_thyself)
GST_OBJECT_CLASS (parent_class)->save_thyself (object, self);
return NULL;
}
#endif // GST_DISABLE_XML
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment