wxMediaCtrl wayland support: disable xvimagesink on wayland

gstreamer is known to crash on xvimagesink if the main window is
wayland-native and DISPLAY is set: try to make it not load.

Also do the same for ximagesink just in case.
This commit is contained in:
Dominique Martinet
2021-06-08 10:22:51 +09:00
parent b16aba57b1
commit 0080aa6086

View File

@@ -389,6 +389,23 @@ bool wxGStreamerMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent,
gst_bus_add_signal_watch(bus);
gst_bus_set_sync_handler(bus, bus_sync_handler, this, NULL);
gst_object_unref(bus);
// xvimagesink is known to crash gstreamer with a wayland window
// if display is set; try to make it not load.
GstPluginFeature *feature;
feature = gst_registry_find_feature(
gst_registry_get(), "xvimagesink", GST_TYPE_ELEMENT_FACTORY
);
if (feature) {
gst_plugin_feature_set_rank(feature, GST_RANK_NONE);
}
// same for ximagesink
feature = gst_registry_find_feature(
gst_registry_get(), "ximagesink", GST_TYPE_ELEMENT_FACTORY
);
if (feature) {
gst_plugin_feature_set_rank(feature, GST_RANK_NONE);
}
}
g_signal_connect(m_player, "video-dimensions-changed", G_CALLBACK(video_dimensions_changed_callback), this);