mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
wayland: fix display sharing.
When the Wayland display is shared, we still have to create our own local shell and compositor objects, since they are not propagated from the cache. Likewise, we also need to determine the display size or vaapisink would fail to account for the display aspect ratio, and will try to create a 0x0 window.
This commit is contained in:
parent
0ed1735d8b
commit
087bf30c23
1 changed files with 13 additions and 6 deletions
|
@ -285,12 +285,11 @@ gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
|
|||
GstVaapiDisplayWaylandPrivate * const priv =
|
||||
GST_VAAPI_DISPLAY_WAYLAND(display)->priv;
|
||||
|
||||
if (!priv->create_display)
|
||||
return priv->wl_display != NULL;
|
||||
|
||||
priv->wl_display = wl_display_connect(get_display_name(display));
|
||||
if (!priv->wl_display)
|
||||
return FALSE;
|
||||
if (priv->create_display) {
|
||||
priv->wl_display = wl_display_connect(get_display_name(display));
|
||||
if (!priv->wl_display)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wl_display_set_user_data(priv->wl_display, priv);
|
||||
priv->registry = wl_display_get_registry(priv->wl_display);
|
||||
|
@ -298,6 +297,14 @@ gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
|
|||
priv->event_fd = wl_display_get_fd(priv->wl_display);
|
||||
wl_display_roundtrip(priv->wl_display);
|
||||
|
||||
if (!priv->width || !priv->height) {
|
||||
wl_display_roundtrip(priv->wl_display);
|
||||
if (!priv->width || !priv->height) {
|
||||
GST_ERROR("failed to determine the display size");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!priv->compositor) {
|
||||
GST_ERROR("failed to bind compositor interface");
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue