summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-28 14:45:28 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-28 16:49:43 +0100
commitbd25aeb6ca3201d50bd8780c288b44b1c8b2fc44 (patch)
tree88fcd031da1a6668e4e6626c22a733c30523f72e /gst-libs/gst
parent6ec3d9d8fee2141a0d1c21f001089b390f8bc51a (diff)
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.
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay_wayland.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
index ec2c81a2..bb91128b 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
@@ -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;