Free resources in gst.parse_bin_from_description

Ruben Gonzalez rubenrua at teltek.es
Wed Feb 27 09:16:10 PST 2013


Dear Community,

We are working in an application that uses Python 2.7 and Gstreamer 0.10 to
record dual-stream videos, called Galicaster. Lately we've been carrying
out some stress tests because we were not happy with the app stability.

Galicaster does not free resources correctly after a recording. We have
noticed this after discovering that the number of file descriptors open by
Galicaster (in /proc/PID/fd) steadily grows with each recording. The
underlying problem is that some resources open by the recording pipeline
are never freed. For instance, sockets created by alsasink stay there after
the pipeline is closed. This behaviour cannot be reproduced in C, only
using python. In [1] you can see the full code used in the tests.

After studying the problem, we have found the bug is in
gst.parse_bin_from_description(). Examples:


*Does not properly free its resources*:


self.pipeline = gst.Pipeline()
aux = "audiotestsrc ! alsasink"
self.bin = gst.parse_bin_from_description(aux, False)
self.pipeline.add(self.bin)

*Frees resources properly*:


self.pipeline = gst.Pipeline()
src = gst.element_factory_make('audiotestsrc')
sink = gst.element_factory_make('alsasink')
mbin = gst.Bin()
mbin.add(src, sink)
self.pipeline.add(mbin)
src.link(sink)

*Frees resources properly*:

self.pipeline = gst.Pipeline()
aux = "(audiotestsrc ! alsasink)"
self.bin = gst.parse_launch(aux)
self.pipeline.add(self.bin)


We are using the last example as a workaround -- using gst.parse_launch and
surrounding the description with brackets "()".

We are planning to port the application to Gstreamer 1.0 . We would like to
know if this bug is known and/or fixed in the 1.0 version.

--
Regards/Un Saludo

Ruben Gonzalez Gonzalez
TELTEK Video Research
http://teltek.es/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130227/8846fd6d/attachment.html>


More information about the gstreamer-devel mailing list