Proper way to clean up a GstPipeline

Edward Hervey bilboed at bilboed.com
Mon Jan 25 09:07:38 UTC 2021


Hi,

  The python bindings automatically take care of any ownership and reference
counting. ex: doing `pipeline = None` essentially removes the reference that
your python variable `pipeline` was holding on the pipeline. Same thing would
happen once that python variable is no longer referenced by anything else.

  tdlr; there's no reason to use ref/unref from python code, the bindings take
care of that.

  BR,

     Edward

On Fri, 2021-01-22 at 16:00 -0500, Alexander Sack wrote:
> Hello all:
> 
> Really simple, dumb question:
> 
> For all of my pipelines, I shutdown/clean like so:
> 
> pipeline.state = Gst.NULL
> pipeline = None
> 
> But I just read here:
> 
> https://gstreamer.freedesktop.org/documentation/gstreamer/gstpipeline.html?gi-language=python
> 
> I should also include a pipeline.unref()? But that yields things like:
> 
> (foobar:20365): GStreamer-CRITICAL **: 15:56:51.646: gst_object_unref:
> assertion '((GObject *) object)->ref_count > 0' failed
> 
> What is the official/correct way to completely clean-up a pipeline from within
> a Python application? The pipeline is created using parse() (and the pipeline
> has been validated witih gst-launcher-1.0).
> 
> Also, if I don't care about EOS can't I just clean up the pipeline without
> handling any bus messages (think a viewer where capturing any flushed out
> frames is immaterial and I just want to close immediately and free all
> resources).
> 
> Thanks!
> 
> -aps
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list