vaapi: register vaapisink as marginal on wayland

vaapsink, when used with the Intel VA-API driver, tries to display
surfaces with format NV12, which are handled correctly by
Weston. Nonetheless, COGL cannot display YUV surfaces, making fail
pipelines on mutter.

This shall be solved either by COGL or by making the driver to paint
RGB surfaces. In the meanwhile, let's just demote vaapisink as
marginal when the Wayland environment is detected, no matter if it is
Weston.

https://bugzilla.gnome.org/show_bug.cgi?id=775698
This commit is contained in:
Víctor Manuel Jáquez Leal 2018-02-12 17:53:58 +01:00
parent 19fe5c4d07
commit c653cb55f9

View file

@ -210,6 +210,7 @@ plugin_init (GstPlugin * plugin)
{
GstVaapiDisplay *display;
GArray *decoders;
guint rank;
plugin_add_dependencies (plugin);
@ -234,8 +235,11 @@ plugin_init (GstPlugin * plugin)
gst_element_register (plugin, "vaapidecodebin",
GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN);
gst_element_register (plugin, "vaapisink",
GST_RANK_PRIMARY, GST_TYPE_VAAPISINK);
rank = GST_RANK_PRIMARY;
if (g_getenv ("WAYLAND_DISPLAY"))
rank = GST_RANK_MARGINAL;
gst_element_register (plugin, "vaapisink", rank, GST_TYPE_VAAPISINK);
#if USE_ENCODERS
gst_vaapiencode_register (plugin, display);
#endif