Dynamic pipelines: how to remove sinks?

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Dec 31 07:14:32 PST 2012


On Mon, 2012-12-31 at 16:53 +0200, Mohammed Sameer wrote:

> > It should not matter. If there's a leak or warning or crash, that's a
> > bug that needs to be fixed. But I would expect udpsink to be fairly
> > well-tested and robust in this respect.
> > 
> > Setting the sink to NULL state from a running pipeline is quite normal
> > when an application shuts down a pipeline. Whether you unlink upstream
> > before that or not should not make a difference in this case.
> 
> I'm not yet familiar with 1.0 but I'm sure we cannot generalize.
> 
> At least in 0.10, sink element might be responsible for memory allocation and
> it can free that memory when we set it to NULL. Of course GstBuffer is reference
> counted and it should free the underlying memory segment when it gets destroyed
> but think of hardware backed address segment which has to be either freed when
> sink is not playing or leaked.
> 
> I hope I'm not mistaken here.

The mechanisms are slightly different in 1.0 (bufferpools and memory
allocators and such are all exposed as part of the API now), but in
principle it's still the same.

You are right of course that sinks that do this kind of thing (allocate
special memory) must take care to make sure the memory doesn't get freed
while someone is still holding on to buffers. So you need to separate
that from the freeing of the sink element.

That doesn't change the fact that this should still work fine in
general, and if it doesn't, it's probably a bug somewhere (or a sink
plugin taking shortcuts for convenience).

But anyway, the question was about udpsink.

Cheers
 -Tim



More information about the gstreamer-devel mailing list