After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550616 - Add support for GObject-Introspection and provide GIR file with introspection data
Add support for GObject-Introspection and provide GIR file with introspection...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: NONE
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on: 568913 576327 594202 594223 594236
Blocks: 585444
 
 
Reported: 2008-09-03 07:12 UTC by Sebastian Dröge (slomo)
Modified: 2011-05-10 07:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch with suggested changes (3.77 KB, patch)
2010-09-07 23:45 UTC, Lucas Rocha
none Details | Review
update to 0.9.5 (5.10 KB, patch)
2010-09-10 17:26 UTC, Colin Walters
none Details | Review
Update gst-plugins-base to 0.9.5 (8.14 KB, patch)
2010-09-10 17:52 UTC, Lucas Rocha
none Details | Review
updated patch (816 bytes, patch)
2010-09-10 19:25 UTC, Colin Walters
committed Details | Review

Description Sebastian Dröge (slomo) 2008-09-03 07:12:55 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.
Comment 1 Sebastian Dröge (slomo) 2009-09-05 08:30:30 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2009-09-05 11:21:34 UTC
And bug #594223 should be solved so we can use nested namespaces like Gst.Base instead of GstBase...
Comment 3 Sebastian Dröge (slomo) 2009-09-05 16:04:52 UTC
...and bug #594236 to get GstMiniObject handled correctly.
Comment 4 Lucas Rocha 2010-09-07 15:52:20 UTC
FYI: with the new g-ir-scanner that landed in git master recently, the introspection build in gstreamer is broken.
Comment 5 Johan (not receiving bugmail) Dahlin 2010-09-07 15:56:31 UTC
The solution is to bump the g-i dependency and add --identifier-prefix=Gst --symbol-prefix=gst to all gir generation
Comment 6 Tim-Philipp Müller 2010-09-07 16:03:10 UTC
(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?
Comment 7 Lucas Rocha 2010-09-07 23:44:30 UTC
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
Comment 8 Lucas Rocha 2010-09-07 23:45:35 UTC
Created attachment 169719 [details] [review]
Patch with suggested changes

Here's the patch with jdahlin's suggested changes. Applies to gstreamer's git master.
Comment 9 Kjartan Maraas 2010-09-10 16:39:38 UTC
I tried the patch and got the build error mentioned here:
https://bugzilla.gnome.org/show_bug.cgi?id=629241
Comment 10 Colin Walters 2010-09-10 17:26:16 UTC
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.
Comment 11 Lucas Rocha 2010-09-10 17:52:38 UTC
Created attachment 169980 [details] [review]
Update gst-plugins-base to 0.9.5
Comment 12 Tim-Philipp Müller 2010-09-10 18:10:36 UTC
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?)
Comment 13 Colin Walters 2010-09-10 19:25:19 UTC
(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.
Comment 14 Colin Walters 2010-09-10 19:25:46 UTC
Created attachment 169986 [details] [review]
updated patch
Comment 15 Tim-Philipp Müller 2010-09-12 15:49:35 UTC
> 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
Comment 16 Colin Walters 2010-09-15 21:34:39 UTC
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
Comment 17 Sebastian Dröge (slomo) 2011-05-09 10:05:48 UTC
I think this can be closed now