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 590348 - [audio (and other modules)] can't use pygstminiobject !
[audio (and other modules)] can't use pygstminiobject !
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal blocker
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 592473
 
 
Reported: 2009-07-31 08:44 UTC by Edward Hervey
Modified: 2010-10-18 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test_audio.py (1.55 KB, application/octet-stream)
2009-07-31 08:45 UTC, Edward Hervey
  Details
patch to fix this (3.21 KB, patch)
2009-08-21 14:13 UTC, Johannes Berg
none Details | Review
patch to fix this issue by using only one pygstminiobject (3.31 KB, patch)
2009-08-21 14:17 UTC, Johannes Berg
none Details | Review
patch to fix this issue by using only one pygstminiobject (2.90 KB, patch)
2009-08-21 14:23 UTC, Johannes Berg
none Details | Review
patch to fix this (3.01 KB, patch)
2009-08-21 14:37 UTC, Johannes Berg
none Details | Review
sample patch - does NOT work (4.48 KB, patch)
2009-11-02 17:29 UTC, Yaakov Selkowitz
none Details | Review

Description Edward Hervey 2009-07-31 08:44:35 UTC
Due to the way pygstminiobject is written... we can't use that code from external modules (like gst.audio).

The attached patch contains a unit test demonstrating the usage of a gst.audio command that:
* creates a new gst.Buffer (calling the pygstminiobject code from the *main* 'gst' module)
* call gst.audio.buffer_clip (calling the pygstminiobject code... from the 'gst.audio' module).

Basically we need to expose the pygstminiobject code as pygobject now does it for pygobject. This is explained in a generic fashion here : http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module
Comment 1 Edward Hervey 2009-07-31 08:45:46 UTC
Created attachment 139610 [details]
test_audio.py

Put this in testsuite/, and run it from that directory using 'make test_audio.py.check'

bilboed@hostia ~/work/devel/gst-python.git/testsuite $ make test_audio.py.check

** ERROR **: Couldn't find a good base type!!
aborting...
make: *** [test_audio.py.check] Aborted
Comment 2 Johannes Berg 2009-08-21 14:13:20 UTC
Created attachment 141332 [details] [review]
patch to fix this

This fixes it by using a common class key/id that is linked into _gst.so and then can be used by the other modules. pygstminiobject itself is linked into all of them still, that can be changed too.
Comment 3 Johannes Berg 2009-08-21 14:17:06 UTC
Created attachment 141342 [details] [review]
patch to fix this issue by using only one pygstminiobject

This is better -- it also shrinks code size.
Comment 4 Johannes Berg 2009-08-21 14:23:38 UTC
Created attachment 141343 [details] [review]
patch to fix this issue by using only one pygstminiobject

now applies before the gstapp patch
Comment 5 Johannes Berg 2009-08-21 14:37:18 UTC
Created attachment 141346 [details] [review]
patch to fix this

now done with git format-patch
Comment 6 Alessandro Decina 2009-08-21 14:46:34 UTC
commit e2de828bba15a458f05ccc23d5f28cf9914e8658
Author: Johannes Berg <johannes@sipsolutions.net>
Date:   Fri Aug 21 16:22:38 2009 +0200

    Use only one copy of pygstminiobject. Fixes #590348.
    
    Instead of linking pygstminiobject.c into all the modules,
    we can link it only into _gst and export the symbols for
    the other modules. This fixes bug #590348 because now the
    class key/id is common for all modules as a side-effect.
    Also makes the modules smaller.
Comment 7 Yaakov Selkowitz 2009-11-02 00:52:39 UTC
This breaks the build on Cygwin and MinGW platforms where all symbols must be resolved at link time; all modules except for _gst fail to link with undefined references to pygstminiobject_new.

Another way needs to be found to fix this issue; please reopen.
Comment 8 Tim-Philipp Müller 2009-11-02 10:36:23 UTC
Re-opening as requested (so it doesn't get missed).
Comment 9 Johannes Berg 2009-11-02 10:43:52 UTC
Uh, I didn't get a copy of the original complaint and now only noticed via bug #592473, odd ...

So what does it mean "must be resolved at link time"? Can we link the libraries against each other somehow on cygwin/mingw and keep this patch?
Comment 10 Yaakov Selkowitz 2009-11-02 16:34:04 UTC
(In reply to comment #9)
> So what does it mean "must be resolved at link time"? Can we link the libraries 
> against each other somehow on cygwin/mingw and keep this patch?

No, I think your best bet would be to make a libpygst (like libpyglib in pygobject) with pygstminiobject.c (and possibly gst-argtypes.c, as that is also used by all the modules) and link everything against that.
Comment 11 Yaakov Selkowitz 2009-11-02 17:29:15 UTC
Created attachment 146768 [details] [review]
sample patch - does NOT work

This patch should give you an idea of what I have in mind.  It does NOT work yet because libpygst fails to link due to undefined references to _PyGObject_API.  I suppose that means that some type/function registration needs to be added for this to work, but I'll need your help with that.
Comment 12 Edward Hervey 2010-10-18 07:26:57 UTC
This is a blocker for the latest pbutils updates (the Discoverer Info are miniobjets).
Comment 13 Edward Hervey 2010-10-18 10:01:44 UTC
commit 0238e12e013eaec3782070bcaa6c81543473f60a
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Mon Oct 18 11:59:03 2010 +0200

    gst: Make all libraries use shared PyGst_API
    
    Fixes #590348

commit 3e73bfc4b292b594cd68eb2b79aa388e072887a8
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Mon Oct 18 11:50:19 2010 +0200

    gst: Export some pygst API to be used by external modules
    
    Partially fixes #590348