GStreamer and gjs

Tony Houghton h at realh.co.uk
Sat Oct 3 21:20:01 UTC 2020


I've learnt the hard way that it's important to be aware of floating
references with gstreamer. In a simple gjs script to run a playbin I was
having problems with various symptoms, including the pipeline usually
stalling or deadlocking or something, that I couldn't track down. Then on a
different machine the symptoms included lots of errors about unreffing
objects while the pipeline was still in PLAYING state. I added
gst_object_ref_sink() where appropriate and all the problems went away. But
I have to use ref_sink() in the Javascript too. If I miss out the second of
these two lines, I get all the nasty symptoms back;

    const playbin = Gst.ElementFactory.make("playbin", "play");
    playbin.ref_sink();

I think bindings are supposed to be able to work without explicit (user)
calls to ref_sink() when they encounter '(transfer floating)' aren't they?
So does gjs not support this (yet)?

On Mon, 21 Sep 2020 at 16:55, Tony Houghton <h at realh.co.uk> wrote:

> I'm having some trouble using GStreamer with gjs. I wasn't sure whether it
> was supposed top be supported at all, because Javascript isn't mentioned in
> its list of bindings <https://gstreamer.freedesktop.org/bindings/>, and
> other bindings, like python, seem to need help from custom bindings instead
> of being able to rely on gi alone. But the API docs support Javascript, so
> it seems like gjs is intended to be supported.
> --
>
TH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201003/737db862/attachment.htm>


More information about the gstreamer-devel mailing list