GNOME Bugzilla – Bug 734830
GstGLMixer gl resource race condition
Last modified: 2014-08-19 07:14:01 UTC
Created attachment 283432 [details] demo code to trigger the bug while pipeline dynamic changed, gst_gl_mixer_decide_allocation (runs on app main thread) will re-allocate fbo/depth_texture, but gst_gl_mixer_process_textures(runs on GstAggregator's own main context thread,) may still runs. leads invalid gl object access . the demo code is modified "dynamic change pipeline element " from gstreamer manual , this demo will trigger *: gint gst_gl_shader_get_attribute_location(GstGLShader *, const gchar *): assertion 'priv->program_handle != 0' failed or fbo !=0 assert while changing elements (the GstAggregator use buffer timestamp to decide which buffers to display,so it didn't fit dynamic element very well. only first a few element changes can be viewed)
Created attachment 283433 [details] [review] a patch try to fix the bug this patch makes GstGLMixer always wait all gl objects created ready before calling process_textures, and hold the lock until process_textures finished. but I'm not sure if this works in all conditions.
Thanks for the patch commit 98152017b7f866bc4d87c434b6ae1b0f978245ff Author: Wang Xin-yu (王昕宇) <comicfans44@gmail.com> Date: Thu Aug 14 23:51:21 2014 -0400 glvideomixer: avoid gl resource race condition between different thread https://bugzilla.gnome.org/show_bug.cgi?id=734830
and 1.4 91b12ea3ef5e9e532b1bc9c4d7e6dab60158cbda