The problem is that memory consumption of the application increases
continuously, if the pipeline is
stopped by setting its state to GST_STATE_NULL and then restarted by setting
the state to
GST_STATE_PLAYING. It seems that the growth happens because the application
a new EGL context every time the pipeline is started, but it is not deleted
when the pipeline is stopped.
The relevant functions are in gstvaapiutils_egl.c file:
- ensure_context() which calls eglCreateContext()
- egl_context_finalize() which calls eglDestroyContext() only if the
context is not 'wrapped'
I'm not sure why the pipeline creates a new 'wrapped' context each time it
is restarted, but skipping
eglDestroyContext() when closing them seems more suspicious to me. Could
someone shed light
on this logic?
I'm using the GStreamer version compiled from the master branch, but the
behavior is similar
in the 1.14 branch. The application is running on Ubuntu 18.04.
GST_GL_PLATFORM is set to 'egl'.
The application sets also 'gst.gl.app_context' and 'gst.gl.GLDisplay'
GStreamer contexts to OpenGL
context and display values that originate in Qt application code.