Aplied a patch from Michael Meeks to add libxml2 support.

Original commit message from CVS:
Aplied a patch from Michael Meeks to add libxml2 support.
This commit is contained in:
Michael Meeks 2001-12-13 19:00:58 +00:00 committed by Wim Taymans
parent ef01376686
commit 7943a116f6
19 changed files with 78 additions and 35 deletions

View file

@ -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

View file

@ -9,6 +9,7 @@
#undef HAVE_STPCPY
#undef USE_GLIB2
#undef HAVE_LIBXML2
#undef PLUGINS_DIR
#undef PLUGINS_BUILDDIR

View file

@ -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'

View 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)

View file

@ -83,7 +83,6 @@ int main(int argc,char *argv[])
{
int i, j;
int num_channels;
gboolean done;
char buffer[20];

View 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

View 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"));

View 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");

View 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);

View file

@ -16,7 +16,11 @@
/***** 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

View 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);

View 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");

View 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);

View file

@ -83,7 +83,6 @@ int main(int argc,char *argv[])
{
int i, j;
int num_channels;
gboolean done;
char buffer[20];

View 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

View 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"));

View 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");

View 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);

View 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;