Title: [206446] trunk/Source/WebCore
Revision
206446
Author
g...@gnome.org
Date
2016-09-27 11:03:59 -0700 (Tue, 27 Sep 2016)

Log Message

[GTK] Handle Wayland & X11 correctly for GST_GL
https://bugs.webkit.org/show_bug.cgi?id=162619

Reviewed by Carlos Garcia Campos.

The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
turns out we can enable both! We need to check them independently and also include
a runtime check.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
Wayland to handle the case where both are enabled. Includes a runtime check.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206445 => 206446)


--- trunk/Source/WebCore/ChangeLog	2016-09-27 17:58:44 UTC (rev 206445)
+++ trunk/Source/WebCore/ChangeLog	2016-09-27 18:03:59 UTC (rev 206446)
@@ -1,3 +1,18 @@
+2016-09-27  Gustavo Noronha Silva  <gustavo.noro...@collabora.co.uk>
+
+        [GTK] Handle Wayland & X11 correctly for GST_GL
+        https://bugs.webkit.org/show_bug.cgi?id=162619
+
+        Reviewed by Carlos Garcia Campos.
+
+        The checks for GST_GL consider X11 and Wayland are exclusive alternatives, but it
+        turns out we can enable both! We need to check them independently and also include
+        a runtime check.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): fix checks for X11 and
+        Wayland to handle the case where both are enabled. Includes a runtime check.
+
 2016-09-27  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] Restructure MediaConstraints classes

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (206445 => 206446)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2016-09-27 17:58:44 UTC (rev 206445)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2016-09-27 18:03:59 UTC (rev 206446)
@@ -61,7 +61,9 @@
 
 #if PLATFORM(X11)
 #include "PlatformDisplayX11.h"
-#elif PLATFORM(WAYLAND)
+#endif
+
+#if PLATFORM(WAYLAND)
 #include "PlatformDisplayWayland.h"
 #endif
 
@@ -256,13 +258,20 @@
     if (!m_glDisplay) {
 #if PLATFORM(X11)
 #if USE(GLX)
-        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
+        if (is<PlatformDisplayX11>(sharedDisplay))
+            m_glDisplay = GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
 #elif USE(EGL)
-        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
+        if (is<PlatformDisplayX11>(sharedDisplay))
+            m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
 #endif
-#elif PLATFORM(WAYLAND)
-        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).native()));
 #endif
+
+#if PLATFORM(WAYLAND)
+        if (is<PlatformDisplayWayland>(sharedDisplay))
+            m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).native()));
+#endif
+
+        ASSERT(m_glDisplay);
     }
 
     GLContext* webkitContext = sharedDisplay.sharingGLContext();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to