I use the SurfaceTexture.OnFrameAvailableListener interface in my application, so I can use video frames as an OpenGL texture. Everything is set up as it should and works fine, but onFrameAvailable (SurfaceTexture surfaceTexture) stops calling after a few seconds, effectively and seemingly freezing the video in OpenGL, since no new texture is loaded via SurfaceTexture.updateTextImage.
I set a flag in onFrameAvailable to call updateTextImage from the GL stream and only if necessary. Currently, I set the flag to true with every callback, so the textured textures of the video are loaded every frame when the onFrameAvailable function is skipped. Like everything, everything works as it should, but it seems inefficient, since no new textured files need to be downloaded if they are still the same (movie frame).
AFAIK there are no memory leaks and logcat does not show any errors. In addition, the media player is configured to cycle, but the problem occurs before the completion of one run.
What can cause onFrameAvailable to no longer be called in a few seconds?
source share