pipeline elements memory management

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

pipeline elements memory management

themanonthemoon
If I create elements using gst_element_factory_make(...), add the elements to
a pipeline and then unref the pipeline, will that automatically unref the
elements in the pipeline?

It's a little unclear how memory management works with the elements. The
examples don't ever free the elements, and I don't see any info in the docs
about who owns the elements.




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

Re: pipeline elements memory management

Mathieu Duponchelle
Yes it will, as GstElement inherits from GInitiallyUnowned.

If for one reason or another your call to gst_bin_add() fails unreffing the element remains your responsibility.

On 11/9/18 2:54 AM, themanonthemoon wrote:

> If I create elements using gst_element_factory_make(...), add the elements to
> a pipeline and then unref the pipeline, will that automatically unref the
> elements in the pipeline?
>
> It's a little unclear how memory management works with the elements. The
> examples don't ever free the elements, and I don't see any info in the docs
> about who owns the elements.
>
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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