Skip to content

Commit

Permalink
(#24566) [ffmpeg] Fix Android build by disabling dependencies
Browse files Browse the repository at this point in the history
* Disable libfdk_aac when building Android

Signed-off-by: Uilian Ries <[email protected]>

* Remove libvpx validate

Signed-off-by: Uilian Ries <[email protected]>

* Fix link

Signed-off-by: Uilian Ries <[email protected]>

* bump libvpx version

Signed-off-by: Uilian Ries <[email protected]>

---------

Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries authored Aug 19, 2024
1 parent ab3333f commit 9a4b5a0
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions recipes/ffmpeg/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ def config_options(self):
del self.options.with_mediacodec
if not self._version_supports_libsvtav1:
self.options.rm_safe("with_libsvtav1")
if self.settings.os == "Android":
del self.options.with_libfdk_aac

def configure(self):
if self.options.shared:
Expand All @@ -293,7 +295,7 @@ def requirements(self):
if self.options.with_openjpeg:
self.requires("openjpeg/2.5.2")
if self.options.with_openh264:
self.requires("openh264/2.3.1")
self.requires("openh264/2.4.1")
if self.options.with_vorbis:
self.requires("vorbis/1.3.7")
if self.options.with_opus:
Expand All @@ -303,14 +305,14 @@ def requirements(self):
if self.options.with_sdl:
self.requires("sdl/2.28.5")
if self.options.with_libx264:
self.requires("libx264/cci.20220602")
self.requires("libx264/cci.20240224")
if self.options.with_libx265:
self.requires("libx265/3.4")
if self.options.with_libvpx:
self.requires("libvpx/1.13.1")
self.requires("libvpx/1.14.1")
if self.options.with_libmp3lame:
self.requires("libmp3lame/3.100")
if self.options.with_libfdk_aac:
if self.options.get_safe("with_libfdk_aac"):
self.requires("libfdk_aac/2.0.3")
if self.options.with_libwebp:
self.requires("libwebp/1.3.2")
Expand All @@ -329,11 +331,11 @@ def requirements(self):
if self.options.get_safe("with_vulkan"):
self.requires("vulkan-loader/1.3.243.0")
if self.options.get_safe("with_libsvtav1"):
self.requires("libsvtav1/1.6.0")
self.requires("libsvtav1/2.1.0")
if self.options.with_libaom:
self.requires("libaom-av1/3.6.1")
if self.options.get_safe("with_libdav1d"):
self.requires("dav1d/1.2.1")
self.requires("dav1d/1.4.3")
if self.options.get_safe("with_libdrm"):
self.requires("libdrm/2.4.119")

Expand Down Expand Up @@ -505,7 +507,7 @@ def opt_append_disable_if_set(args, what, v):
opt_enable_disable("libx265", self.options.with_libx265),
opt_enable_disable("libvpx", self.options.with_libvpx),
opt_enable_disable("libmp3lame", self.options.with_libmp3lame),
opt_enable_disable("libfdk-aac", self.options.with_libfdk_aac),
opt_enable_disable("libfdk-aac", self.options.get_safe("with_libfdk_aac")),
opt_enable_disable("libwebp", self.options.with_libwebp),
opt_enable_disable("libaom", self.options.with_libaom),
opt_enable_disable("openssl", self.options.with_ssl == "openssl"),
Expand All @@ -532,7 +534,7 @@ def opt_append_disable_if_set(args, what, v):
"--disable-cuda", # FIXME: CUDA support
"--disable-cuvid", # FIXME: CUVID support
# Licenses
opt_enable_disable("nonfree", self.options.with_libfdk_aac or (self.options.with_ssl and (
opt_enable_disable("nonfree", self.options.get_safe("with_libfdk_aac") or (self.options.with_ssl and (
self.options.with_libx264 or self.options.with_libx265 or self.options.postproc))),
opt_enable_disable("gpl", self.options.with_libx264 or self.options.with_libx265 or self.options.postproc)
]
Expand Down Expand Up @@ -854,6 +856,8 @@ def _add_component(name, dependencies):
avdevice.frameworks.append("AVFoundation")
if self.options.get_safe("with_audiotoolbox"):
avdevice.frameworks.append("CoreAudio")
if self.settings.os == "Android" and not self.options.shared:
avdevice.system_libs.extend(["android", "camera2ndk", "mediandk"])

if self.options.avcodec:
if self.options.with_zlib:
Expand All @@ -878,7 +882,7 @@ def _add_component(name, dependencies):
avcodec.requires.append("libvpx::libvpx")
if self.options.with_libmp3lame:
avcodec.requires.append("libmp3lame::libmp3lame")
if self.options.with_libfdk_aac:
if self.options.get_safe("with_libfdk_aac"):
avcodec.requires.append("libfdk_aac::libfdk_aac")
if self.options.with_libwebp:
avcodec.requires.append("libwebp::libwebp")
Expand Down

0 comments on commit 9a4b5a0

Please sign in to comment.