Proper way to clean up a GstPipeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Proper way to clean up a GstPipeline

pisymbol .
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:


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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Proper way to clean up a GstPipeline

Edward Hervey-4
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
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Proper way to clean up a GstPipeline

pisymbol .


On Mon, Jan 25, 2021 at 4:07 AM Edward Hervey <[hidden email]> wrote:
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.


That is what I assumed (I didn't look). Alright, thanks!

-aps

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel