PDA

View Full Version : Playing multiple media files using QT Gstreamer



Monalisa
4th April 2014, 10:42
Hi

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.

Thanks in advance.

ChrisW67
8th April 2014, 05:02
How have you determined that "it" is not returning resources?

Monalisa
8th April 2014, 06:14
Because there is a huge memory leak. And if i set the state to ready instead of null, there is no leak but after playing for 1-2 hours the video starts freezing.

ChrisW67
8th April 2014, 07:17
We have no idea what your code looks like, so we have no idea what "if i set the state to ready instead of null" might apply to or why that might change the behaviour. Other than statements like, "Make sure you free memory you allocate with new," there is not much to say.

What platform you are running on? We might guess Linux.
What input you are feeding the player?
What you have tried to find the leak? Have you run your program using valgrind?
What versions of Qt, GStreamer, compiler etc.
Does the example player show the same 'leak'?
Is it the problem related to certain media?
Can you produce a minimal, compilable program that demonstrates the 'leak'?

Monalisa
9th April 2014, 12:39
-> I am playing .flv & .webm media files of 5-10 sec.

-> I have used valgrind to find the leak, Valgrind result :
==13891== LEAK SUMMARY:
==13891== definitely lost: 53,843 bytes in 12 blocks
==13891== indirectly lost: 11,328 bytes in 352 blocks
==13891== possibly lost: 4,270,855 bytes in 9,201 blocks
==13891== still reachable: 7,705,096 bytes in 22,239 blocks
==13891== suppressed: 0 bytes in 0 blocks
==13891== Reachable blocks (those to which a pointer was found) are not shown.
==13891== To see them, rerun with: --leak-check=full --show-reachable=yes
==13891==
==13891== For counts of detected and suppressed errors, rerun with: -v
==13891== ERROR SUMMARY: 2834 errors from 2818 contexts (suppressed: 2 from 2)

-> I am using Qt Gstreamer0.10 version & ubuntu-12.04

-> the example player plays only one media but i am playing continuously, so found the leak

If anybody has an example program that plays more than one media file then please me help on this.