[gst-devel] Threads and gst-python

Martin Soto soto at informatik.uni-kl.de
Wed Oct 20 06:30:27 CEST 2004

Hi everyone!

(As far as I know, there's no separate list for gst-python, please let
me know if I'm wrong).

So, this week I updated my CVS copy of gst-python, just to notice that
it now requires the shiny new PyGTK 2.4. The other thing I noticed is
that it breaks my application badly :-(

Investigating a bit more into the problem, pointed me directly to the
usual suspect: my app (a DVD player written mainly in Python) creates a
number of GStreamer threads which in turn emit signals that are being
handled in Python (i.e. Python procedures/methods are being connected to
the signals). As soon as one of those threads emits a signal, the
program dies with a segmentation fault.

The problem was already known to me, and I've had already hacked
gst-python to sort of fix it. My patch, however, was based on the older
block_threads and unblock_threads hooks in the PyGTK API, that seem to
have been deprecated in PyGTK 2.4.

Additionally, Looking into PyGTK, I see it now relies on the new PyGIL*
API calls described in PEP 311, which, if used properly, should actually
solve my problem. Nevertheless, things don't work and I cannot tell why.

My question is: should I expect my program to work with an unpatched
gst-python? If so, is there something special I should do
(initialization?) to make things work? On the other hand, if I had to
patch gst-python, where should I hook my code?

Thanks a lot,

M. S.
Martin Soto <soto at informatik.uni-kl.de>
Universität Kaiserslautern

More information about the gstreamer-devel mailing list