Skip to content

gl/dispmanx: fix deadlock triggered by `set_render_rectangle`

When the gstglimagesink is started with the option glimagesink render-rectangle="<0,0,1920,1080>", the pipeline reaches a deadlock. The reason the deadlock occurs is that the gst_gl_window_set_render_rectangle takes locks on the window, in addition it calls window_class->set_render_rectangle(...) which executes the _on_resize function. Since the _on_resize function also takes locks on the window the deadlock is achieved.

By scheduling the adjustment of the render rectangle through an async message for gst_gl_window_dispmanx_set_render_rectangle, the actual resize happens in another context and therefore doesn't suffers from the lock taken in gst_gl_window_set_render_rectangle.

This solution follows the same approach as gl/wayland. The problem was introduced by b887db1e. For the full discussion check #849 (closed).

Merge request reports