[ffmpeg] Add libaom support. (#20867)

* [aom] Update to  3.2.0

* [ffmpeg] Add libaom support.

* fixup
This commit is contained in:
Matthew Oliver 2021-10-27 17:02:23 +11:00 committed by GitHub
parent 7178cb5eb4
commit c3db26403c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 77 additions and 12 deletions

View File

@ -9,10 +9,10 @@ index 18190f647..f4b1b359d 100644
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+
if(NOT EMSCRIPTEN)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE
@@ -289,6 +292,52 @@ if(BUILD_SHARED_LIBS)
# GENERATED source property global visibility.
if(POLICY CMP0118)
cmake_policy(SET CMP0118 NEW)
@@ -302,6 +305,52 @@ if(BUILD_SHARED_LIBS)
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_static)
endif()
@ -63,8 +63,8 @@ index 18190f647..f4b1b359d 100644
+ DESTINATION lib/cmake/aom)
+
# Setup dependencies.
setup_aom_dsp_targets()
setup_aom_mem_targets()
if(CONFIG_THREE_PASS)
setup_ivf_dec_targets()
diff --git a/cmake/aom-config.cmake.in b/cmake/aom-config.cmake.in
new file mode 100644
index 000000000..91cac3b5b

View File

@ -13,8 +13,8 @@ vcpkg_add_to_path(${PERL_PATH})
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL "https://aomedia.googlesource.com/aom"
REF 8f85bb1d686647d0f7dc1e7220f94f55193d2c89
TAG v3.1.2
REF 6bbe6ae701d65bdf36bb72053db9b71f9739a083
TAG v3.2.0
PATCHES
aom-rename-static.diff
# Can be dropped when https://bugs.chromium.org/p/aomedia/issues/detail?id=3029 is merged into the upstream
@ -35,6 +35,8 @@ vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
# Move cmake configs
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})

View File

@ -1,6 +1,6 @@
{
"name": "aom",
"version-semver": "3.1.2",
"version-semver": "3.2.0",
"description": "AV1 codec library",
"homepage": "https://aomedia.googlesource.com/aom",
"supports": "!uwp & !arm",

View File

@ -0,0 +1,26 @@
From 6ff9f56f2b0bface43c6b0810cfda458695600f3 Mon Sep 17 00:00:00 2001
From: Matt Oliver <protogonoi@gmail.com>
Date: Wed, 20 Oct 2021 06:55:48 +1100
Subject: [PATCH] libaom: Dont use aom_codec_av1_dx_algo.
This fixes linking errors where variables cannot be correctly linked in from an external shared library such as with msvc.
---
libavcodec/libaomdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 75ecc08970..d6b822fda2 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -223,7 +223,7 @@ static av_cold int aom_free(AVCodecContext *avctx)
static av_cold int av1_init(AVCodecContext *avctx)
{
- return aom_init(avctx, &aom_codec_av1_dx_algo);
+ return aom_init(avctx, aom_codec_av1_dx());
}
AVCodec ff_libaom_av1_decoder = {
--
2.33.1.windows.1

View File

@ -13,6 +13,12 @@ if("ffprobe" IN_LIST FEATURES)
endif()
if("aom" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'aom' does not support 'uwp | arm'")
endif()
endif()
if("ass" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'ass' does not support 'uwp | arm'")
@ -145,6 +151,7 @@ vcpkg_from_github(
0015-Fix-xml2-detection.patch
0016-configure-dnn-needs-avformat.patch # http://ffmpeg.org/pipermail/ffmpeg-devel/2021-May/279926.html
${PATCHES}
0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch
)
if (SOURCE_PATH MATCHES " ")
@ -341,6 +348,12 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(STATIC_LINKAGE ON)
endif()
if("aom" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libaom")
else()
set(OPTIONS "${OPTIONS} --disable-libaom")
endif()
if("ass" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libass")
else()

View File

@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4",
"port-version": 15,
"port-version": 16,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
@ -105,6 +105,14 @@
],
"platform": "!(arm & uwp)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"aom"
],
"platform": "!(uwp | arm)"
},
{
"name": "ffmpeg",
"default-features": false,
@ -232,6 +240,12 @@
}
]
},
"aom": {
"description": "AV1 video encoding/decoding via libaom support in ffmpeg",
"dependencies": [
"aom"
]
},
"ass": {
"description": "Libass subtitles rendering, needed for subtitles and ass filter support in ffmpeg",
"dependencies": [

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "04432e0fa953e42790ff74f6d927130d9a4e28a7",
"version-semver": "3.2.0",
"port-version": 0
},
{
"git-tree": "d55b62e714b84f2c3f2df02299f4a708a705c21f",
"version-semver": "3.1.2",

View File

@ -97,7 +97,7 @@
"port-version": 0
},
"aom": {
"baseline": "3.1.2",
"baseline": "3.2.0",
"port-version": 0
},
"approval-tests-cpp": {
@ -2126,7 +2126,7 @@
},
"ffmpeg": {
"baseline": "4.4",
"port-version": 15
"port-version": 16
},
"ffnvcodec": {
"baseline": "11.1.5.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5a144dc0552d005429d8d6641608744883dee2ff",
"version": "4.4",
"port-version": 16
},
{
"git-tree": "24cb6ddcd146248cb3758ec1aa4c038b28d4c0c5",
"version": "4.4",