Bug 162606 - Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
Summary: Build fails for X11+EGL due to missing gst_gl_display_x11_new_with_display()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: All Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-27 05:08 PDT by Mario Sanchez Prada
Modified: 2016-09-27 06:22 PDT (History)
3 users (show)

See Also:


Attachments
Patch proposal (2.74 KB, patch)
2016-09-27 05:22 PDT, Mario Sanchez Prada
gustavo: review-
Details | Formatted Diff | Diff
Patch proposal (2.71 KB, patch)
2016-09-27 05:42 PDT, Mario Sanchez Prada
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2016-09-27 05:08:30 PDT
In MediaPlayerPrivateGStreamerBase::ensureGstGLContext() [1] a call to either gst_gl_display_x11_new_with_display() or gst_gl_display_egl_new_with_egl_display() is made depending on whether we're building for X11 or Wayland:
  [...]
  #if PLATFORM(X11)
          m_glDisplay = GST_GL_DISPLAY(gst_gl_display_x11_new_with_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
  #elif PLATFORM(WAYLAND)
          m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).native()));
  #endif
  [...]

However, this will fail when building for X11 with EGL (instead of GLX), since gst_gl_display_x11_new_with_display() is defined in /usr/include/gst/gl/x11/gstgldisplay_x11.h, which doesn't get included for EGL:

  [...]
  #include "GLContext.h"
  #if USE(GLX)
  #include "GLContextGLX.h"
  #include <gst/gl/x11/gstgldisplay_x11.h>
  #elif USE(EGL)
  #include "GLContextEGL.h"
  #include <gst/gl/egl/gstgldisplay_egl.h>
  #endif
  [...]

I believe a simple fix is to change the condition there to check for GLX or EGL, instead of X11 or WAYLAND.

[1] https://svn.webkit.org/repository/webkit/trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Comment 1 Mario Sanchez Prada 2016-09-27 05:22:06 PDT
Created attachment 289935 [details]
Patch proposal

This is the patch I'm using in my ARM + X11 environment.

Please review, thanks!
Comment 2 Gustavo Noronha (kov) 2016-09-27 05:35:16 PDT
Comment on attachment 289935 [details]
Patch proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=289935&action=review

> Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:260
> -#elif PLATFORM(WAYLAND)
> -        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).native()));
> +#elif USE(EGL)
> +        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));

Now we're missing the Wayland case? I guess you should start with PLATFORM(WAYLAND) and elif USE(GLX), elif USE(EGL)?
Comment 3 Mario Sanchez Prada 2016-09-27 05:42:42 PDT
Created attachment 289936 [details]
Patch proposal

(In reply to comment #2)
> Comment on attachment 289935 [details]
> Patch proposal
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=289935&action=review
> 
> > Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:260
> > -#elif PLATFORM(WAYLAND)
> > -        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayWayland>(sharedDisplay).native()));
> > +#elif USE(EGL)
> > +        m_glDisplay = GST_GL_DISPLAY(gst_gl_display_egl_new_with_egl_display(downcast<PlatformDisplayX11>(sharedDisplay).native()));
> 
> Now we're missing the Wayland case? I guess you should start with
> PLATFORM(WAYLAND) and elif USE(GLX), elif USE(EGL)?

I'm an idiot. Forgot about the downcasting, see the new patch now
Comment 4 Gustavo Noronha (kov) 2016-09-27 05:45:36 PDT
Comment on attachment 289936 [details]
Patch proposal

\o/
Comment 5 WebKit Commit Bot 2016-09-27 06:22:36 PDT
Comment on attachment 289936 [details]
Patch proposal

Clearing flags on attachment: 289936

Committed r206432: <http://trac.webkit.org/changeset/206432>
Comment 6 WebKit Commit Bot 2016-09-27 06:22:40 PDT
All reviewed patches have been landed.  Closing bug.