Basic Tutorial 5 should use a bus sync handler
Basic tutorial 5 (https://gstreamer.freedesktop.org/documentation/tutorials/basic/toolkit-integration.html?gi-language=c) calls gst_video_overlay_set_window_handle
in the realize_cb
function. While this works for the specific example, it doesn't work in the general case.
For example, if you modify this example to use a pipeline that ends with an ximagesink
(instead of a playbin
element), the window will open, but no video will play in it.
The reason is that the call needs to be done at a later time. Code should register a bus sync handler, and call gst_video_overlay_set_window_handle
when a video-overlay-prepare-window-handle message is received.
This is documented here: https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c
Basic Tutorial 5 should be updated to use this mechanism so it can serve as a template for developers writing new code.