*/
//#define GST_DEBUG_ENABLED
+#include "config.h"
#include "gst_private.h"
#include "gstbin.h"
GHashTable *elements)
{
GstBin *bin = GST_BIN (element);
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
xmlNodePtr childlist;
// g_print("gstbin: restore \"%s\"\n", gst_element_get_name (element));
while (field) {
if (!strcmp (field->name, "children")) {
GST_INFO_ELEMENT (GST_CAT_XML, element, "loading children");
- childlist = field->childs;
+ childlist = field->xmlChildrenNode;
while (childlist) {
if (!strcmp (childlist->name, "element")) {
GstElement *element = gst_element_load_thyself (childlist, elements);
g_return_val_if_fail (tocaps != NULL, FALSE);
if (fromcaps->id != tocaps->id) {
- GST_DEBUG (0,"gstcaps: mime types wrong\n");
+ GST_DEBUG (0,"gstcaps: mime types differ (%d to %d)\n",
+ fromcaps->id, tocaps->id);
return FALSE;
}
gst_caps_load_thyself (xmlNodePtr parent)
{
GstCaps *caps = g_new0 (GstCaps, 1);
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
gchar *content;
while (field) {
#include <parser.h> // 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 <gst/gstprops.h>
typedef struct _GstCaps GstCaps;
gst_element_load_thyself (xmlNodePtr parent,
GHashTable *elements)
{
- xmlNodePtr children = parent->childs;
+ xmlNodePtr children = parent->xmlChildrenNode;
GstElement *element;
GstElementClass *oclass;
guchar *name = NULL;
g_hash_table_insert (elements, g_strdup (gst_element_get_name (element)), element);
// we have the element now, set the arguments
- children = parent->childs;
+ children = parent->xmlChildrenNode;
while (children) {
if (!strcmp (children->name, "arg")) {
- xmlNodePtr child = children->childs;
+ xmlNodePtr child = children->xmlChildrenNode;
while (child) {
if (!strcmp (child->name, "name")) {
children = children->next;
}
// we have the element now, set the pads
- children = parent->childs;
+ children = parent->xmlChildrenNode;
while (children) {
if (!strcmp (children->name, "pad")) {
#include <parser.h> // 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 <gst/gstobject.h>
#include <gst/gstpad.h>
#include <gst/cothreads.h>
gst_elementfactory_load_thyself (xmlNodePtr parent)
{
GstElementFactory *factory = g_new0(GstElementFactory, 1);
- xmlNodePtr children = parent->childs;
+ xmlNodePtr children = parent->xmlChildrenNode;
factory->details = g_new0(GstElementDetails, 1);
factory->padtemplates = NULL;
GstObject *element,
GHashTable *elements)
{
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
GstPad *pad = NULL, *targetpad;
guchar *peer = NULL;
gchar **split;
GstPadTemplate*
gst_padtemplate_load_thyself (xmlNodePtr parent)
{
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
GstPadTemplate *factory = g_new0 (GstPadTemplate, 1);
while (field) {
#include <parser.h> // 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 <gst/gstobject.h>
#include <gst/gstbuffer.h>
#include <gst/cothreads.h>
doc = xmlParseFile (GST_CONFIG_DIR"/reg.xml");
- if (!doc || strcmp (doc->root->name, "GST-PluginRegistry") ||
+ if (!doc || strcmp (doc->xmlRootNode->name, "GST-PluginRegistry") ||
!plugin_times_older_than(get_time(GST_CONFIG_DIR"/reg.xml"))) {
if (_gst_warn_old_registry)
g_warning ("gstplugin: registry needs rebuild\n");
gst_plugin_load_all ();
return;
}
- gst_plugin_load_thyself (doc->root);
+ gst_plugin_load_thyself (doc->xmlRootNode);
xmlFreeDoc (doc);
}
gint typecount = 0;
gchar *pluginname;
- kinderen = parent->childs; // Dutch invasion :-)
+ kinderen = parent->xmlChildrenNode; // Dutch invasion :-)
while (kinderen) {
if (!strcmp(kinderen->name, "plugin")) {
- xmlNodePtr field = kinderen->childs;
+ xmlNodePtr field = kinderen->xmlChildrenNode;
GstPlugin *plugin = g_new0 (GstPlugin, 1);
plugin->elements = NULL;
plugin->types = NULL;
#include <gmodule.h>
#include <parser.h> // 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 <gst/gsttype.h>
#include <gst/gstelement.h>
else goto end;
}
- compatible &= gst_props_entry_check_compatibility (entry1, entry2);
+ if (!gst_props_entry_check_compatibility (entry1, entry2)) {
+ compatible = FALSE;
+ GST_DEBUG (0, "%s and %s are not compatible\n",
+ g_quark_to_string (entry1->propid),
+ g_quark_to_string (entry2->propid));
+ }
sourcelist = g_list_next (sourcelist);
sinklist = g_list_next (sinklist);
}
- if (sinklist) {
+ if (sinklist && compatible) {
GstPropsEntry *entry2;
entry2 = (GstPropsEntry *)sinklist->data;
missing++;
gst_props_load_thyself (xmlNodePtr parent)
{
GstProps *props = g_new0 (GstProps, 1);
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
gchar *prop;
while (field) {
if (!strcmp (field->name, "list")) {
GstPropsEntry *entry;
- xmlNodePtr subfield = field->childs;
+ xmlNodePtr subfield = field->xmlChildrenNode;
entry = g_new0 (GstPropsEntry, 1);
entry->propstype = GST_PROPS_LIST_ID_NUM;
#include <glib.h>
#include <parser.h> // 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;
typedef gpointer GstPropsFactoryEntry;
{
GstTypeFactory *factory = g_new0 (GstTypeFactory, 1);
- xmlNodePtr field = parent->childs;
+ xmlNodePtr field = parent->xmlChildrenNode;
factory->typefindfunc = NULL;
while (field) {
xmlDocPtr doc;
doc = xmlNewDoc ("1.0");
- doc->root = xmlNewDocNode (doc, NULL, "GST-Pipeline", NULL);
+ doc->xmlRootNode = xmlNewDocNode (doc, NULL, "GST-Pipeline", NULL);
- gst_element_save_thyself (element, doc->root);
+ gst_element_save_thyself (element, doc->xmlRootNode);
return doc;
}
g_print("gstxml: XML file \"%s\" could not be read\n", fname);
return NULL;
}
- if (strcmp(doc->root->name, "GST-Pipeline")) {
+ if (strcmp(doc->xmlRootNode->name, "GST-Pipeline")) {
g_print("gstxml: XML file \"%s\" is in wrong format\n", fname);
return NULL;
}
xml->topelements = NULL;
- field = doc->root->childs;
+ field = doc->xmlRootNode->xmlChildrenNode;
while (field) {
if (!strcmp(field->name, "element")) {
//#include <gnome-xml/parser.h>
#include <parser.h>
+
+// 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 <gst/gstelement.h>
// Read the plugins
doc = xmlNewDoc("1.0");
- doc->root = xmlNewDocNode(doc, NULL, "GST-PluginRegistry", NULL);
- gst_plugin_save_thyself(doc->root);
+ doc->xmlRootNode = xmlNewDocNode(doc, NULL, "GST-PluginRegistry", NULL);
+ gst_plugin_save_thyself(doc->xmlRootNode);
// Save the registry to a tmp file.
save_registry(GLOBAL_REGISTRY_FILE_TMP, &doc);