GNOME Bugzilla – Bug 550616
Add support for GObject-Introspection and provide GIR file with introspection data
Last modified: 2011-05-10 07:28:21 UTC
Hi, we should support GObject-Introspection ( http://live.gnome.org/GObjectIntrospection ) at some point to allow easier and standardized automatic generation of language bindings, etc. This would also mean maintaining the API information inside GStreamer and providing a GIR file with this information.
First part is done, all of core has introspection support now. Next step is -base and bug #594202 has to be fixed before the dataprotocol library has introspection support too. commit 19507ce3c8cc10cce2d057f23bdbd767f4cb8757 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 5 09:36:21 2009 +0200 net: Add gobject-introspection support commit 088e424aabc2a6205cedcae9140579780c0f95df Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 5 09:34:30 2009 +0200 dataprotocol: Add gobject-introspection support Because of a bug in gobject-introspection this is disabled for now. commit bd6c7c97bfe41f3fe98708ef64889f7eda3378d3 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 5 09:28:48 2009 +0200 controller: Add gobject-introspection support commit 1b37155aa640f8dab094a4bad92cffe3b5d8cfbb Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 5 09:27:04 2009 +0200 check: Add gobject-introspection support commit 0bb8634b3710d7ffd5d01a2a148123dd6df97b31 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Sat Sep 5 09:23:19 2009 +0200 gstbase: Add gobject-introspection support commit 7c031ae4d05257a47ec2a4e67c239162f6ee5a84 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Fri Sep 4 20:56:43 2009 +0200 gst: Add gobject-introspection support Partially fixes bug #550616.
And bug #594223 should be solved so we can use nested namespaces like Gst.Base instead of GstBase...
...and bug #594236 to get GstMiniObject handled correctly.
FYI: with the new g-ir-scanner that landed in git master recently, the introspection build in gstreamer is broken.
The solution is to bump the g-i dependency and add --identifier-prefix=Gst --symbol-prefix=gst to all gir generation
(In reply to comment #4) > FYI: with the new g-ir-scanner that landed in git master recently, the > introspection build in gstreamer is broken. Broken how? What's the exact error/failure? > The solution is to bump the g-i dependency and add --identifier-prefix=Gst > --symbol-prefix=gst to all gir generation Thanks. What version was that introduced in? I think we would want to wait for a release before bumping the requirement, but maybe we can do something conditional on the version?
I still get error after making suggested changes to gstreamer to fix the build. I get this (rather strange) build error: GEN Gst-0.10.gir g-ir-scanner: compile: gcc -Wall -pthread -I/opt/the-board/include/glib-2.0 -I/opt/the-board/lib/glib-2.0/include -I/opt/the-board/include/gobject-introspection-1.0 -I.. -I.. -I/opt/the-board/include/glib-2.0 -I/opt/the-board/lib/glib-2.0/include -I/opt/the-board/include/libxml2 -c -o /home/lucasr/Code/the-board/gstreamer/gst/tmp-introspectTMasu0/Gst-0.10.o /home/lucasr/Code/the-board/gstreamer/gst/tmp-introspectTMasu0/Gst-0.10.c g-ir-scanner: link: ../libtool --mode=link --tag=CC --silent gcc -o /home/lucasr/Code/the-board/gstreamer/gst/tmp-introspectTMasu0/Gst-0.10 -L. -Wl,--export-dynamic -pthread -L/opt/the-board/lib -lgirepository-1.0 -lgobject-2.0 -lgmodule-2.0 -lffi -lgthread-2.0 -lrt -lglib-2.0 libgstreamer-0.10.la -pthread -Wl,--export-dynamic -L/opt/the-board/lib -lgio-2.0 -lgirepository-1.0 -lgobject-2.0 -lgmodule-2.0 -lffi -lgthread-2.0 -lrt -lglib-2.0 /home/lucasr/Code/the-board/gstreamer/gst/tmp-introspectTMasu0/Gst-0.10.o Skipping foreign identifier 'GError' from namespace GModule make[4]: ** [Gst-0.10.gir] Erro 1 make[4]: Saindo do diretório `/home/lucasr/Code/the-board/gstreamer/gst' make[3]: ** [all-recursive] Erro 1 make[3]: Saindo do diretório `/home/lucasr/Code/the-board/gstreamer/gst' make[2]: ** [all] Erro 2 make[2]: Saindo do diretório `/home/lucasr/Code/the-board/gstreamer/gst' make[1]: ** [all-recursive] Erro 1 make[1]: Saindo do diretório `/home/lucasr/Code/the-board/gstreamer' make: ** [all] Erro 2
Created attachment 169719 [details] [review] Patch with suggested changes Here's the patch with jdahlin's suggested changes. Applies to gstreamer's git master.
I tried the patch and got the build error mentioned here: https://bugzilla.gnome.org/show_bug.cgi?id=629241
Created attachment 169975 [details] [review] update to 0.9.5 Updated - this builds here with the additional g-i patch from https://bugzilla.gnome.org/show_bug.cgi?id=629306 which I'll probably shortly push.
Created attachment 169980 [details] [review] Update gst-plugins-base to 0.9.5
Comment on attachment 169975 [details] [review] update to 0.9.5 Thanks for the patches. I think I'd like to make them conditional though, so g-i 0.6.x still works. >Use --identifier-prefix and --symbol-prefix as appropriate. There's something I'm wondering about here: so, we have the GStreamer core lib, libgstreamer-0.10.so (in gstreamer/gst/), and then a bunch of other helper libraries, both in core (gstreamer/libs/gst/foo/, libgstfoo-0.10.so) and gst-plugins-base (gst-plugins-base/gst-libs/gst/bar/, libgstbar-0.10.so). Before, with g-i 0.6.x we would use for the core library: --namespace Gst and for the helper libs in core/base: --namespace Gst{Base,Controller,Net,Audio,Video,etc.} \ --strip-prefix=Gst With your patch we'll use for the core library: --namespace Gst \ --identifier-prefix=Gst \ --symbol-prefix=gst and for the helper libs in core/base: --namespace Gst{Base,Controller,Net,Audio,Video,etc.} \ --identifier-prefix=Gst \ --symbol-prefix=gst Is this correct? Will this yield the same namespace etc. as before? (ie. we don't want e.g. GstBase or gst_base as identifier-prefix or symbol-prefix for the util libs, right?)
(In reply to comment #12) > (From update of attachment 169975 [details] [review]) > Thanks for the patches. > > I think I'd like to make them conditional though, so g-i 0.6.x still works. > > > >Use --identifier-prefix and --symbol-prefix as appropriate. > > There's something I'm wondering about here: so, we have the GStreamer core lib, > libgstreamer-0.10.so (in gstreamer/gst/), and then a bunch of other helper > libraries, both in core (gstreamer/libs/gst/foo/, libgstfoo-0.10.so) and > gst-plugins-base (gst-plugins-base/gst-libs/gst/bar/, libgstbar-0.10.so). > > Before, with g-i 0.6.x we would use > > for the core library: > > --namespace Gst > > and for the helper libs in core/base: > > --namespace Gst{Base,Controller,Net,Audio,Video,etc.} \ > --strip-prefix=Gst So as of about 5 minutes ago I just readded --strip-prefix, since you were using it correctly. The problem arose due the heuristics we did in casefolding which created messy bugs, i.e. if you specified --strip-prefix=gst, that would sort of work in the old scanner, but WebKit had no way for us to know their symbols look like web_kit, not webkit. Anyways... So I'll attach a new patch. > Is this correct? Will this yield the same namespace etc. as before? (ie. we > don't want e.g. GstBase or gst_base as identifier-prefix or symbol-prefix for > the util libs, right?) This should be identical, yes.
Created attachment 169986 [details] [review] updated patch
> Created an attachment (id=169986) [details] [review] > updated patch Pushed, thanks! I take it this means that the other two patches are obsolete now? commit cfadd1d93745f629f32fcf4d84d72bdf18c2bf29 Author: Colin Walters <walters@verbum.org> Date: Fri Sep 10 15:07:03 2010 -0400 introspection: Build with latest g-i Hide a compatibility typedef. https://bugzilla.gnome.org/show_bug.cgi?id=629241 https://bugzilla.gnome.org/show_bug.cgi?id=550616
I've now added a workaround in gobject-introspection git master, will appear in 0.9.6. http://git.gnome.org/browse/gobject-introspection/commit/?id=2b9df1ded8f4af871e6e6b7b7306230f1c33a51e
I think this can be closed now