Dynamic pipelines: how to remove sinks?

Mohammed Sameer msameer at foolab.org
Mon Dec 31 06:53:32 PST 2012


On Sun, Dec 30, 2012 at 11:26:36PM +0000, Tim-Philipp Müller wrote:
> On Sun, 2012-12-30 at 17:16 -0600, Tal Liron wrote:
> 
> Hi,
> 
> > But ... what about network sinks? I currently support a udpsink (with an 
> > rtpL15pay). Would there be any harm in unlinking it and removing it 
> > while there's still something in its buffers?
> > 
> > I don't care about data loss here, I just want to avoid memory leaks, 
> > assertion failures, or other crashes. I'm assuming the sink elements 
> > know how to destroy themselves properly and release their resources, ... 
> > well, I'm hoping. ;)
> 
> 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.

Cheers,

-- 
GPG-Key: 0xA3FD0DF7 - 9F73 032E EAC9 F7AD 951F  280E CB66 8E29 A3FD 0DF7
Debian User and Developer.
Homepage: www.foolab.org


More information about the gstreamer-devel mailing list