Bug 1559213 Allow to use system av1 libs instead of bundled r=glandium,media-playback-reviewers,aosmond,stransky,alwu
Differential Revision: https://phabricator.services.mozilla.com/D34921
This commit is contained in:
2
config/external/moz.build
vendored
2
config/external/moz.build
vendored
@@ -39,7 +39,7 @@ if CONFIG["MOZ_VORBIS"]:
|
|||||||
if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
|
if not CONFIG["MOZ_SYSTEM_LIBVPX"]:
|
||||||
external_dirs += ["media/libvpx"]
|
external_dirs += ["media/libvpx"]
|
||||||
|
|
||||||
if CONFIG["MOZ_AV1"]:
|
if not CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
external_dirs += ["media/libaom"]
|
external_dirs += ["media/libaom"]
|
||||||
external_dirs += ["media/libdav1d"]
|
external_dirs += ["media/libdav1d"]
|
||||||
|
|
||||||
|
|||||||
@@ -1307,6 +1307,11 @@ if CONFIG["MOZ_ENABLE_LIBPROXY"]:
|
|||||||
"proxy.h",
|
"proxy.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
system_headers += [
|
||||||
|
"dav1d/dav1d.h",
|
||||||
|
]
|
||||||
|
|
||||||
if CONFIG["MOZ_SYSTEM_ICU"]:
|
if CONFIG["MOZ_SYSTEM_ICU"]:
|
||||||
system_headers += [
|
system_headers += [
|
||||||
"unicode/calendar.h",
|
"unicode/calendar.h",
|
||||||
|
|||||||
@@ -98,6 +98,9 @@ LOCAL_INCLUDES += [
|
|||||||
"/xpcom/base",
|
"/xpcom/base",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
# Add libFuzzer configuration directives
|
# Add libFuzzer configuration directives
|
||||||
|
|||||||
@@ -402,6 +402,9 @@ if CONFIG["ENABLE_TESTS"]:
|
|||||||
"test/rdd_process_xpcom",
|
"test/rdd_process_xpcom",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
|
LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ UNIFIED_SOURCES += [
|
|||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
# Suppress warnings for now.
|
# Suppress warnings for now.
|
||||||
CXXFLAGS += [
|
CXXFLAGS += [
|
||||||
"-Wno-sign-compare",
|
"-Wno-sign-compare",
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ UNIFIED_SOURCES += [
|
|||||||
"SamplesWaitingForKey.cpp",
|
"SamplesWaitingForKey.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ UNIFIED_SOURCES += [
|
|||||||
"GMPVideoEncoder.cpp",
|
"GMPVideoEncoder.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
# GMPVideoEncodedFrameImpl.h needs IPC
|
# GMPVideoEncodedFrameImpl.h needs IPC
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ if CONFIG['CC_TYPE'] == 'gcc':
|
|||||||
'-Wno-attributes',
|
'-Wno-attributes',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ if CONFIG['MOZ_ENABLE_VAAPI'] or CONFIG['MOZ_ENABLE_V4L2']:
|
|||||||
USE_LIBS += ['mozva']
|
USE_LIBS += ['mozva']
|
||||||
DEFINES['MOZ_USE_HWDECODE'] = 1
|
DEFINES['MOZ_USE_HWDECODE'] = 1
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
|
|||||||
USE_LIBS += ["mozva"]
|
USE_LIBS += ["mozva"]
|
||||||
DEFINES["MOZ_USE_HWDECODE"] = 1
|
DEFINES["MOZ_USE_HWDECODE"] = 1
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
|
|||||||
USE_LIBS += ["mozva"]
|
USE_LIBS += ["mozva"]
|
||||||
DEFINES["MOZ_USE_HWDECODE"] = 1
|
DEFINES["MOZ_USE_HWDECODE"] = 1
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ if CONFIG["MOZ_ENABLE_VAAPI"] or CONFIG["MOZ_ENABLE_V4L2"]:
|
|||||||
USE_LIBS += ["mozva"]
|
USE_LIBS += ["mozva"]
|
||||||
DEFINES["MOZ_USE_HWDECODE"] = 1
|
DEFINES["MOZ_USE_HWDECODE"] = 1
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ if CONFIG['CC_TYPE'] == 'clang':
|
|||||||
'-Wno-unknown-attributes',
|
'-Wno-unknown-attributes',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ if CONFIG['CC_TYPE'] == 'clang':
|
|||||||
'-Wno-unknown-attributes',
|
'-Wno-unknown-attributes',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ if CONFIG['CC_TYPE'] == 'gcc':
|
|||||||
'-Wno-attributes',
|
'-Wno-attributes',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
FINAL_LIBRARY = 'xul'
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ LOCAL_INCLUDES += [
|
|||||||
"/media/libyuv/libyuv/include",
|
"/media/libyuv/libyuv/include",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
|
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
|
||||||
LOCAL_INCLUDES += [
|
LOCAL_INCLUDES += [
|
||||||
"/gfx/thebes",
|
"/gfx/thebes",
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ if CONFIG["MOZ_AV1"]:
|
|||||||
"agnostic/AOMDecoder.cpp",
|
"agnostic/AOMDecoder.cpp",
|
||||||
"agnostic/DAV1DDecoder.cpp",
|
"agnostic/DAV1DDecoder.cpp",
|
||||||
]
|
]
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBDAV1D_CFLAGS"]
|
||||||
|
|
||||||
if CONFIG["MOZ_OMX"]:
|
if CONFIG["MOZ_OMX"]:
|
||||||
EXPORTS += [
|
EXPORTS += [
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ IPDL_SOURCES += [
|
|||||||
"PMediaSystemResourceManager.ipdl",
|
"PMediaSystemResourceManager.ipdl",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ if CONFIG["INTEL_ARCHITECTURE"]:
|
|||||||
CONFIG["SSE4_2_FLAGS"] + CONFIG["FMA_FLAGS"]
|
CONFIG["SSE4_2_FLAGS"] + CONFIG["FMA_FLAGS"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
include("/ipc/chromium/chromium-config.mozbuild")
|
include("/ipc/chromium/chromium-config.mozbuild")
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ UNIFIED_SOURCES += [
|
|||||||
|
|
||||||
CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"]
|
CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
FINAL_LIBRARY = "xul"
|
FINAL_LIBRARY = "xul"
|
||||||
|
|
||||||
# Add libFuzzer configuration directives
|
# Add libFuzzer configuration directives
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ if CONFIG["MOZ_AV1"]:
|
|||||||
"nsAVIFDecoder.cpp",
|
"nsAVIFDecoder.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
if CONFIG["MOZ_JXL"]:
|
if CONFIG["MOZ_JXL"]:
|
||||||
UNIFIED_SOURCES += [
|
UNIFIED_SOURCES += [
|
||||||
"nsJXLDecoder.cpp",
|
"nsJXLDecoder.cpp",
|
||||||
|
|||||||
@@ -139,5 +139,8 @@ LOCAL_INCLUDES += [
|
|||||||
|
|
||||||
LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
|
LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
CXXFLAGS += CONFIG["MOZ_SYSTEM_LIBAOM_CFLAGS"]
|
||||||
|
|
||||||
# Add libFuzzer configuration directives
|
# Add libFuzzer configuration directives
|
||||||
include("/tools/fuzzing/libfuzzer-config.mozbuild")
|
include("/tools/fuzzing/libfuzzer-config.mozbuild")
|
||||||
|
|||||||
@@ -119,10 +119,16 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']:
|
|||||||
'vp9recon.c',
|
'vp9recon.c',
|
||||||
'vpx_rac.c',
|
'vpx_rac.c',
|
||||||
]
|
]
|
||||||
USE_LIBS += [
|
|
||||||
'dav1d',
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
'media_libdav1d_asm',
|
CFLAGS += CONFIG['MOZ_SYSTEM_LIBDAV1D_CFLAGS']
|
||||||
]
|
OS_LIBS += CONFIG['MOZ_SYSTEM_LIBDAV1D_LIBS']
|
||||||
|
else:
|
||||||
|
USE_LIBS += [
|
||||||
|
'dav1d',
|
||||||
|
'media_libdav1d_asm',
|
||||||
|
]
|
||||||
|
|
||||||
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
||||||
LOCAL_INCLUDES += ['/media/mozva']
|
LOCAL_INCLUDES += ['/media/mozva']
|
||||||
SOURCES += [
|
SOURCES += [
|
||||||
|
|||||||
@@ -304,6 +304,10 @@ if CONFIG["MOZ_SYSTEM_LIBEVENT"]:
|
|||||||
if CONFIG["MOZ_SYSTEM_LIBVPX"]:
|
if CONFIG["MOZ_SYSTEM_LIBVPX"]:
|
||||||
OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"]
|
OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"]
|
||||||
|
|
||||||
|
if CONFIG["MOZ_SYSTEM_AV1"]:
|
||||||
|
OS_LIBS += CONFIG["MOZ_SYSTEM_LIBAOM_LIBS"]
|
||||||
|
OS_LIBS += CONFIG["MOZ_SYSTEM_LIBDAV1D_LIBS"]
|
||||||
|
|
||||||
if not CONFIG["MOZ_TREE_PIXMAN"]:
|
if not CONFIG["MOZ_TREE_PIXMAN"]:
|
||||||
OS_LIBS += CONFIG["MOZ_PIXMAN_LIBS"]
|
OS_LIBS += CONFIG["MOZ_PIXMAN_LIBS"]
|
||||||
|
|
||||||
|
|||||||
@@ -847,15 +847,21 @@ def av1(value):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@depends(target, when=av1 & compile_environment)
|
option("--with-system-av1", help="Use system av1 (located with pkg-config)")
|
||||||
def dav1d_asm(target):
|
|
||||||
if target.cpu in ("arm", "aarch64", "x86", "x86_64"):
|
pkg_check_modules("MOZ_SYSTEM_LIBAOM", "aom >= 3.0.0", when="--with-system-av1")
|
||||||
|
pkg_check_modules("MOZ_SYSTEM_LIBDAV1D", "dav1d >= 1.2.1", when="--with-system-av1")
|
||||||
|
|
||||||
|
|
||||||
|
@depends(target, "--with-system-av1", when=av1 & compile_environment)
|
||||||
|
def dav1d_asm(target, system_av1):
|
||||||
|
if not system_av1 and target.cpu in ("arm", "aarch64", "x86", "x86_64"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@depends(target, when=av1 & compile_environment)
|
@depends(target, "--with-system-av1", when=av1 & compile_environment)
|
||||||
def dav1d_nasm(target):
|
def dav1d_nasm(target, system_av1):
|
||||||
if target.cpu in ("x86", "x86_64"):
|
if not system_av1 and target.cpu in ("x86", "x86_64"):
|
||||||
return namespace(version="2.14", what="AV1")
|
return namespace(version="2.14", what="AV1")
|
||||||
|
|
||||||
|
|
||||||
@@ -863,6 +869,7 @@ set_config("MOZ_DAV1D_ASM", dav1d_asm)
|
|||||||
set_define("MOZ_DAV1D_ASM", dav1d_asm)
|
set_define("MOZ_DAV1D_ASM", dav1d_asm)
|
||||||
set_config("MOZ_AV1", av1)
|
set_config("MOZ_AV1", av1)
|
||||||
set_define("MOZ_AV1", av1)
|
set_define("MOZ_AV1", av1)
|
||||||
|
set_config("MOZ_SYSTEM_AV1", True, when="--with-system-av1")
|
||||||
|
|
||||||
# JXL Image Codec Support
|
# JXL Image Codec Support
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user