Aplied a patch from Michael Meeks to add libxml2 support.
authorMichael Meeks <mmeeks@ximian.org>
Thu, 13 Dec 2001 19:00:58 +0000 (19:00 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 13 Dec 2001 19:00:58 +0000 (19:00 +0000)
Original commit message from CVS:
Aplied a patch from Michael Meeks to add libxml2 support.

19 files changed:
ChangeLog
acconfig.h
autogen.sh
configure.ac
examples/mixer/mixer.c
examples/plugins/example.c
examples/typefind/typefind.c
examples/xml/createxml.c
examples/xml/runxml.c
gst/gstconfig.h
test/mp1tomp1.c
test/mp2toavi.c
test/mp2tomp1.c
tests/old/examples/mixer/mixer.c
tests/old/examples/plugins/example.c
tests/old/examples/typefind/typefind.c
tests/old/examples/xml/createxml.c
tests/old/examples/xml/runxml.c
tools/gstreamer-complete.c

index ca7a313..8199ae9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2001-12-13  Michael Meeks  <michael@ximian.com>
+
+       * plugins/xvideosink/Makefile.am: add $(X_LIBS)
+
+       * examples/typefind/typefind.c (type_found): upd.
+       xml code.
+
+       * plugins/mikmod/gstmikmod.c
+       (gst_mikmod_set_property): same memory bug here -
+       unfixed.
+
+       * plugins/oss/gstosssrc.c
+       (gst_osssrc_set_property): fix memory issue.
+       (gst_osssrc_init): dup the string - argh; quit here -
+       such code should be stuck in a common base class not
+       cut and pasted.
+
+       * plugins/oss/gstosssink.c
+       (gst_osssink_init): manage the device allocation.
+       (gst_osssink_finalize): impl.
+       (gst_osssink_class_init): upd.
+       (gst_osssink_set_property): upd.
+
+       * acconfig.h: cover HAVE_LIBXML2
+
+       * configure.ac: update libxml checks.
+
 2001-12-11 22:10  thomasvs
 
        * lots of build fixes for 0.3.0 release
index e5be2eb..9e6271c 100644 (file)
@@ -9,6 +9,7 @@
 #undef HAVE_STPCPY
 
 #undef USE_GLIB2
+#undef HAVE_LIBXML2
 
 #undef PLUGINS_DIR
 #undef PLUGINS_BUILDDIR
index 1e6cc0d..0ba32c9 100755 (executable)
@@ -142,8 +142,8 @@ automake -a -c || {
 }
 
 # now remove the cache, because it can be considered dangerous in this case
-echo "+ removing config.cache ... "
-rm -f config.cache
+#echo "+ removing config.cache ... "
+#rm -f config.cache
 
 CONFIGURE_OPT='--enable-maintainer-mode --enable-plugin-builddir --enable-debug --enable-DEBUG'
 
index 76eb0e4..121636d 100644 (file)
@@ -278,18 +278,21 @@ AC_SUBST(GST_PKG_DEPS)
 AC_SUBST(GTK_LIBS)
 AC_SUBST(GTK_CFLAGS)
 
+if test x$USE_GLIB2 = xno; then
+  LIBXML_PKG='libxml >= 1.8.1'
+else
+  LIBXML_PKG='libxml-2.0'
+  AC_DEFINE(HAVE_LIBXML2)
+fi
+AC_SUBST(LIBXML_PKG)
+
 dnl Check for libxml
 dnl Thomas tries to convert this to pkg-config
-PKG_CHECK_MODULES(XML, libxml >= 1.8.1, XML_CONFIG=yes, XML_CONFIG=no)
+PKG_CHECK_MODULES(XML, $LIBXML_PKG, XML_CONFIG=yes, XML_CONFIG=no)
 dnl AC_PATH_PROG(XML_CONFIG, xml-config, no)
 if test x$XML_CONFIG = xno; then
-  AC_MSG_ERROR(Couldn't find xml-config)
+  AC_MSG_ERROR(Couldn't find $LIBXML_PKG)
 fi
-dnl XML_LIBS="`xml-config --libs`"
-dnl XML_CFLAGS="`xml-config --cflags`"
-dnl AC_CHECK_LIB(xml, xmlDocGetRootElement, :,
-dnl  [ AC_MSG_ERROR(Need version 1.8.1 or better of libxml) ],
-dnl  $XML_LIBS)
 AC_SUBST(XML_LIBS)
 AC_SUBST(XML_CFLAGS)
 
index ec492ca..0f72231 100644 (file)
@@ -83,7 +83,6 @@ int main(int argc,char *argv[])
 {
   int i, j;
   int num_channels;
-  gboolean done;
   
   char buffer[20];
   
index 1783a82..3b721f9 100644 (file)
@@ -20,6 +20,7 @@
 /* First, include the header file for the plugin, to bring in the
  * object definition and other useful things.
  */
+#include <string.h>
 #include "example.h"
 
 /* The ElementDetails structure gives a human-readable description
index 319bc38..f561ffb 100644 (file)
@@ -7,9 +7,9 @@ type_found (GstElement *typefind, GstCaps* caps)
   xmlNodePtr parent;
   
   doc = xmlNewDoc ("1.0");  
-  doc->root = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
+  doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
 
-  parent = xmlNewChild (doc->root, NULL, "Caps1", NULL);
+  parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
   gst_caps_save_thyself (caps, parent);
 
   xmlDocDump (stdout, doc);
@@ -44,7 +44,7 @@ main(int argc, char *argv[])
   gst_bin_add(GST_BIN(bin), typefind);
 
   g_signal_connect (G_OBJECT (typefind), "have_type", 
-                 type_found, NULL);
+                   G_CALLBACK (type_found), NULL);
 
   gst_pad_connect(gst_element_get_pad(disksrc,"src"),
                   gst_element_get_pad(typefind,"sink"));
index 92baeb7..50f20f1 100644 (file)
@@ -32,12 +32,16 @@ int main(int argc,char *argv[])
   //thread = gst_thread_new("thread");
   thread = gst_elementfactory_make("thread", "thread");
   g_assert(thread != NULL);
-  g_signal_connect (G_OBJECT (thread), "object_saved", object_saved, g_strdup ("decoder thread"));
+  g_signal_connect (G_OBJECT (thread), "object_saved",
+                   G_CALLBACK (object_saved),
+                   g_strdup ("decoder thread"));
 
   thread2 = gst_elementfactory_make("thread", "thread2");
   //thread2 = gst_thread_new("thread2");
   g_assert(thread2 != NULL);
-  g_signal_connect (G_OBJECT (thread2), "object_saved", object_saved, g_strdup ("render thread"));
+  g_signal_connect (G_OBJECT (thread2), "object_saved",
+                   G_CALLBACK (object_saved),
+                   g_strdup ("render thread"));
 
   /* create a new bin to hold the elements */
   bin = gst_bin_new("bin");
index 76a71bc..36fa425 100644 (file)
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdlib.h>
 #include <gst/gst.h>
 
@@ -35,7 +36,8 @@ int main(int argc,char *argv[])
 
   xml = gst_xml_new ();
 
-  g_signal_connect (G_OBJECT (xml), "object_loaded", xml_loaded, xml);
+  g_signal_connect (G_OBJECT (xml), "object_loaded",
+                   G_CALLBACK (xml_loaded), xml);
 
   ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
   g_assert (ret == TRUE);
index 844c2df..e48d428 100644 (file)
 /***** Deal with XML stuff, we have to handle both loadsave and registry *****/
 
 #if (! (defined(GST_DISABLE_LOADSAVE) && defined(GST_DISABLE_REGISTRY)) )
+#ifdef HAVE_LIBXML2
+  #include <libxml/parser.h>
+#else /* impossibly broken header namespacing */
   #include <parser.h>
+#endif
  
   // Include compatability defines: if libxml hasn't already defined these,
   // we have an old version 1.x
index a61c1cf..f67828f 100644 (file)
@@ -200,7 +200,7 @@ int main(int argc,char *argv[]) {
   gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(src));
   gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
 
-  g_signal_connect(G_OBJECT(parse),"new_pad",mp2tomp1, pipeline);
+  g_signal_connect(G_OBJECT(parse),"new_pad",G_CALLBACK(mp2tomp1), pipeline);
 
   g_signal_connect(G_OBJECT(src),"eos",G_CALLBACK(eof),NULL);
 
index 3840e25..f777a63 100644 (file)
@@ -254,9 +254,11 @@ main (int argc,char *argv[])
   gst_bin_add (GST_BIN (pipeline), GST_ELEMENT (mux));
   gst_bin_add (GST_BIN (pipeline), GST_ELEMENT (fdsink));
 
-  g_signal_connect (G_OBJECT (parse), "new_pad", mp2tomp1_new_pad, pipeline);
+  g_signal_connect (G_OBJECT (parse), "new_pad",
+                   G_CALLBACK (mp2tomp1_new_pad), pipeline);
 
-  g_signal_connect (G_OBJECT (src), "eos", eof, NULL);
+  g_signal_connect (G_OBJECT (src), "eos",
+                   G_CALLBACK (eof), NULL);
 
   gst_element_connect (src, "src", parse, "sink");
   gst_element_connect (mux, "src", fdsink, "sink");
index ae70185..5d2f841 100644 (file)
@@ -248,7 +248,8 @@ int main(int argc,char *argv[]) {
   gst_bin_add(GST_BIN(pipeline),GST_ELEMENT(parse));
 
 
-  g_signal_connect(G_OBJECT(parse),"new_pad",mp2tomp1, pipeline);
+  g_signal_connect(G_OBJECT(parse),"new_pad",
+                  G_CALLBACK (mp2tomp1), pipeline);
 
   g_signal_connect(G_OBJECT(src),"eos",G_CALLBACK(eof),NULL);
 
index ec492ca..0f72231 100644 (file)
@@ -83,7 +83,6 @@ int main(int argc,char *argv[])
 {
   int i, j;
   int num_channels;
-  gboolean done;
   
   char buffer[20];
   
index 1783a82..3b721f9 100644 (file)
@@ -20,6 +20,7 @@
 /* First, include the header file for the plugin, to bring in the
  * object definition and other useful things.
  */
+#include <string.h>
 #include "example.h"
 
 /* The ElementDetails structure gives a human-readable description
index 319bc38..f561ffb 100644 (file)
@@ -7,9 +7,9 @@ type_found (GstElement *typefind, GstCaps* caps)
   xmlNodePtr parent;
   
   doc = xmlNewDoc ("1.0");  
-  doc->root = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
+  doc->xmlRootNode = xmlNewDocNode (doc, NULL, "Capabilities", NULL);
 
-  parent = xmlNewChild (doc->root, NULL, "Caps1", NULL);
+  parent = xmlNewChild (doc->xmlRootNode, NULL, "Caps1", NULL);
   gst_caps_save_thyself (caps, parent);
 
   xmlDocDump (stdout, doc);
@@ -44,7 +44,7 @@ main(int argc, char *argv[])
   gst_bin_add(GST_BIN(bin), typefind);
 
   g_signal_connect (G_OBJECT (typefind), "have_type", 
-                 type_found, NULL);
+                   G_CALLBACK (type_found), NULL);
 
   gst_pad_connect(gst_element_get_pad(disksrc,"src"),
                   gst_element_get_pad(typefind,"sink"));
index 92baeb7..50f20f1 100644 (file)
@@ -32,12 +32,16 @@ int main(int argc,char *argv[])
   //thread = gst_thread_new("thread");
   thread = gst_elementfactory_make("thread", "thread");
   g_assert(thread != NULL);
-  g_signal_connect (G_OBJECT (thread), "object_saved", object_saved, g_strdup ("decoder thread"));
+  g_signal_connect (G_OBJECT (thread), "object_saved",
+                   G_CALLBACK (object_saved),
+                   g_strdup ("decoder thread"));
 
   thread2 = gst_elementfactory_make("thread", "thread2");
   //thread2 = gst_thread_new("thread2");
   g_assert(thread2 != NULL);
-  g_signal_connect (G_OBJECT (thread2), "object_saved", object_saved, g_strdup ("render thread"));
+  g_signal_connect (G_OBJECT (thread2), "object_saved",
+                   G_CALLBACK (object_saved),
+                   g_strdup ("render thread"));
 
   /* create a new bin to hold the elements */
   bin = gst_bin_new("bin");
index 76a71bc..36fa425 100644 (file)
@@ -1,3 +1,4 @@
+#include <string.h>
 #include <stdlib.h>
 #include <gst/gst.h>
 
@@ -35,7 +36,8 @@ int main(int argc,char *argv[])
 
   xml = gst_xml_new ();
 
-  g_signal_connect (G_OBJECT (xml), "object_loaded", xml_loaded, xml);
+  g_signal_connect (G_OBJECT (xml), "object_loaded",
+                   G_CALLBACK (xml_loaded), xml);
 
   ret = gst_xml_parse_file(xml, "xmlTest.gst", NULL);
   g_assert (ret == TRUE);
index 26ad350..6180c5c 100644 (file)
@@ -1,17 +1,10 @@
 #include <stdio.h>
 #include <string.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/gstconfig.h>
 
 #include <glib.h>
 
-#include "config.h"
 
 typedef struct {
   gchar *name;