Bug 225310

Summary: [Stable][WPE] 2.32 build Error with ENABLE_VIDEO=OFF/ENABLE_VIDEO_TRACK=OFF
Product: WebKit Reporter: Bastian Krause <bst>
Component: WPE WebKitAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, bugs-noreply, pnormand
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218042
https://bugs.webkit.org/show_bug.cgi?id=196811

Description Bastian Krause 2021-05-03 08:58:48 PDT
I'm building wpewebkit 2.32.0 via meta-webkit@4cedcb6 (top of main branch) with

  PACKAGECONFIG_remove = "video"

That means adding

  -DENABLE_VIDEO=OFF -DENABLE_VIDEO_TRACK=OFF

leads to these build failures:

In file included from [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:30,
                 from [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:30:
[...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/wpewebkit-2.32.0/Source/WebCore/platform/graphics/GraphicsContextGL.h:1310:39: error: 'MediaPlayer' has not been declared
 1310 |     virtual bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum format, GCGLenum type, bool premultiplyAlpha, bool flipY) = 0;
      |                                       ^~~~~~~~~~~
In file included from [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:30:
[...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h:469:10: error: 'bool WebCore::GraphicsContextGLOpenGL::copyTextureFromMedia(WebCore::MediaPlayer&, PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool, bool)' marked 'final', but is not virtual
  469 |     bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum format, GCGLenum type, bool premultiplyAlpha, bool flipY) final;
      |          ^~~~~~~~~~~~~~~~~~~~
Comment 1 Philippe Normand 2021-05-03 09:14:25 PDT
The ENABLE_VIDEO_TRACK CMake option was removed BTW. It is implied by VIDEO now.
Comment 2 Philippe Normand 2021-05-03 10:15:51 PDT
This code was heavily updated in ToT. I don't see how the VIDEO=OFF build would fail there. Someone will need to fix this specific issue in the stable branch.
Comment 3 Adrian Perez 2021-05-04 12:03:37 PDT
(In reply to Philippe Normand from comment #2)
> This code was heavily updated in ToT. I don't see how the VIDEO=OFF build
> would fail there. Someone will need to fix this specific issue in the stable
> branch.

Backporting the fix from bug #225316 to the 2.32 release branch fixes
the build with ENABLE_VIDEO=OFF.
Comment 4 Philippe Normand 2021-05-04 12:08:37 PDT
(In reply to Bastian Krause from comment #0)
> I'm building wpewebkit 2.32.0 via meta-webkit@4cedcb6 (top of main branch)
> with
> 
>   PACKAGECONFIG_remove = "video"
> 
> That means adding
> 
>   -DENABLE_VIDEO=OFF -DENABLE_VIDEO_TRACK=OFF
> 
> leads to these build failures:
> 
> In file included from
> [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> GraphicsContextGLOpenGL.h:30,
>                  from
> [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> GraphicsContextGLOpenGLCommon.cpp:30:
> [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> wpewebkit-2.32.0/Source/WebCore/platform/graphics/GraphicsContextGL.h:1310:
> 39: error: 'MediaPlayer' has not been declared
>  1310 |     virtual bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject
> texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum
> format, GCGLenum type, bool premultiplyAlpha, bool flipY) = 0;
>       |                                       ^~~~~~~~~~~
> In file included from
> [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> GraphicsContextGLOpenGLCommon.cpp:30:
> [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> GraphicsContextGLOpenGL.h:469:10: error: 'bool
> WebCore::GraphicsContextGLOpenGL::copyTextureFromMedia(WebCore::MediaPlayer&,
> PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool,
> bool)' marked 'final', but is not virtual
>   469 |     bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject
> texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum
> format, GCGLenum type, bool premultiplyAlpha, bool flipY) final;
>       |          ^~~~~~~~~~~~~~~~~~~~

But bug 225316 doesn't fix any of that ^^^
I'm confused now :)
Comment 5 Adrian Perez 2021-05-04 12:37:35 PDT
(In reply to Philippe Normand from comment #4)
> (In reply to Bastian Krause from comment #0)
> > I'm building wpewebkit 2.32.0 via meta-webkit@4cedcb6 (top of main branch)
> > with
> > 
> >   PACKAGECONFIG_remove = "video"
> > 
> > That means adding
> > 
> >   -DENABLE_VIDEO=OFF -DENABLE_VIDEO_TRACK=OFF
> > 
> > leads to these build failures:
> > 
> > In file included from
> > [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> > wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> > GraphicsContextGLOpenGL.h:30,
> >                  from
> > [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> > wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> > GraphicsContextGLOpenGLCommon.cpp:30:
> > [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> > wpewebkit-2.32.0/Source/WebCore/platform/graphics/GraphicsContextGL.h:1310:
> > 39: error: 'MediaPlayer' has not been declared
> >  1310 |     virtual bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject
> > texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum
> > format, GCGLenum type, bool premultiplyAlpha, bool flipY) = 0;
> >       |                                       ^~~~~~~~~~~
> > In file included from
> > [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> > wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> > GraphicsContextGLOpenGLCommon.cpp:30:
> > [...]/build/tmp/work/cortexa9t2hf-neon-oe-linux-gnueabi/wpewebkit/2.32.0-r0/
> > wpewebkit-2.32.0/Source/WebCore/platform/graphics/opengl/
> > GraphicsContextGLOpenGL.h:469:10: error: 'bool
> > WebCore::GraphicsContextGLOpenGL::copyTextureFromMedia(WebCore::MediaPlayer&,
> > PlatformGLObject, GCGLenum, GCGLint, GCGLenum, GCGLenum, GCGLenum, bool,
> > bool)' marked 'final', but is not virtual
> >   469 |     bool copyTextureFromMedia(MediaPlayer&, PlatformGLObject
> > texture, GCGLenum target, GCGLint level, GCGLenum internalFormat, GCGLenum
> > format, GCGLenum type, bool premultiplyAlpha, bool flipY) final;
> >       |          ^~~~~~~~~~~~~~~~~~~~
> 
> But bug 225316 doesn't fix any of that ^^^
> I'm confused now :)

The fix from bug #225316 was definitely needed for ENABLE_VIDEO=OFF,
maybe the reporter has other build options enabled that affect the
outcome. My test build was a clean done with:

  % CC=clang CXX=clang++ cmake -GNinja -DPORT=WPE \
      -DCMAKE_BUILD_TYPE=Release -DENABLE_VIDEO=OFF -S. \
      -Bbuild-wpe 
  % ninja -C build-wpe

In my case I am working on top of the release branch, which *also* has
a backport of the fix for bug #224198 — both are needed.
Comment 6 Adrian Perez 2021-05-04 12:39:54 PDT
(In reply to Adrian Perez from comment #5)

> The fix from bug #225316 was definitely needed for ENABLE_VIDEO=OFF,
>
> […]
> 
> In my case I am working on top of the release branch, which *also* has
> a backport of the fix for bug #224198 — both are needed.

I went ahead and merged the fix from bug #225316 as r276977 in the
release branch; this issue will be gone in 2.32.1 which will be released
later this week :)
Comment 7 Bastian Krause 2021-05-05 02:37:44 PDT
Awesome, thanks!