PDA

View Full Version : Memory leak after deletion of a GStreamer element on embedded linux board



qtsmartcoder
27th November 2012, 20:55
I am trying to implement a video Player on an Embedded Linux Boaed (OFSP7 ultratronik.de) using The Ångström Distribution and Embedded Qt 4.7
In my code I construct an GstElement within my qt4.7 Application's VideoPlayerWidget (the player does not have an own mainloop as it is part of my Qt App), feed the video source Name and set the Element to the PLAYING state. This works and the video is visible on screen!

After that, I would like to delete the player in setting the State to NULL and using the "unref" mechanism to free all the allocated memory. The problem is, that NOT all of the memory gets freed, what ends up in slowly filling up my memory till the board crashes...

Does anyone have a clue how to delete the player properly...




// construction of a GstElement to play a video
gst_init(NULL, NULL);
GstElement *pipeline = gst_element_factory_make("playbin", "player");
g_object_set(G_OBJECT(pipeline), "uri", uri, NULL);
gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);
...
...
// delete player and free memory
gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);
gst_object_unref(GST_OBJECT(pipeline));
...

Snix
28th November 2012, 10:11
It looks like memory leak in some GstElement, you can try Valgrind to locate:

http://www.developer.nokia.com/Community/Wiki/Using_valgrind_with_Qt_Creator

and

http://wiki.buzztard.org/index.php/Debugging#Valgrind

or try to use the latest version of Gstreamer