These changes were added in 
<https://github.com/WebKit/webkit/commit/c7d6af038dcbfac95d0af4f43fbb945d73f6b1bb>

they don't compile, as they use EGL unprotected, but even when some of them were protected by USE(EGL) there were
 errors when trying to play videos in the MiniBrowser. So I added protection to all the addition bits in
 the commit that were not initially protected. 


diff --git Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
index ad632205..29a9eace 100644
--- Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
+++ Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
@@ -23,7 +23,7 @@
 #if USE(GSTREAMER)
 #include <gst/gst.h>
 
-#if USE(GSTREAMER_GL)
+#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
 #include <gst/gl/egl/gsteglimage.h>
 #endif
 
@@ -508,6 +508,7 @@ template<> void derefGPtr<GstGLContext>(GstGLContext* ptr)
         gst_object_unref(GST_OBJECT(ptr));
 }
 
+#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
 template <> GRefPtr<GstEGLImage> adoptGRef(GstEGLImage* ptr)
 {
     return GRefPtr<GstEGLImage>(ptr, GRefPtrAdopt);
@@ -525,6 +526,7 @@ template <> void derefGPtr<GstEGLImage>(GstEGLImage* ptr)
     if (ptr)
         gst_egl_image_unref(ptr);
 }
+#endif //USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
 
 #endif // USE(GSTREAMER_GL)
 
diff --git Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
index d940f8ca..bda2f024 100644
--- Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
+++ Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
@@ -30,9 +30,13 @@ typedef struct _WebKitWebSrc WebKitWebSrc;
 #if USE(GSTREAMER_GL)
 typedef struct _GstGLDisplay GstGLDisplay;
 typedef struct _GstGLContext GstGLContext;
+
+#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
 typedef struct _GstEGLImage GstEGLImage;
 #endif
 
+#endif
+
 namespace WTF {
 
 template<> GRefPtr<GstPlugin> adoptGRef(GstPlugin* ptr);
@@ -133,9 +137,12 @@ template<> GRefPtr<GstGLContext> adoptGRef(GstGLContext* ptr);
 template<> GstGLContext* refGPtr<GstGLContext>(GstGLContext* ptr);
 template<> void derefGPtr<GstGLContext>(GstGLContext* ptr);
 
+#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
 template<> GRefPtr<GstEGLImage> adoptGRef(GstEGLImage* ptr);
 template<> GstEGLImage* refGPtr<GstEGLImage>(GstEGLImage* ptr);
 template<> void derefGPtr<GstEGLImage>(GstEGLImage* ptr);
+#endif // USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
+
 #endif
 
 } // namespace WTF
