GStreamer and gjs

Sebastian Dröge sebastian at centricular.com
Mon Sep 21 20:25:16 UTC 2020


On Mon, 2020-09-21 at 20:20 +0100, Tony Houghton wrote:
> 
> > Your code doesn't have any main loop or similar, so after setting the
> > pipeline to PLAYING it simply exits. You probably want to wait in one
> > way or another until the EOS (or ERROR) message is received from the
> > bus.
> 
> Sorry, my code does include a GMainLoop, but I missed it out here for
> brevity. Without the watch callback my code seems to work OK, but
> with the callback it only runs for a few seconds (it does open a
> window and play back the stream for a while) before stopping with the
> above error.
> 
> I've tried a few other things. Equivalents in C and python both run
> successfully. The Javascript version also runs OK if I use
> add_signal_watch() instead of add_watch(). So I think the problem is
> that gjs can't cope with a callback being called off the main thread.
> This could theoretically cause problems in python too, but I presume
> it works either because this has been addressed in its custom Gst
> bindings, or at a lower level. I'm writing a companion library in
> introspectable C for my app, so if I need synchronous callbacks for
> something like embedding video in a window of my choice, I can
> probably add support functions in the library.

In Python that's not a problem, the callbacks can come from any thread.
There's just Python's global interpreter lock that will block
everything else while some other thread calls into Python code.

Can you provide a full gjs example for the application that causes the
problem above? Seems like another bug in gjs to me though but I can
take a short look first :)


Thanks for reporting the issues btw!

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com




More information about the gstreamer-devel mailing list