Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Thaodan:mozilla
MozillaFirefox
0019-Bug-559213-Support-system-av1.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0019-Bug-559213-Support-system-av1.patch of Package MozillaFirefox
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann <whissi@gentoo.org> Date: Mon, 6 Apr 2020 19:36:02 +0200 Subject: [PATCH] Bug 559213 - Support system av1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow building against system-wide av1. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1559213 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com> --- config/external/gkcodecs/gkcodecs.symbols | 2 ++ config/external/gkcodecs/moz.build | 2 ++ config/external/moz.build | 5 +++-- config/system-headers.mozbuild | 5 +++++ dom/media/platforms/moz.build | 5 +++++ media/ffvpx/libavcodec/moz.build | 14 ++++++++++---- toolkit/moz.configure | 20 ++++++++++++++++++-- 7 files changed, 45 insertions(+), 8 deletions(-) diff --git a/config/external/gkcodecs/gkcodecs.symbols b/config/external/gkcodecs/gkcodecs.symbols index 4a37db41dcf056967de1b9ea6b00d48916920669..46b5171705f92c78c15bd3f04fcbed434b9978a6 100644 --- a/config/external/gkcodecs/gkcodecs.symbols +++ b/config/external/gkcodecs/gkcodecs.symbols @@ -1,4 +1,5 @@ # libaom symbols +#ifndef MOZ_SYSTEM_AV1 aom_codec_av1_cx aom_codec_av1_dx aom_codec_build_config @@ -25,6 +26,7 @@ aom_img_free aom_img_plane_height aom_img_plane_width aom_img_wrap +#endif #if defined(X86_WIN64) aom_winx64_fstcw #endif diff --git a/config/external/gkcodecs/moz.build b/config/external/gkcodecs/moz.build index 040f6809deca60533771b1397dbaaccfadfbc9a9..39712e816120ee63a2e4d13e0c31630f9da38e98 100644 --- a/config/external/gkcodecs/moz.build +++ b/config/external/gkcodecs/moz.build @@ -16,3 +16,5 @@ SHARED_LIBRARY_NAME = "gkcodecs" SYMBOLS_FILE = "gkcodecs.symbols" if CONFIG["MOZ_SYSTEM_LIBVPX"]: DEFINES["MOZ_SYSTEM_LIBVPX"] = True +if CONFIG["MOZ_SYSTEM_AV1"]: + DEFINES["MOZ_SYSTEM_AV1"] = True diff --git a/config/external/moz.build b/config/external/moz.build index a24b470396cf89296e6c2a030aafefe51294d17e..547f5f5c9e041783874e7b8d2dd6b0ca71111770 100644 --- a/config/external/moz.build +++ b/config/external/moz.build @@ -40,8 +40,9 @@ if not CONFIG["MOZ_SYSTEM_LIBVPX"]: external_dirs += ["media/libvpx"] if CONFIG["MOZ_AV1"]: - external_dirs += ["media/libaom"] - external_dirs += ["media/libdav1d"] + if not CONFIG["MOZ_SYSTEM_AV1"]: + external_dirs += ["media/libaom"] + external_dirs += ["media/libdav1d"] if not CONFIG["MOZ_SYSTEM_PNG"]: external_dirs += ["media/libpng"] diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild index b897132920326f51322112e565a9a618435ea96b..51864315e6bf69a5c5ef8ea9500d00d844798b09 100644 --- a/config/system-headers.mozbuild +++ b/config/system-headers.mozbuild @@ -1303,6 +1303,11 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]: "proxy.h", ] +if CONFIG["MOZ_SYSTEM_AV1"]: + system_headers += [ + "dav1d/dav1d.h", + ] + if CONFIG["MOZ_SYSTEM_ICU"]: system_headers += [ "unicode/calendar.h", diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build index 61536cc6e225a84e907ad47f0fc5115cbb262ef9..42af2ca72ea40d046af41611db91d997d68efb3c 100644 --- a/dom/media/platforms/moz.build +++ b/dom/media/platforms/moz.build @@ -71,6 +71,11 @@ if CONFIG["MOZ_AV1"]: "agnostic/AOMDecoder.cpp", "agnostic/DAV1DDecoder.cpp", ] + if CONFIG["MOZ_SYSTEM_AV1"]: + CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"] + OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"] + CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"] + OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"] if CONFIG["MOZ_OMX"]: EXPORTS += [ diff --git a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build index 6f09049a6068daafb1564bfa3d81a06e0754170d..07c0bab34951c160cdb7f51680fe549b58a1de2b 100644 --- a/media/ffvpx/libavcodec/moz.build +++ b/media/ffvpx/libavcodec/moz.build @@ -119,10 +119,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: 'vp9recon.c', 'vpx_rac.c', ] - USE_LIBS += [ - 'dav1d', - 'media_libdav1d_asm', - ] + if CONFIG["MOZ_SYSTEM_AV1"]: + CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS'] + OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS'] + CFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"] + OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"] + else: + USE_LIBS += [ + 'dav1d', + 'media_libdav1d_asm', + ] if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": LOCAL_INCLUDES += ['/media/mozva'] SOURCES += [ diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 011eee093dcf77c3c8ad3cd20188b61457d8dc09..0be5c4092038cce12d78eeec774526d6a7a350c5 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -863,14 +863,29 @@ def av1(value): if value: return True +option("--with-system-av1", help="Use system av1 (located with pkg-config)") -@depends(target, when=av1 & compile_environment) +system_libaom_info = pkg_check_modules('MOZ_SYSTEM_LIBAOM', 'aom >= 1.0.0', + when='--with-system-av1') + +system_libdav1d_info = pkg_check_modules('MOZ_SYSTEM_LIBDAV1D', 'dav1d >= 0.1.1', + when='--with-system-av1') + +@depends(system_libaom_info, system_libdav1d_info) +def system_av1(system_libaom_info, system_libdav1d_info): + has_av1_libs = False + if system_libaom_info and system_libdav1d_info: + has_av1_libs = True + return has_av1_libs + + +@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) def dav1d_asm(target): if target.cpu in ("aarch64", "x86", "x86_64"): return True -@depends(target, when=av1 & compile_environment) +@depends(target, when=av1 & depends(system_av1)(lambda v: not v) & compile_environment) def dav1d_nasm(target): if target.cpu in ("x86", "x86_64"): return namespace(version="2.14", what="AV1") @@ -880,6 +895,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm) set_define("MOZ_DAV1D_ASM", dav1d_asm) set_config("MOZ_AV1", av1) set_define("MOZ_AV1", av1) +set_config("MOZ_SYSTEM_AV1", depends_if(system_av1)(lambda _: True)) # JXL Image Codec Support # ==============================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor