common/as-libtool.mak: Fine-tune DLL building.

Original commit message from CVS:
* common/as-libtool.mak: Fine-tune DLL building.
* configure.ac: Link plugins against libgstreamer.  Define plugindir
(like gst-plugins)
* examples/plugins/Makefile.am: remove plugindir
* gst/autoplug/Makefile.am: DLL building fixes
* gst/elements/Makefile.am: DLL building fixes.  Disable pipefilter on
Windows.
* gst/elements/gstelements.c: Conditionally disable pipefilter.
* gst/indexers/Makefile.am: DLL building fixes
* gst/schedulers/Makefile.am: DLL building fixes.
* libs/gst/bytestream/Makefile.am: DLL building fixes.
* libs/gst/control/Makefile.am: same
* libs/gst/getbits/Makefile.am: same
* testsuite/Makefile.am: New dlopen directory
* testsuite/dlopen/Makefile.am: Tests to check if libgstreamer works
when dlopened.
* testsuite/dlopen/dlopen_gst.c: (main): same
* testsuite/dlopen/loadgst.c: (do_test): same
This commit is contained in:
David Schleef 2004-04-20 22:22:01 +00:00
parent 5453269a0e
commit 828252e0f2
24 changed files with 395 additions and 40 deletions

View file

@ -1,3 +1,24 @@
2004-04-20 David Schleef <ds@schleef.org>
* common/as-libtool.mak: Fine-tune DLL building.
* configure.ac: Link plugins against libgstreamer. Define plugindir
(like gst-plugins)
* examples/plugins/Makefile.am: remove plugindir
* gst/autoplug/Makefile.am: DLL building fixes
* gst/elements/Makefile.am: DLL building fixes. Disable pipefilter on
Windows.
* gst/elements/gstelements.c: Conditionally disable pipefilter.
* gst/indexers/Makefile.am: DLL building fixes
* gst/schedulers/Makefile.am: DLL building fixes.
* libs/gst/bytestream/Makefile.am: DLL building fixes.
* libs/gst/control/Makefile.am: same
* libs/gst/getbits/Makefile.am: same
* testsuite/Makefile.am: New dlopen directory
* testsuite/dlopen/Makefile.am: Tests to check if libgstreamer works
when dlopened.
* testsuite/dlopen/dlopen_gst.c: (main): same
* testsuite/dlopen/loadgst.c: (do_test): same
2004-04-20 David Schleef <ds@schleef.org>
* gst/parse/grammar.y: Apply patch from Sebastien Cote

2
common

@ -1 +1 @@
Subproject commit e55182f6eece70ff99e33b9800b27a926670dbdd
Subproject commit 63d93f01177745ba864263f0b6f976212684cb87

View file

@ -582,10 +582,11 @@ GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
#GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).* \$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).* \$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
AC_SUBST(plugindir)
dnl ##################################################
dnl # deps for examples from manual #
@ -656,6 +657,7 @@ testsuite/caps/Makefile
testsuite/cleanup/Makefile
testsuite/clock/Makefile
testsuite/debug/Makefile
testsuite/dlopen/Makefile
testsuite/dynparams/Makefile
testsuite/elements/Makefile
testsuite/ghostpads/Makefile

View file

@ -1,5 +1,3 @@
## we need to specify the plugindir if we want libtool to build .so files ...
plugindir=$(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstexample.la

View file

@ -1,7 +1,9 @@
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = \
libgstspider.la
plugin_LTLIBRARIES = libgstspider.la
AS_LIBTOOL_LIB = libgstspider
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
libgstspider_la_SOURCES = \
gstspider.c gstspideridentity.c \
@ -18,3 +20,9 @@ spidertest_SOURCES = spidertest.c
spidertest_CFLAGS = $(GST_CFLAGS)
spidertest_LDADD = $(GST_LIBS)
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -4,9 +4,11 @@
# This requires building libs/gst before this dir, which we currently don't
# do.
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstelements.la
AS_LIBTOOL_LIB = libgstelements
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
# FIXME:
# Disable multifilesrc on Windows, cause it uses mmap excessively
@ -14,8 +16,10 @@ plugin_LTLIBRARIES = libgstelements.la
# in gstelements.c.
if AS_LIBTOOL_WIN32
multifilesrc =
pipefilter =
else
multifilesrc = gstmultifilesrc.c
pipefilter = gstpipefilter.c
endif
libgstelements_la_DEPENDENCIES = ../libgstreamer-@GST_MAJORMINOR@.la
@ -32,7 +36,7 @@ libgstelements_la_SOURCES = \
gstidentity.c \
gstmd5sink.c \
$(multifilesrc) \
gstpipefilter.c \
$(pipefilter) \
gstshaper.c \
gststatistics.c \
gsttee.c \
@ -40,7 +44,7 @@ libgstelements_la_SOURCES = \
libgstelements_la_CFLAGS = $(GST_CFLAGS)
libgstelements_la_LIBADD =
libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
noinst_HEADERS = \
gstaggregator.h \
@ -59,3 +63,10 @@ noinst_HEADERS = \
gststatistics.h \
gsttee.h \
gsttypefind.h
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -67,8 +67,8 @@ static struct _elements_entry _elements[] = {
{"md5sink", GST_RANK_NONE, gst_md5sink_get_type},
#ifndef HAVE_WIN32
{"multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type},
#endif
{"pipefilter", GST_RANK_NONE, gst_pipefilter_get_type},
#endif
{"shaper", GST_RANK_NONE, gst_shaper_get_type},
{"statistics", GST_RANK_NONE, gst_statistics_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type},

View file

@ -1,6 +1,9 @@
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstindexers.la
AS_LIBTOOL_LIB = libgstindexers
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
# file index uses xml
if GST_DISABLE_LOADSAVE
@ -13,3 +16,10 @@ libgstindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC)
libgstindexers_la_CFLAGS = $(GST_CFLAGS)
libgstindexers_la_LIBADD =
libgstindexers_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -1,12 +1,16 @@
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
if GST_DISABLE_OMEGA_COTHREADS
omegaschedulers =
omegaschedulers_nola =
else
omegaschedulers = \
libgstbasicomegascheduler.la \
libgstentryomegascheduler.la \
libgstoptomegascheduler.la
omegaschedulers_nola = \
libgstbasicomegascheduler \
libgstentryomegascheduler \
libgstoptomegascheduler
endif
plugin_LTLIBRARIES = \
@ -15,45 +19,98 @@ plugin_LTLIBRARIES = \
libgstentrygthreadscheduler.la \
libgstoptscheduler.la \
libgstoptgthreadscheduler.la
AS_LIBTOOL_LIBS = \
$(omegaschedulers_nola) \
libgstbasicgthreadscheduler \
libgstentrygthreadscheduler \
libgstoptscheduler \
libgstoptgthreadscheduler
if AS_LIBTOOL_WIN32
as_libtool_LDFLAGS = -no-undefined
else
as_libtool_LDFLAGS =
endif
if GST_DISABLE_OMEGA_COTHREADS
else
libgstbasicomegascheduler_la_SOURCES = gstbasicscheduler.c
libgstbasicomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA
libgstbasicomegascheduler_la_LIBADD = ../libcothreads.la
libgstbasicomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstbasicomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
endif
libgstbasicgthreadscheduler_la_SOURCES = gstbasicscheduler.c
libgstbasicgthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD
libgstbasicgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstbasicgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
libgstentrygthreadscheduler_la_SOURCES = entryscheduler.c
libgstentrygthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD
libgstentrygthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstentrygthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
if GST_DISABLE_OMEGA_COTHREADS
else
libgstentryomegascheduler_la_SOURCES = entryscheduler.c
libgstentryomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA
libgstentryomegascheduler_la_LIBADD = ../libcothreads.la
libgstentryomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstentryomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
endif
libgstoptscheduler_la_SOURCES = gstoptimalscheduler.c
libgstoptscheduler_la_CFLAGS = $(GST_CFLAGS)
libgstoptscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstoptscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
if GST_DISABLE_OMEGA_COTHREADS
else
libgstoptomegascheduler_la_SOURCES = gstoptimalscheduler.c
libgstoptomegascheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_OMEGA -DUSE_COTHREADS
libgstoptomegascheduler_la_LIBADD = ../libcothreads.la
libgstoptomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstoptomegascheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
endif
libgstoptgthreadscheduler_la_SOURCES = gstoptimalscheduler.c
libgstoptgthreadscheduler_la_CFLAGS = $(GST_CFLAGS) -D_COTHREADS_GTHREAD -DUSE_COTHREADS
libgstoptgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstoptgthreadscheduler_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
noinst_HEADERS = cothreads_compat.h gthread-cothreads.h
if AS_LIBTOOL_WIN32
as_libtool_noinst_DATA_files = $(AS_LIBTOOL_LIB).lib
as_libtool_LDFLAGS = -no-undefined
# depend on this in install-data-local
as-libtool-install-data-local:
for i in $(AS_LIBTOOL_LIBS); do \
$(INSTALL) $$i.lib $(DESTDIR)$(libdir) ; \
$(INSTALL) $$i.def $(DESTDIR)$(libdir) ; \
done
# depend on this in uninstall-local
as-libtool-uninstall-local:
for i in $(AS_LIBTOOL_LIBS); do \
-rm $(DESTDIR)$(libdir)/$$i.lib ; \
-rm $(DESTDIR)$(libdir)/$$i.def ; \
done
else
as-libtool-install-data-local:
as-libtool-uninstall-local:
endif
%.lib: %.def
dlltool -S $(CC) -f "-c" --export-all-symbols --input-def \
%.def --output-lib %.lib
%.def: %.la
echo EXPORTS >%.def.tmp
nm --defined-only -g .libs/%.a | \
grep ^0 | \
awk '{ print $$3 }' | \
sed 's/^/ /' >>%.def.tmp
mv %.def.tmp %.def

View file

@ -1,6 +1,9 @@
librarydir = $(libdir)/gstreamer-@GST_MAJORMINOR@
library_LTLIBRARIES = libgstbytestream.la
plugin_LTLIBRARIES = libgstbytestream.la
AS_LIBTOOL_LIB = libgstbytestream
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
libgstbytestreamincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/bytestream
libgstbytestreaminclude_HEADERS = bytestream.h
@ -8,3 +11,10 @@ libgstbytestreaminclude_HEADERS = bytestream.h
libgstbytestream_la_SOURCES = bytestream.c
libgstbytestream_la_CFLAGS = $(GST_CFLAGS)
libgstbytestream_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -1,6 +1,9 @@
librarydir = $(libdir)
library_LTLIBRARIES = libgstcontrol-@GST_MAJORMINOR@.la
lib_LTLIBRARIES = libgstcontrol-@GST_MAJORMINOR@.la
AS_LIBTOOL_LIB = libgstcontrol-@GST_MAJORMINOR@
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
libgstcontrol_@GST_MAJORMINOR@_includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/control
libgstcontrol_@GST_MAJORMINOR@_include_HEADERS = \
@ -25,3 +28,9 @@ libgstcontrol_@GST_MAJORMINOR@_la_LDFLAGS = @GST_LT_LDFLAGS@ -version-info @GST_
# control uses log and exp, so we need -lm if xml is disabled
libgstcontrol_@GST_MAJORMINOR@_la_LIBADD = $(GST_LIBS) -lm
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -1,6 +1,9 @@
librarydir = $(libdir)/gstreamer-@GST_MAJORMINOR@
library_LTLIBRARIES = libgstgetbits.la
plugin_LTLIBRARIES = libgstgetbits.la
AS_LIBTOOL_LIB = libgstgstgetbits
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
if HAVE_CPU_I386
GSTARCH_SRCS = gstgetbits_i386.s
@ -19,3 +22,10 @@ libgstgetbits_la_CFLAGS = $(GST_CFLAGS) -funroll-all-loops -finline-functions -f
libgstgetbits_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# check_PROGRAMS = gbtest
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -4,9 +4,11 @@
# This requires building libs/gst before this dir, which we currently don't
# do.
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstelements.la
AS_LIBTOOL_LIB = libgstelements
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
# FIXME:
# Disable multifilesrc on Windows, cause it uses mmap excessively
@ -14,8 +16,10 @@ plugin_LTLIBRARIES = libgstelements.la
# in gstelements.c.
if AS_LIBTOOL_WIN32
multifilesrc =
pipefilter =
else
multifilesrc = gstmultifilesrc.c
pipefilter = gstpipefilter.c
endif
libgstelements_la_DEPENDENCIES = ../libgstreamer-@GST_MAJORMINOR@.la
@ -32,7 +36,7 @@ libgstelements_la_SOURCES = \
gstidentity.c \
gstmd5sink.c \
$(multifilesrc) \
gstpipefilter.c \
$(pipefilter) \
gstshaper.c \
gststatistics.c \
gsttee.c \
@ -40,7 +44,7 @@ libgstelements_la_SOURCES = \
libgstelements_la_CFLAGS = $(GST_CFLAGS)
libgstelements_la_LIBADD =
libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstelements_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(as_libtool_LDFLAGS)
noinst_HEADERS = \
gstaggregator.h \
@ -59,3 +63,10 @@ noinst_HEADERS = \
gststatistics.h \
gsttee.h \
gsttypefind.h
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -67,8 +67,8 @@ static struct _elements_entry _elements[] = {
{"md5sink", GST_RANK_NONE, gst_md5sink_get_type},
#ifndef HAVE_WIN32
{"multifilesrc", GST_RANK_NONE, gst_multifilesrc_get_type},
#endif
{"pipefilter", GST_RANK_NONE, gst_pipefilter_get_type},
#endif
{"shaper", GST_RANK_NONE, gst_shaper_get_type},
{"statistics", GST_RANK_NONE, gst_statistics_get_type},
{"tee", GST_RANK_NONE, gst_tee_get_type},

View file

@ -1,6 +1,9 @@
plugindir = $(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstindexers.la
AS_LIBTOOL_LIB = libgstindexers
EXTRA_DIST = $(as_libtool_EXTRA_DIST)
noinst_DATA = $(as_libtool_noinst_DATA_files)
# file index uses xml
if GST_DISABLE_LOADSAVE
@ -13,3 +16,10 @@ libgstindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC)
libgstindexers_la_CFLAGS = $(GST_CFLAGS)
libgstindexers_la_LIBADD =
libgstindexers_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
install-data-local: as-libtool-install-data-local
uninstall-local: as-libtool-uninstall-local
include $(top_srcdir)/common/as-libtool.mak

View file

@ -1,5 +1,3 @@
## we need to specify the plugindir if we want libtool to build .so files ...
plugindir=$(libdir)/gstreamer-@GST_MAJORMINOR@
plugin_LTLIBRARIES = libgstexample.la

View file

@ -15,10 +15,12 @@ endif
SUBDIRS = bins bytestream cleanup dynparams ghostpads \
caps plugin elements clock refcounting tags threads \
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) \
dlopen
DIST_SUBDIRS = bins bytestream caps cleanup clock dynparams elements indexers \
plugin refcounting tags threads parse debug ghostpads
plugin refcounting tags threads parse debug ghostpads \
dlopen
tests_pass = test_gst_init
tests_fail =

View file

@ -0,0 +1,45 @@
plugin_LTLIBRARIES = libloadgst.la
tests_pass = dlopen_gst
tests_fail =
tests_ignore =
libloadgst_la_SOURCES = loadgst.c
libloadgst_la_CFLAGS = $(GST_CFLAGS)
libloadgst_la_LDFLAGS = -module -avoid-version $(GST_LIBS)
dlopen_gst_SOURCES = dlopen_gst.c
dlopen_gst_CFLAGS = $(GLIB_CFLAGS)
dlopen_gst_LDFLAGS = $(GLIB_LIBS)
# ../Rules is included because we specifically don't want the normal
# AM_CFLAGS, etc.
TESTS_ENVIRONMENT=\
G_DEBUG=fatal_warnings \
GST_PLUGIN_PATH=$(top_builddir)/gst:. \
GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
check_PROGRAMS = $(tests_pass) $(tests_fail) $(tests_ignore)
# make all tests depend on the versioned gst-register
$(tests_pass) $(tests_fail): $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@
# rebuild gst-register-@GST_MAJORMINOR@ if needed
# the EXEEXT is because am 1.6 complained about overrides
$(top_builddir)/tools/gst-register-@GST_MAJORMINOR@$(EXEEXT):
cd $(top_builddir)/tools && make
TESTS = $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ \
$(tests_pass) $(tests_fail)
XFAIL_TESTS = $(tests_fail)
# override to _not_ install the test plugins
install-pluginLTLIBRARIES:
# This rule is here so make distcheck works on machines where core
# dumps have PIDs appended
CLEANFILES = core.*

View file

@ -0,0 +1,25 @@
#include <gmodule.h>
int
main (int argc, char *argv[])
{
GModule *module;
void (*symbol) (void);
gboolean ret;
module = g_module_open (".libs/libloadgst.so",
G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
g_assert (module != NULL);
ret = g_module_symbol (module, "gst_init", (gpointer *) & symbol);
g_print ("'gst_init' is %s\n", ret ? "visible" : "not visible");
ret = g_module_symbol (module, "do_test", (gpointer *) & symbol);
g_assert (ret);
symbol ();
exit (0);
}

View file

@ -0,0 +1,28 @@
#include <gst/gst.h>
void
do_test (void)
{
GstElement *pipeline;
int i;
gboolean ret;
gst_init (NULL, NULL);
pipeline = gst_parse_launch ("fakesrc ! fakesink", NULL);
g_assert (pipeline != NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
for (i = 0; i < 100; i++) {
ret = gst_bin_iterate (GST_BIN (pipeline));
g_assert (ret);
g_print ("%s", (i & 1) ? "+" : "-");
}
g_print ("\n");
gst_object_unref (GST_OBJECT (pipeline));
}

View file

@ -15,10 +15,12 @@ endif
SUBDIRS = bins bytestream cleanup dynparams ghostpads \
caps plugin elements clock refcounting tags threads \
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS)
indexers debug $(GST_PARSE_DIRS) $(GST_DEBUG_DIRS) \
dlopen
DIST_SUBDIRS = bins bytestream caps cleanup clock dynparams elements indexers \
plugin refcounting tags threads parse debug ghostpads
plugin refcounting tags threads parse debug ghostpads \
dlopen
tests_pass = test_gst_init
tests_fail =

View file

@ -0,0 +1,45 @@
plugin_LTLIBRARIES = libloadgst.la
tests_pass = dlopen_gst
tests_fail =
tests_ignore =
libloadgst_la_SOURCES = loadgst.c
libloadgst_la_CFLAGS = $(GST_CFLAGS)
libloadgst_la_LDFLAGS = -module -avoid-version $(GST_LIBS)
dlopen_gst_SOURCES = dlopen_gst.c
dlopen_gst_CFLAGS = $(GLIB_CFLAGS)
dlopen_gst_LDFLAGS = $(GLIB_LIBS)
# ../Rules is included because we specifically don't want the normal
# AM_CFLAGS, etc.
TESTS_ENVIRONMENT=\
G_DEBUG=fatal_warnings \
GST_PLUGIN_PATH=$(top_builddir)/gst:. \
GST_REGISTRY=$(top_builddir)/testsuite/test-registry.xml
check_PROGRAMS = $(tests_pass) $(tests_fail) $(tests_ignore)
# make all tests depend on the versioned gst-register
$(tests_pass) $(tests_fail): $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@
# rebuild gst-register-@GST_MAJORMINOR@ if needed
# the EXEEXT is because am 1.6 complained about overrides
$(top_builddir)/tools/gst-register-@GST_MAJORMINOR@$(EXEEXT):
cd $(top_builddir)/tools && make
TESTS = $(top_builddir)/tools/gst-register-@GST_MAJORMINOR@ \
$(tests_pass) $(tests_fail)
XFAIL_TESTS = $(tests_fail)
# override to _not_ install the test plugins
install-pluginLTLIBRARIES:
# This rule is here so make distcheck works on machines where core
# dumps have PIDs appended
CLEANFILES = core.*

View file

@ -0,0 +1,25 @@
#include <gmodule.h>
int
main (int argc, char *argv[])
{
GModule *module;
void (*symbol) (void);
gboolean ret;
module = g_module_open (".libs/libloadgst.so",
G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
g_assert (module != NULL);
ret = g_module_symbol (module, "gst_init", (gpointer *) & symbol);
g_print ("'gst_init' is %s\n", ret ? "visible" : "not visible");
ret = g_module_symbol (module, "do_test", (gpointer *) & symbol);
g_assert (ret);
symbol ();
exit (0);
}

View file

@ -0,0 +1,28 @@
#include <gst/gst.h>
void
do_test (void)
{
GstElement *pipeline;
int i;
gboolean ret;
gst_init (NULL, NULL);
pipeline = gst_parse_launch ("fakesrc ! fakesink", NULL);
g_assert (pipeline != NULL);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
for (i = 0; i < 100; i++) {
ret = gst_bin_iterate (GST_BIN (pipeline));
g_assert (ret);
g_print ("%s", (i & 1) ? "+" : "-");
}
g_print ("\n");
gst_object_unref (GST_OBJECT (pipeline));
}