Compare commits
114 Commits
20220728-c
...
20230317
Author | SHA1 | Date | |
---|---|---|---|
a5da390ad5 | |||
b96c771c02 | |||
a3d59f258f | |||
201ede0b46 | |||
3b64cf60ef | |||
c59743aed1 | |||
ce4fef8bf5 | |||
4d4388bf62 | |||
5d7ddc217d | |||
1f8d08089d | |||
c78e519a2c | |||
e4ca060d44 | |||
aee86b9b20 | |||
d505e5d46c | |||
a1f41de31c | |||
0f144b81bb | |||
6f0a2d7ad6 | |||
46ef28c470 | |||
270c6fce9c | |||
1ac33dab8a | |||
a8752554ef | |||
da34fb4599 | |||
93976e2534 | |||
0c82344961 | |||
7dd8c987d0 | |||
d039a386b7 | |||
873680be3f | |||
09f9013713 | |||
56f8c998f6 | |||
349b58eecc | |||
b959d27624 | |||
10c88876bc | |||
c6b92d2f4e | |||
70bda63e9d | |||
1c68c6335a | |||
e72bad0214 | |||
1804b4eb32 | |||
1d19b49727 | |||
cbd4dc48f7 | |||
9295130beb | |||
5598d953c3 | |||
396376fd07 | |||
0fe5d095d9 | |||
c760b3218c | |||
c14c227819 | |||
82d140e7d3 | |||
38ecab2019 | |||
38d71e2878 | |||
5db2bab432 | |||
eb230b209c | |||
724ad0736a | |||
8249dc670a | |||
9b3025cd76 | |||
a477f8d2ed | |||
c447171e55 | |||
bf890278c0 | |||
6ebcc05909 | |||
d715a754f1 | |||
d0d8aae880 | |||
b0449badb8 | |||
2ebeb3e9a4 | |||
73b5fc5d98 | |||
cef469de9b | |||
7c904d18ac | |||
f1f3fb794c | |||
737f74db0c | |||
0e1b67f310 | |||
a15bfc298b | |||
ad9364ec80 | |||
c0567694ab | |||
7b6aab919f | |||
4298e9a94d | |||
e7df369012 | |||
6786d1fe98 | |||
8046a30542 | |||
702e11e7ad | |||
47aaf438f6 | |||
c5660a2fe3 | |||
105f314c8e | |||
949b952ef9 | |||
e517e524cc | |||
70c8c16e55 | |||
4f07e4e84e | |||
6929f42dd6 | |||
20bf845ddf | |||
66bd1fb20d | |||
5857c8f7b3 | |||
3662187a26 | |||
2538643d8f | |||
b02d60ae70 | |||
4b2f10e62c | |||
77fa7d0425 | |||
b4843c3c93 | |||
a34f18b836 | |||
037df191bb | |||
011e815b21 | |||
87ee3a9deb | |||
8b1aa0203b | |||
c2e11fe458 | |||
f149931d2f | |||
512fe8083a | |||
f43a71aaa0 | |||
1b3becb8d8 | |||
cea23c6d3f | |||
09afe7f781 | |||
6d8af9bd2a | |||
cf5c490ca7 | |||
740c0f1443 | |||
8e736fc176 | |||
0794129eb3 | |||
a510ee6450 | |||
cadbae2468 | |||
eed4f3bfd2 | |||
1173e86544 |
2
.github/actions/libfdkaac/action.yml
vendored
2
.github/actions/libfdkaac/action.yml
vendored
@ -35,7 +35,7 @@ runs:
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md build dist
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd fdkaac ; autoreconf -fiv ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared --disable-static ; make ; make install ; cd ../build ; tar czf ../dist/libfdkaac.tgz *'
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd fdkaac ; autoreconf -fiv ; CC=cl.exe CXX=cl.exe CXXFLAGS=${{ env.cFlags }} ./configure --prefix=$(realpath ../build) --disable-shared --disable-static ; make -j 2 ; make install ; cd ../build ; tar czf ../dist/libfdkaac.tgz *'
|
||||
- name: Publish artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
|
18
.github/actions/libmfx/action.yml
vendored
Normal file
18
.github/actions/libmfx/action.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: libmfx
|
||||
|
||||
inputs:
|
||||
refId:
|
||||
type: string
|
||||
required: true
|
||||
config:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Publish artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: libmfx-${{ runner.os }}-${{ inputs.config }}
|
||||
path: .github/actions/libmfx/libmfx.tgz
|
BIN
.github/actions/libmfx/libmfx.tgz
vendored
Normal file
BIN
.github/actions/libmfx/libmfx.tgz
vendored
Normal file
Binary file not shown.
16
.github/actions/libsvtav1/action.yml
vendored
16
.github/actions/libsvtav1/action.yml
vendored
@ -16,12 +16,16 @@ runs:
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
- name: Checkout SVT AV1
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: AOMediaCodec/SVT-AV1
|
||||
ref: ${{ inputs.refId }}
|
||||
path: svtav1
|
||||
git clone -b ${{ inputs.refId }} https://gitlab.com/AOMediaCodec/SVT-AV1 svtav1
|
||||
cd svtav1
|
||||
git apply --ignore-whitespace --verbose ..\.github\actions\libsvtav1\patches\A01-metadata-copy-segfault-fix.patch
|
||||
cd ..
|
||||
#- name: Checkout SVT AV1
|
||||
# uses: actions/checkout@v3
|
||||
# with:
|
||||
# repository: AOMediaCodec/SVT-AV1
|
||||
# ref: ${{ inputs.refId }}
|
||||
# path: svtav1
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
|
37
.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch
vendored
Normal file
37
.github/actions/libsvtav1/patches/A01-metadata-copy-segfault-fix.patch
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
From 213854249dc8d69653a9f3281cdd4c2063cd3779 Mon Sep 17 00:00:00 2001
|
||||
From: Christopher Degawa <christopher.degawa@intel.com>
|
||||
Date: Wed, 10 Aug 2022 13:53:17 -0500
|
||||
Subject: [PATCH] copy_input_buffer: only copy metadata if a frame was actaully
|
||||
sent
|
||||
|
||||
Fixes a segfault if EOS was send through the library without zeroing
|
||||
out the metadata array
|
||||
|
||||
Signed-off-by: Christopher Degawa <christopher.degawa@intel.com>
|
||||
---
|
||||
Source/Lib/Encoder/Globals/EbEncHandle.c | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Source/Lib/Encoder/Globals/EbEncHandle.c b/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||
index ba5e719a4..fc7a2b1f4 100644
|
||||
--- a/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||
+++ b/Source/Lib/Encoder/Globals/EbEncHandle.c
|
||||
@@ -4814,11 +4814,12 @@ static void copy_input_buffer(SequenceControlSet* scs, EbBufferHeaderType* dst,
|
||||
} else if (pass != ENCODE_FIRST_PASS || copy_frame) {
|
||||
// Bypass copy for the unecessary picture in IPPP pass
|
||||
// Copy the picture buffer
|
||||
- if (src->p_buffer != NULL)
|
||||
+ if (src->p_buffer != NULL) {
|
||||
copy_frame_buffer(scs, dst->p_buffer, dst_y8b->p_buffer, src->p_buffer, pass);
|
||||
- // Copy the metadata array
|
||||
- if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)
|
||||
- dst->metadata = NULL;
|
||||
+ // Copy the metadata array
|
||||
+ if (svt_aom_copy_metadata_buffer(dst, src->metadata) != EB_ErrorNone)
|
||||
+ dst->metadata = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
// Copy the private data list
|
||||
--
|
||||
GitLab
|
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@ -2,8 +2,8 @@ name: Build all
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 1 * * *"
|
||||
# schedule:
|
||||
# - cron: "0 1 * * *"
|
||||
|
||||
jobs:
|
||||
ffmpeg-static-debug:
|
||||
@ -12,7 +12,7 @@ jobs:
|
||||
system: windows-2022
|
||||
type: static
|
||||
config: debug
|
||||
ffmpegRef: release/5.0
|
||||
ffmpegRef: release/5.1
|
||||
|
||||
ffmpeg-static-release:
|
||||
uses: ./.github/workflows/ffmpeg.yml
|
||||
@ -20,4 +20,4 @@ jobs:
|
||||
system: windows-2022
|
||||
type: static
|
||||
config: release
|
||||
ffmpegRef: release/5.0
|
||||
ffmpegRef: release/5.1
|
||||
|
2
.github/workflows/ffmpeg-cartwheel.yml
vendored
2
.github/workflows/ffmpeg-cartwheel.yml
vendored
@ -212,7 +212,7 @@ jobs:
|
||||
md build dist
|
||||
rem D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git checkout b3f9843cffd4118e35bb000779444ca2f4196342 ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ inputs.config }}.tar.gz *'
|
||||
rem D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git checkout 2757a1d43ca83a3762b24a7ddd74b3291873f89c ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --pkg-config-flags="--static" --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-static-${{ inputs.config }}.tar.gz *'
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'git config --global user.email "daniel.stankewitz@gmail.com" ; git config --global user.name "Daniel Stankewitz" ; git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive cartwheel ; cd cartwheel ; git submodule update --init --recursive ; cd ffmpeg ; git am ../patches/*.patch ; git apply --ignore-whitespace --verbose ../../libfdkaac-dynlib-5.1.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../cartwheel/ffmpeg ; PKG_CONFIG_PATH=../../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../../build/include" --extra-ldflags="-LIBPATH:../../build/lib" --prefix=../../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
- name: Publish artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
186
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
186
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
@ -0,0 +1,186 @@
|
||||
name: 'Build FFmpeg (LGPL)'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
system:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'windows-2022'
|
||||
description: 'System'
|
||||
options:
|
||||
- windows-2022
|
||||
|
||||
type:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'shared'
|
||||
description: Type
|
||||
options:
|
||||
- static
|
||||
- shared
|
||||
|
||||
config:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'release'
|
||||
description: 'Configuration'
|
||||
options:
|
||||
- debug
|
||||
- release
|
||||
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
default: 'master'
|
||||
description: 'FFmpeg refId'
|
||||
|
||||
workflow_call:
|
||||
inputs:
|
||||
system:
|
||||
type: string
|
||||
required: true
|
||||
type:
|
||||
type: string
|
||||
required: true
|
||||
config:
|
||||
type: string
|
||||
required: true
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
env:
|
||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||
COMPONENTS: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libvpx --enable-libopus "
|
||||
#--enable-libvorbis
|
||||
NASM_EXECUTABLE: nasm
|
||||
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared --build-suffix=-voukoderpro' }}
|
||||
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||
|
||||
jobs:
|
||||
libvpl:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libvpl
|
||||
with:
|
||||
refId: master
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
#liboggvorbis:
|
||||
# runs-on: ${{ inputs.system }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: ./.github/actions/liboggvorbis
|
||||
# with:
|
||||
# libogg_refId: v1.3.5
|
||||
# libvorbis_refId: v1.3.7
|
||||
# config: ${{ inputs.config }}
|
||||
|
||||
libsvtav1:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libsvtav1
|
||||
with:
|
||||
refId: v1.4.1
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libsnappy:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libsnappy
|
||||
with:
|
||||
refId: 1.1.9
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libvpx:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libvpx
|
||||
with:
|
||||
refId: v1.13.0
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libmp3lame:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libmp3lame
|
||||
with:
|
||||
refId: tags/RELEASE__3_100
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libzimg:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libzimg
|
||||
with:
|
||||
refId: release-3.0.4
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libopus:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libopus
|
||||
with:
|
||||
refId: v1.3.1
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
ffmpeg:
|
||||
runs-on: ${{ inputs.system }}
|
||||
needs: [libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,libopus]
|
||||
#liboggvorbis
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||
path-type: inherit
|
||||
- name: Set up GIT
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||
git config --global user.name "Daniel Stankewitz"
|
||||
- name: Checkout patches
|
||||
uses: actions/checkout@v3.0.0
|
||||
- name: Checkout FFmpeg
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: FFmpeg/FFmpeg.git
|
||||
ref: ${{ inputs.ffmpegRef }}
|
||||
path: ffmpeg
|
||||
- name: Checkout NvEnc
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: FFmpeg/nv-codec-headers
|
||||
ref: master
|
||||
path: nvenc
|
||||
- name: Checkout AMF
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||
ref: master
|
||||
path: amf
|
||||
- name: Set up artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: build_artifacts
|
||||
- name: Build FFmpeg
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md build dist
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; rm -rf cmake pkgconfig *.la ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
- name: Publish FFmpeg artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
18
.github/workflows/ffmpeg.yml
vendored
18
.github/workflows/ffmpeg.yml
vendored
@ -1,4 +1,4 @@
|
||||
name: 'Build FFmpeg'
|
||||
name: 'Build FFmpeg (GPL)'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@ -23,7 +23,7 @@ on:
|
||||
config:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'debug'
|
||||
default: 'release'
|
||||
description: 'Configuration'
|
||||
options:
|
||||
- debug
|
||||
@ -32,7 +32,7 @@ on:
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
default: 'release/5.0'
|
||||
default: 'release/6.0'
|
||||
description: 'FFmpeg refId'
|
||||
|
||||
workflow_call:
|
||||
@ -52,7 +52,7 @@ on:
|
||||
|
||||
env:
|
||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||
COMPONENTS: "--enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvpx "
|
||||
COMPONENTS: "--enable-libvpl --enable-libsvtav1 --enable-libsnappy --enable-libmp3lame --enable-libzimg --enable-libvpx --enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265 "
|
||||
NASM_EXECUTABLE: nasm
|
||||
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||
@ -84,9 +84,9 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libsvtav1
|
||||
with:
|
||||
refId: v1.1.0
|
||||
refId: v1.4.1
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
|
||||
libsnappy:
|
||||
runs-on: ${{ inputs.system }}
|
||||
steps:
|
||||
@ -102,7 +102,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/libvpx
|
||||
with:
|
||||
refId: v1.12.0
|
||||
refId: v1.13.0
|
||||
config: ${{ inputs.config }}
|
||||
|
||||
libmp3lame:
|
||||
@ -180,7 +180,7 @@ jobs:
|
||||
|
||||
ffmpeg:
|
||||
runs-on: ${{ inputs.system }}
|
||||
needs: [libvpl,libopus,libsvtav1,libsnappy,libmp3lame,libzimg,liboggvorbis,libx264,libx265,libfdkaac,libvpx]
|
||||
needs: [libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,liboggvorbis,libopus,libfdkaac,libx264,libx265]
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
@ -222,7 +222,7 @@ jobs:
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md build dist
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace --verbose ../0003-dynamic-loading-of-shared-fdk-aac-library-5.0.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --pkg-config-flags="--static" --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --disable-devices --disable-demuxers --disable-decoders --disable-network --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace ../libfdkaac.patch ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
- name: Publish FFmpeg artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
111
.github/workflows/test.yml
vendored
Normal file
111
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
name: 'Test'
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
system:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'windows-2022'
|
||||
description: 'System'
|
||||
options:
|
||||
- windows-2022
|
||||
|
||||
type:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'static'
|
||||
description: Type
|
||||
options:
|
||||
- static
|
||||
- shared
|
||||
|
||||
config:
|
||||
type: choice
|
||||
required: true
|
||||
default: 'release'
|
||||
description: 'Configuration'
|
||||
options:
|
||||
- debug
|
||||
- release
|
||||
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
default: 'release/5.1'
|
||||
description: 'FFmpeg refId'
|
||||
|
||||
workflow_call:
|
||||
inputs:
|
||||
system:
|
||||
type: string
|
||||
required: true
|
||||
type:
|
||||
type: string
|
||||
required: true
|
||||
config:
|
||||
type: string
|
||||
required: true
|
||||
ffmpegRef:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
env:
|
||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||
COMPONENTS: " "
|
||||
NASM_EXECUTABLE: nasm
|
||||
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||
|
||||
jobs:
|
||||
ffmpeg:
|
||||
runs-on: ${{ inputs.system }}
|
||||
needs: []
|
||||
steps:
|
||||
- name: Set up MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
install: base-devel binutils mingw-w64-x86_64-cmake nasm
|
||||
path-type: inherit
|
||||
- name: Set up GIT
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.eol lf
|
||||
git config --global user.email "daniel.stankewitz@gmail.com"
|
||||
git config --global user.name "Daniel Stankewitz"
|
||||
- name: Checkout patches
|
||||
uses: actions/checkout@v3.0.0
|
||||
- name: Checkout FFmpeg
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: FFmpeg/FFmpeg.git
|
||||
ref: ${{ inputs.ffmpegRef }}
|
||||
path: ffmpeg
|
||||
- name: Checkout NvEnc
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: FFmpeg/nv-codec-headers
|
||||
ref: master
|
||||
path: nvenc
|
||||
- name: Checkout AMF
|
||||
uses: actions/checkout@v3.0.0
|
||||
with:
|
||||
repository: GPUOpen-LibrariesAndSDKs/AMF
|
||||
ref: master
|
||||
path: amf
|
||||
- name: Set up artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: build_artifacts
|
||||
- name: Build FFmpeg
|
||||
shell: cmd
|
||||
run: |
|
||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||
md build dist
|
||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; git apply --ignore-whitespace ../amd-av1-amf.patch ; git apply --ignore-whitespace ../nvidia-av1-nvenc.patch ; git apply --ignore-whitespace --verbose ../libfdkaac-dynlib-5.1.patch ; sed -i "s/#define X264_API_IMPORTS 1/\/\/#define X264_API_IMPORTS 1/g" libavcodec/libx264.c ; cd ../build ; for file in `ls ../build_artifacts/**/*.tgz`; do tar -xzf $file; done ; rm -f bin/*.dll ; cd ../nvenc ; make PREFIX=../build install ; cp -a ../amf/amf/public/include ../build/include/AMF ; cd ../ffmpeg ; PKG_CONFIG_PATH=../build/lib/pkgconfig ./configure --toolchain=msvc --extra-cflags="${{ env.cFlags }} -I../build/include" --extra-ldflags="-LIBPATH:../build/lib" --prefix=../build --extra-libs=Ole32.lib --extra-libs=Advapi32.lib --disable-doc ${{ env.variant }} --enable-runtime-cpudetect --enable-w32threads --enable-gpl ${{ env.COMPONENTS }} ; make -j 2 ; make install ; cd ../build/lib ; for file in *.a; do mv "$file" "`basename "$file" .a`.lib" ; done ; rm -rf fdk-aac.lib cmake pkgconfig *.la ../share ; cd .. ; tar czf ../dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz *'
|
||||
- name: Publish FFmpeg artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: FFmpeg ${{ inputs.system }} ${{ inputs.config }}${{ inputs.config }} package build
|
||||
path: dist/ffmpeg-win64-${{ inputs.type }}-${{ inputs.config }}.tar.gz
|
@ -1,248 +0,0 @@
|
||||
diff --git a/configure b/configure
|
||||
index 7a62f0c248..73078ffa60 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1783,7 +1783,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
- libfdk_aac
|
||||
libtls
|
||||
"
|
||||
|
||||
@@ -1880,6 +1879,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
openssl
|
||||
pocketsphinx
|
||||
vapoursynth
|
||||
+ libfdk_aac
|
||||
"
|
||||
|
||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||
@@ -6532,9 +6532,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||
enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
|
||||
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
||||
-enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
|
||||
- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
|
||||
- warn "using libfdk without pkg-config"; } }
|
||||
+enabled libfdk_aac && require_headers fdk-aac/aacenc_lib.h
|
||||
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
|
||||
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
|
||||
enabled fontconfig && enable libfontconfig
|
||||
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
||||
new file mode 100644
|
||||
index 0000000000..cd1e6e3340
|
||||
--- /dev/null
|
||||
+++ b/libavcodec/libfdk-aac_internal.h
|
||||
@@ -0,0 +1,84 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Gianluigi Tiesi
|
||||
+ *
|
||||
+ * This file is part of FFmpeg.
|
||||
+ *
|
||||
+ * FFmpeg is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * FFmpeg is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with FFmpeg; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
+ */
|
||||
+
|
||||
+#ifndef AVCODEC_LIBFDK_AAC_INTERNAL_H
|
||||
+#define AVCODEC_LIBFDK_AAC_INTERNAL_H
|
||||
+
|
||||
+#ifdef _WIN32
|
||||
+#include <windows.h>
|
||||
+#define LIBNAME "libfdk-aac-2.dll"
|
||||
+#define dlopen(fname, f) ((void *) LoadLibraryA(fname))
|
||||
+#define dlclose(handle) FreeLibrary((HMODULE) handle)
|
||||
+#define dlsym(handle, name) GetProcAddress((HMODULE) handle, name)
|
||||
+#else
|
||||
+#include <dlfcn.h>
|
||||
+#define LIBNAME "libfdk-aac.so.2"
|
||||
+#endif
|
||||
+
|
||||
+#define DLSYM(x) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ s->pfn.x = ( imp_##x ) dlsym(s->hLib, AV_STRINGIFY(x)); \
|
||||
+ if (!s->pfn.x ) \
|
||||
+ { \
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to find symbol " AV_STRINGIFY(x) " in dynamic " LIBNAME "\n"); \
|
||||
+ return -1; \
|
||||
+ } \
|
||||
+ } while (0)
|
||||
+
|
||||
+
|
||||
+#include <fdk-aac/aacenc_lib.h>
|
||||
+#include <fdk-aac/aacdecoder_lib.h>
|
||||
+
|
||||
+typedef AACENC_ERROR (*imp_aacEncOpen)(HANDLE_AACENCODER *phAacEncoder, const UINT encModules, const UINT maxChannels);
|
||||
+typedef AACENC_ERROR (*imp_aacEncClose)(HANDLE_AACENCODER *phAacEncoder);
|
||||
+typedef AACENC_ERROR (*imp_aacEncEncode)(const HANDLE_AACENCODER hAacEncoder, const AACENC_BufDesc *inBufDesc, const AACENC_BufDesc *outBufDesc, const AACENC_InArgs *inargs, AACENC_OutArgs *outargs);
|
||||
+typedef AACENC_ERROR (*imp_aacEncInfo)(const HANDLE_AACENCODER hAacEncoder, AACENC_InfoStruct *pInfo);
|
||||
+typedef AACENC_ERROR (*imp_aacEncoder_SetParam)(const HANDLE_AACENCODER hAacEncoder, const AACENC_PARAM param, const UINT value);
|
||||
+
|
||||
+typedef struct _aacEncLib {
|
||||
+ imp_aacEncOpen aacEncOpen;
|
||||
+ imp_aacEncClose aacEncClose;
|
||||
+ imp_aacEncEncode aacEncEncode;
|
||||
+ imp_aacEncInfo aacEncInfo;
|
||||
+ imp_aacEncoder_SetParam aacEncoder_SetParam;
|
||||
+} aacEncLib;
|
||||
+
|
||||
+typedef LINKSPEC_H HANDLE_AACDECODER (*imp_aacDecoder_Open)(TRANSPORT_TYPE transportFmt, UINT nrOfLayers);
|
||||
+typedef LINKSPEC_H void (*imp_aacDecoder_Close)(HANDLE_AACDECODER self);
|
||||
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_Fill)(HANDLE_AACDECODER self, UCHAR *pBuffer[], const UINT bufferSize[], UINT *bytesValid);
|
||||
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_DecodeFrame)(HANDLE_AACDECODER self, INT_PCM *pTimeData, const INT timeDataSize, const UINT flags);
|
||||
+typedef LINKSPEC_H CStreamInfo* (*imp_aacDecoder_GetStreamInfo)(HANDLE_AACDECODER self);
|
||||
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_ConfigRaw)(HANDLE_AACDECODER self, UCHAR *conf[], const UINT length[]);
|
||||
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_SetParam)(const HANDLE_AACDECODER self, const AACDEC_PARAM param, const INT value);
|
||||
+typedef LINKSPEC_H AAC_DECODER_ERROR (*imp_aacDecoder_AncDataInit)(HANDLE_AACDECODER self, UCHAR *buffer, int size);
|
||||
+
|
||||
+typedef struct _aacDecLib {
|
||||
+ imp_aacDecoder_Open aacDecoder_Open;
|
||||
+ imp_aacDecoder_Close aacDecoder_Close;
|
||||
+ imp_aacDecoder_Fill aacDecoder_Fill;
|
||||
+ imp_aacDecoder_DecodeFrame aacDecoder_DecodeFrame;
|
||||
+ imp_aacDecoder_ConfigRaw aacDecoder_ConfigRaw;
|
||||
+ imp_aacDecoder_GetStreamInfo aacDecoder_GetStreamInfo;
|
||||
+ imp_aacDecoder_SetParam aacDecoder_SetParam;
|
||||
+ imp_aacDecoder_AncDataInit aacDecoder_AncDataInit;
|
||||
+} aacDecLib;
|
||||
+
|
||||
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index ffa1fdcce3..b3ee1248ed 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "avcodec.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -47,6 +48,8 @@ enum ConcealMethod {
|
||||
typedef struct FDKAACDecContext {
|
||||
const AVClass *class;
|
||||
HANDLE_AACDECODER handle;
|
||||
+ void *hLib;
|
||||
+ aacDecLib pfn;
|
||||
uint8_t *decoder_buffer;
|
||||
int decoder_buffer_size;
|
||||
uint8_t *anc_buffer;
|
||||
@@ -101,7 +104,7 @@ static const AVClass fdk_aac_dec_class = {
|
||||
static int get_stream_info(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
- CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
|
||||
+ CStreamInfo *info = s->pfn.aacDecoder_GetStreamInfo(s->handle);
|
||||
int channel_counts[0x24] = { 0 };
|
||||
int i, ch_error = 0;
|
||||
uint64_t ch_layout = 0;
|
||||
@@ -216,8 +219,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacDecoder_Close(s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacDecoder_Close(s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
av_freep(&s->decoder_buffer);
|
||||
av_freep(&s->anc_buffer);
|
||||
|
||||
@@ -229,6 +234,27 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
AAC_DECODER_ERROR err;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacDecoder_Open);
|
||||
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
||||
+ DLSYM(aacDecoder_Close);
|
||||
+ DLSYM(aacDecoder_Fill);
|
||||
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
||||
+ DLSYM(aacDecoder_DecodeFrame);
|
||||
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
||||
+ DLSYM(aacDecoder_GetStreamInfo);
|
||||
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
||||
+ DLSYM(aacDecoder_ConfigRaw);
|
||||
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
||||
+ DLSYM(aacDecoder_SetParam);
|
||||
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
||||
+ DLSYM(aacDecoder_AncDataInit);
|
||||
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
||||
+
|
||||
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
||||
if (!s->handle) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
||||
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
||||
index 7ee2f13ac7..2a91d02c7f 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "audio_frame_queue.h"
|
||||
#include "encode.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
#include "profiles.h"
|
||||
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
@@ -47,6 +48,8 @@ typedef struct AACContext {
|
||||
int header_period;
|
||||
int vbr;
|
||||
|
||||
+ void *hLib;
|
||||
+ aacEncLib pfn;
|
||||
AudioFrameQueue afq;
|
||||
} AACContext;
|
||||
|
||||
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
AACContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacEncClose(&s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacEncClose(&s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
ff_af_queue_close(&s->afq);
|
||||
|
||||
return 0;
|
||||
@@ -128,6 +133,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
int aot = FF_PROFILE_AAC_LOW + 1;
|
||||
int sce = 0, cpe = 0;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacEncOpen);
|
||||
+#define aacEncOpen s->pfn.aacEncOpen
|
||||
+ DLSYM(aacEncClose);
|
||||
+ DLSYM(aacEncEncode);
|
||||
+#define aacEncEncode s->pfn.aacEncEncode
|
||||
+ DLSYM(aacEncInfo);
|
||||
+#define aacEncInfo s->pfn.aacEncInfo
|
||||
+ DLSYM(aacEncoder_SetParam);
|
||||
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
||||
+
|
||||
if ((err = aacEncOpen(&s->handle, 0, avctx->channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
20
hotfix.patch
20
hotfix.patch
@ -1,20 +0,0 @@
|
||||
diff --git a/ffmpeg b/ffmpeg
|
||||
index 3721aae..336fe22 160000
|
||||
--- a/ffmpeg
|
||||
+++ b/ffmpeg
|
||||
@@ -1 +1 @@
|
||||
-Subproject commit 3721aaeaaae9f817abb843117ae8dae1dc280a7f
|
||||
+Subproject commit 336fe225a6a0e12d2ba701c641df63d36151f6fb-dirty
|
||||
diff --git a/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch b/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
||||
index d1a787a..6a53eb0 100644
|
||||
--- a/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
||||
+++ b/patches/0075-qsv-use-a-new-method-to-create-mfx-session-when-usin.patch
|
||||
@@ -908,7 +908,7 @@ index 1e8ac56eed..500cf4c0bc 100644
|
||||
+ break;
|
||||
+ else if (sts != MFX_ERR_NONE) {
|
||||
+ impl_idx++;
|
||||
-+ continue;
|
||||
++ break;
|
||||
+ }
|
||||
+
|
||||
+ sts = MFXCreateSession(loader, impl_idx, &session);
|
@ -1,8 +1,8 @@
|
||||
diff --git a/configure b/configure
|
||||
index 77facac8c9..ab117fba2c 100755
|
||||
index b6616f00b6..d02f5099fe 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1785,7 +1785,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
@@ -1774,7 +1774,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||
|
||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||
decklink
|
||||
@ -10,7 +10,7 @@ index 77facac8c9..ab117fba2c 100755
|
||||
libtls
|
||||
"
|
||||
|
||||
@@ -1882,6 +1881,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
@@ -1873,6 +1872,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||
openssl
|
||||
pocketsphinx
|
||||
vapoursynth
|
||||
@ -18,7 +18,7 @@ index 77facac8c9..ab117fba2c 100755
|
||||
"
|
||||
|
||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
||||
@@ -6524,9 +6524,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||
@@ -6581,9 +6581,7 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
|
||||
enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
|
||||
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
||||
@ -29,138 +29,11 @@ index 77facac8c9..ab117fba2c 100755
|
||||
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
|
||||
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
|
||||
enabled fontconfig && enable libfontconfig
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index e9096a08e6..cc4d79c651 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "codec_internal.h"
|
||||
#include "internal.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -48,6 +49,8 @@ enum ConcealMethod {
|
||||
typedef struct FDKAACDecContext {
|
||||
const AVClass *class;
|
||||
HANDLE_AACDECODER handle;
|
||||
+ void *hLib;
|
||||
+ aacDecLib pfn;
|
||||
uint8_t *decoder_buffer;
|
||||
int decoder_buffer_size;
|
||||
uint8_t *anc_buffer;
|
||||
@@ -113,7 +116,7 @@ static const AVClass fdk_aac_dec_class = {
|
||||
static int get_stream_info(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
- CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
|
||||
+ CStreamInfo *info = s->pfn.aacDecoder_GetStreamInfo(s->handle);
|
||||
int channel_counts[0x24] = { 0 };
|
||||
int i, ch_error = 0;
|
||||
uint64_t ch_layout = 0;
|
||||
@@ -231,8 +234,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacDecoder_Close(s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacDecoder_Close(s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
av_freep(&s->decoder_buffer);
|
||||
av_freep(&s->anc_buffer);
|
||||
|
||||
@@ -244,6 +249,27 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
AAC_DECODER_ERROR err;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacDecoder_Open);
|
||||
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
||||
+ DLSYM(aacDecoder_Close);
|
||||
+ DLSYM(aacDecoder_Fill);
|
||||
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
||||
+ DLSYM(aacDecoder_DecodeFrame);
|
||||
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
||||
+ DLSYM(aacDecoder_GetStreamInfo);
|
||||
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
||||
+ DLSYM(aacDecoder_ConfigRaw);
|
||||
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
||||
+ DLSYM(aacDecoder_SetParam);
|
||||
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
||||
+ DLSYM(aacDecoder_AncDataInit);
|
||||
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
||||
+
|
||||
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
||||
if (!s->handle) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
||||
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
||||
index d004ae00c3..902dddb365 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "codec_internal.h"
|
||||
#include "encode.h"
|
||||
#include "profiles.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -47,6 +48,8 @@ typedef struct AACContext {
|
||||
int header_period;
|
||||
int vbr;
|
||||
|
||||
+ void *hLib;
|
||||
+ aacEncLib pfn;
|
||||
AudioFrameQueue afq;
|
||||
} AACContext;
|
||||
|
||||
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
AACContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacEncClose(&s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacEncClose(&s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
ff_af_queue_close(&s->afq);
|
||||
|
||||
return 0;
|
||||
@@ -128,6 +133,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
int aot = FF_PROFILE_AAC_LOW + 1;
|
||||
int sce = 0, cpe = 0;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacEncOpen);
|
||||
+#define aacEncOpen s->pfn.aacEncOpen
|
||||
+ DLSYM(aacEncClose);
|
||||
+ DLSYM(aacEncEncode);
|
||||
+#define aacEncEncode s->pfn.aacEncEncode
|
||||
+ DLSYM(aacEncInfo);
|
||||
+#define aacEncInfo s->pfn.aacEncInfo
|
||||
+ DLSYM(aacEncoder_SetParam);
|
||||
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
||||
+
|
||||
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
||||
diff --git a/libfdk-aac_internal.h b/libfdk-aac_internal.h
|
||||
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
||||
new file mode 100644
|
||||
index 0000000000..9bcfdb9aba
|
||||
--- /dev/null
|
||||
+++ b/libfdk-aac_internal.h
|
||||
+++ b/libavcodec/libfdk-aac_internal.h
|
||||
@@ -0,0 +1,84 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2018 Gianluigi Tiesi
|
||||
@ -247,3 +120,130 @@ index 0000000000..9bcfdb9aba
|
||||
+
|
||||
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
||||
\ No newline at end of file
|
||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
||||
index 8c1586e25e..25f68cdd10 100644
|
||||
--- a/libavcodec/libfdk-aacdec.c
|
||||
+++ b/libavcodec/libfdk-aacdec.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "avcodec.h"
|
||||
#include "codec_internal.h"
|
||||
#include "decode.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACDECODER_LIB_VL0
|
||||
#define FDKDEC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -48,6 +49,8 @@ enum ConcealMethod {
|
||||
typedef struct FDKAACDecContext {
|
||||
const AVClass *class;
|
||||
HANDLE_AACDECODER handle;
|
||||
+ void *hLib;
|
||||
+ aacDecLib pfn;
|
||||
uint8_t *decoder_buffer;
|
||||
int decoder_buffer_size;
|
||||
uint8_t *anc_buffer;
|
||||
@@ -113,7 +116,7 @@ static const AVClass fdk_aac_dec_class = {
|
||||
static int get_stream_info(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
- CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
|
||||
+ CStreamInfo *info = s->pfn.aacDecoder_GetStreamInfo(s->handle);
|
||||
int channel_counts[0x24] = { 0 };
|
||||
int i, ch_error = 0;
|
||||
uint64_t ch_layout = 0;
|
||||
@@ -231,8 +234,10 @@ static av_cold int fdk_aac_decode_close(AVCodecContext *avctx)
|
||||
{
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacDecoder_Close(s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacDecoder_Close(s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
av_freep(&s->decoder_buffer);
|
||||
av_freep(&s->anc_buffer);
|
||||
|
||||
@@ -244,6 +249,27 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
|
||||
FDKAACDecContext *s = avctx->priv_data;
|
||||
AAC_DECODER_ERROR err;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacDecoder_Open);
|
||||
+#define aacDecoder_Open s->pfn.aacDecoder_Open
|
||||
+ DLSYM(aacDecoder_Close);
|
||||
+ DLSYM(aacDecoder_Fill);
|
||||
+#define aacDecoder_Fill s->pfn.aacDecoder_Fill
|
||||
+ DLSYM(aacDecoder_DecodeFrame);
|
||||
+#define aacDecoder_DecodeFrame s->pfn.aacDecoder_DecodeFrame
|
||||
+ DLSYM(aacDecoder_GetStreamInfo);
|
||||
+#define aacDecoder_GetStreamInfo s->pfn.aacDecoder_GetStreamInfo
|
||||
+ DLSYM(aacDecoder_ConfigRaw);
|
||||
+#define aacDecoder_ConfigRaw s->pfn.aacDecoder_ConfigRaw
|
||||
+ DLSYM(aacDecoder_SetParam);
|
||||
+#define aacDecoder_SetParam s->pfn.aacDecoder_SetParam
|
||||
+ DLSYM(aacDecoder_AncDataInit);
|
||||
+#define aacDecoder_AncDataInit s->pfn.aacDecoder_AncDataInit
|
||||
+
|
||||
s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1);
|
||||
if (!s->handle) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n");
|
||||
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
|
||||
index 54549de473..9e93ce092c 100644
|
||||
--- a/libavcodec/libfdk-aacenc.c
|
||||
+++ b/libavcodec/libfdk-aacenc.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "codec_internal.h"
|
||||
#include "encode.h"
|
||||
#include "profiles.h"
|
||||
+#include "libfdk-aac_internal.h"
|
||||
|
||||
#ifdef AACENCODER_LIB_VL0
|
||||
#define FDKENC_VER_AT_LEAST(vl0, vl1) \
|
||||
@@ -46,6 +47,8 @@ typedef struct AACContext {
|
||||
int latm;
|
||||
int header_period;
|
||||
int vbr;
|
||||
+ void *hLib;
|
||||
+ aacEncLib pfn;
|
||||
|
||||
AudioFrameQueue afq;
|
||||
} AACContext;
|
||||
@@ -111,8 +114,10 @@ static int aac_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
AACContext *s = avctx->priv_data;
|
||||
|
||||
- if (s->handle)
|
||||
- aacEncClose(&s->handle);
|
||||
+ if (s->hLib && s->handle) {
|
||||
+ s->pfn.aacEncClose(&s->handle);
|
||||
+ dlclose(s->hLib);
|
||||
+ }
|
||||
ff_af_queue_close(&s->afq);
|
||||
|
||||
return 0;
|
||||
@@ -128,6 +133,21 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
||||
int aot = FF_PROFILE_AAC_LOW + 1;
|
||||
int sce = 0, cpe = 0;
|
||||
|
||||
+ if (!(s->hLib = dlopen(LIBNAME, RTLD_NOW))) {
|
||||
+ av_log(avctx, AV_LOG_ERROR, "Unable to load " LIBNAME "\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ DLSYM(aacEncOpen);
|
||||
+#define aacEncOpen s->pfn.aacEncOpen
|
||||
+ DLSYM(aacEncClose);
|
||||
+ DLSYM(aacEncEncode);
|
||||
+#define aacEncEncode s->pfn.aacEncEncode
|
||||
+ DLSYM(aacEncInfo);
|
||||
+#define aacEncInfo s->pfn.aacEncInfo
|
||||
+ DLSYM(aacEncoder_SetParam);
|
||||
+#define aacEncoder_SetParam s->pfn.aacEncoder_SetParam
|
||||
+
|
||||
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unable to open the encoder: %s\n",
|
||||
aac_get_error(err));
|
Reference in New Issue
Block a user