gst: Add gobject-introspection support
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 4 Sep 2009 18:56:43 +0000 (20:56 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 5 Sep 2009 08:28:46 +0000 (10:28 +0200)
Partially fixes bug #550616.

configure.ac
gst/.gitignore
gst/Makefile.am
gst/gst.c

index 2040d018572aa1fe54e5fa7d10f117c287cbaa6a..98acf8422545aea2fd04234cb64bbeee02a2e0c0 100644 (file)
@@ -268,6 +268,9 @@ fi
 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
 
+dnl check for gobject-introspection
+GOBJECT_INTROSPECTION_CHECK([0.6.3])
+
 dnl check for documentation tools
 AG_GST_DOCBOOK_CHECK
 GTK_DOC_CHECK([1.3])
index 606da2b3be788b9d3c805e75e91b3db97bcdb6d8..25cd4c86fc8ae912039aa0575c9f5fe981087b03 100644 (file)
@@ -18,3 +18,5 @@ gstconfig.h
 *.gcno
 *.gcov
 *.gcov.out
+*.gir
+*.typelib
index 91ae69419c6af6275f6e1290800cc0fa0ac71f5f..5945e009d519123a0e0365a57798b565a900565b 100644 (file)
@@ -236,3 +236,44 @@ gstenumtypes.c: $(gst_headers)
        $(GCOV) -b -f -o $^ > $@.out
 
 gcov: $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES:=.gcov)
+
+if HAVE_INTROSPECTION
+BUILT_GIRSOURCES = Gst-@GST_MAJORMINOR@.gir
+
+gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@include_HEADERS))
+gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_MAJORMINOR@_la_SOURCES))
+
+Gst-@GST_MAJORMINOR@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_MAJORMINOR@.la
+       $(INTROSPECTION_SCANNER) -v --namespace Gst \
+               --nsversion=@GST_MAJORMINOR@ \
+               -I$(top_srcdir) \
+               --c-include='gst/gst.h' \
+               --library=gstreamer-0.10 \
+               --include=GLib-2.0 \
+               --include=GObject-2.0 \
+               --include=GModule-2.0 \
+               --include=libxml2-2.0 \
+               --libtool="$(top_builddir)/libtool" \
+               --pkg glib-2.0 \
+               --pkg gobject-2.0 \
+               --pkg gmodule-no-export-2.0 \
+               --pkg gthread-2.0 \
+               --pkg libxml-2.0 \
+               --output $@ \
+               $(gir_headers) \
+               $(gir_sources)
+
+# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
+# install anything - we need to install inside our prefix.
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0/
+
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+%.typelib: %.gir $(INTROSPECTION_COMPILER)
+       $(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=$(builddir) $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+endif
index 89058034f47af527db6277df0c259f5f5843c90a..95ec1e544305fc2d76fbd7b9998d23d40fe32c51 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -468,8 +468,8 @@ gst_init_check (int *argc, char **argv[], GError ** err)
 
 /**
  * gst_init:
- * @argc: pointer to application's argc
- * @argv: pointer to application's argv
+ * @argc: (inout): pointer to application's argc
+ * @argv: (inout) (array length=argc) (allow-none): pointer to application's argv
  *
  * Initializes the GStreamer library, setting up internal path lists,
  * registering built-in elements, and loading standard plugins.