GNOME Bugzilla – Bug 727595
How to release resources on reaching end of stream
Last modified: 2014-06-21 18:07:13 UTC
My application plays multiple media files using Qt Gstreamer one after one in loop. When it reaches end of stream, I am setting the state to StateNull and then playing the next media. It is not releasing the resources allocated for the previous media and allocates again for playing the next file. What should I do to release the resources. Please suggest.
It's not clear whether you know you are doing things correctly and see a bug, or do not know how to do things correctly. If the former, a small test program would help. If the latter, this tracker is not the place for questions, and #gstreamer on irc.freenode.net would be better suited (unless there's a special place for qt-gstreamer). In the latter case, please just close as invalid. Otherwise, please supply the relevant small bit of code.
(In reply to comment #1) > It's not clear whether you know you are doing things correctly and see a bug, > or do not know how to do things correctly. If the former, a small test program > would help. If the latter, this tracker is not the place for questions, and > #gstreamer on irc.freenode.net would be better suited (unless there's a special > place for qt-gstreamer). In the latter case, please just close as invalid. > Otherwise, please supply the relevant small bit of code. I am doing things correctly because the gstreamer manual says "GST_STATE_NULL: this is the default state. No resources are allocated in this state, so, transitioning to it will free all resources." On reaching end of stream I am setting the state to null, but it seems it is not freeing resources as there is a huge memory leak. Instead if I set the state to GST_STATE_READY there is no memory leak but after playing continuously for 1-2 hours, the video starts freezing. code: void Player::onBusMessage(const QGst::MessagePtr & message) { switch (message->type()) { case QGst::MessageEos: //End of stream. We reached the end of the file. { if (m_pipeline) { m_pipeline->setState(QGst::StateNull); playNext(); } } break; } }
It might be worth tracking down the memory leak. Can you reproduce it by playing a single file? Can you reproduce it using gst-launch? Did you try using valgrind to check what is leaking?
Closing since no further information has been provided, and the code base has been ported to 1.x in git in the mean time. Please feel free to re-open or file a new bug if you can provide the information requested, thanks!