After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727595 - How to release resources on reaching end of stream
How to release resources on reaching end of stream
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
0.10.0
Other Linux
: Normal critical
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-04 09:45 UTC by monalisabarik29
Modified: 2014-06-21 18:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description monalisabarik29 2014-04-04 09:45:44 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.
Comment 1 Vincent Penquerc'h 2014-04-04 13:42:48 UTC
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.
Comment 2 monalisabarik29 2014-04-07 05:19:16 UTC
(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;
	}
}
Comment 3 Thiago Sousa Santos 2014-05-14 21:04:37 UTC
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?
Comment 4 Tim-Philipp Müller 2014-06-21 18:07:13 UTC
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!