glimagesink: GstVideoOverlay interface sometimes fail to set a window handle
When utilizing the video overlay interface with glimagesink it sometimes opens a new "OpenGL Renderer" window although i set the handle to an valid & existing gdk window (x11)
After looking into the code it seems the overlay interface _set_handle function points to gst_glimage_sink_set_window_handle but the function that actually sets the handle is gst_gl_window_set_window_handle which is called by the prepare cb of the sink base class and this may be called too late (expose event sometimes occurs before that and this is result in a mapping of a newly created window although application has called overlay_set_handle with an existing one).
For example the attached diff seems to fix it but possibly it is not correct, (also if someone can shed more light on this part of the code or on how to fix it please do). diff.diff