Handling of EGL contexts in gstreamer-vaapi?

jleino juha.leino at optofidelity.com
Mon Feb 18 15:42:54 UTC 2019


Hi all,

I have an application using the pipelines like

rtspsrc ! queue ! rtph264depay ! vaapih264dec ! vaapipostproc ! glupload !
glcolorconvert ! appsink.

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
creates
 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.

Thanks,
Juha




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list