Reference counter when getting EOS

Tim-Philipp Müller t.i.m at
Wed Jul 17 13:37:54 PDT 2013

On Wed, 2013-07-17 at 17:11 +0200, Thomas Scheuermann wrote:
> Am 17.07.2013 16:53, schrieb Brendan Long:
> > On 07/17/2013 03:41 AM, Thomas Scheuermann wrote:
> >> If the pipeline gets an EOS signal and I shutdown the pipeline, the
> >> reference counter of my decoder element is still 1.
> > Did you unref the pipeline? It will hold a reference to all of the
> > elements in it.
> Yes, I unref the pipeline. This is how I shutdown the pipeline.
> I have an event loop which is left if it gets the EOS message or if I
> press a key.
> If I press a key the everything is OK and the finalize function of my
> element is called.
> If the event loop gets the EOS message, the finalize function of my
> element is not called.
> At the moment I don't know how to dig deeper into this problem.
> Any help is appreciated.

One way would be to try and come up with a minimal test program that
exhibits the issue, and then share it with us. It's a bit hard to help
without seeing the code, other than suggesting the things that have
already been suggested (valgrind etc.).

Do you do gst_element_set_state (pipeline, GST_STATE_NULL) as well when
shutting down? (before unreffing it)

Are you sure you unref all GstBus messages? (depends on context if
that's needed or not).


More information about the gstreamer-devel mailing list