When gst_vaapisink_video_overlay_set_window_handle() is called early,
before the pipeline has been set to PLAYING, the display has not yet
been initialized and _PLUGIN_BASE_DISPLAY_TYPE() is not yet
up-to-date. For this reason the foreign XID is not attached.
Now _ensure_display() is called earlier.
https://bugzilla.gnome.org/show_bug.cgi?id=722244
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
#define DEFAULT_DISPLAY_TYPE GST_VAAPI_DISPLAY_TYPE_ANY
#define DEFAULT_ROTATION GST_VAAPI_ROTATION_0
+static inline gboolean
+gst_vaapisink_ensure_display(GstVaapiSink *sink);
+
/* GstVideoOverlay interface */
#if USE_X11
guintptr window)
{
GstVaapiSink * const sink = GST_VAAPISINK(overlay);
- GstVaapiDisplayType display_type = GST_VAAPI_PLUGIN_BASE_DISPLAY_TYPE(sink);
+ GstVaapiDisplayType display_type;
+
+ if (!gst_vaapisink_ensure_display(sink))
+ return;
+ display_type = GST_VAAPI_PLUGIN_BASE_DISPLAY_TYPE(sink);
/* Disable GLX rendering when vaapisink is using a foreign X
window. It's pretty much useless */