Skip to content

Commit

Permalink
Fix libplacebo/ffmpeg builds on NDKv26
Browse files Browse the repository at this point in the history
This fixes a confusing error related to Vulkan headers when compiling
libplacebo/ffmpeg - for example in mpv - specifically on Android with
NDK v26. The reason for this is some misplaced Vulkan headers in this
NDK, see android/ndk#1974. But in reality we
should just turn off Vulkan decode support entirely for these libraries
as Google recommends not to use these extensions.
  • Loading branch information
redstrate committed Oct 19, 2024
1 parent 6e606cf commit 7d24aa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/ffmpeg/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ def __init__(self, **kwargs):
if self.subinfo.options.isActive("libs/x265"):
self.subinfo.options.configure.args += ["--enable-libx265"]

if CraftCore.compiler.isAndroid:
# Work around https://github.com/android/ndk/issues/1974 in ndk26.
# But also Vulkan video decode isn't well supported on Android anyway.
self.subinfo.options.configure.args += ["--disable-vulkan"]

if CraftCore.compiler.isMacOS:
self.subinfo.options.configure.args += ["--enable-rpath", "--install-name-dir=@rpath"]
elif not CraftCore.compiler.isAndroid:
Expand Down
5 changes: 5 additions & 0 deletions libs/libplacebo/libplacebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ def __init__(self, **kwargs):
super().__init__(**kwargs)
self.subinfo.options.fetch.checkoutSubmodules = True
self.subinfo.options.configure.args += ["-Ddemos=False"]

if CraftCore.compiler.isAndroid:
# Work around https://github.com/android/ndk/issues/1974 in ndk26.
# But also Vulkan video decode isn't well supported on Android anyway.
self.subinfo.options.configure.args += ["-Dvulkan=disabled"]

0 comments on commit 7d24aa5

Please sign in to comment.