Compare commits
137 Commits
Author | SHA1 | Date | |
---|---|---|---|
569a789432 | |||
b36890f293 | |||
7662805806 | |||
b445e67952 | |||
293a602e6f | |||
c98389f743 | |||
890a31b49b | |||
5762e8c223 | |||
c66e8654d3 | |||
dd58003f0c | |||
22009f8153 | |||
8bfb822127 | |||
80a178d335 | |||
90118b85ec | |||
ce5b0ae521 | |||
7d68bf05f2 | |||
741f9f09a7 | |||
9827d2a397 | |||
4e4ed6268c | |||
3f358307d4 | |||
49dc603a7e | |||
9c9d5bc9af | |||
833f59c056 | |||
c6105dcbcd | |||
34ba575e93 | |||
e8bc575304 | |||
778632362f | |||
d580fdacf9 | |||
fb68a11db0 | |||
5c662bbf4c | |||
27fe5ace74 | |||
5805c7d571 | |||
4684230ae5 | |||
e7592e5bbd | |||
99683552f4 | |||
946b581996 | |||
717556bb3c | |||
9e98f7ba0b | |||
fd2416deca | |||
70b0e356b5 | |||
ec49fc8f45 | |||
5b8b185a19 | |||
e276db8230 | |||
40c5f1b9f4 | |||
0793868642 | |||
9508b682df | |||
4304c8bd21 | |||
d642a7af5e | |||
15d39a0ae4 | |||
41d4be87e1 | |||
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 |
2
.github/actions/libfdkaac/action.yml
vendored
2
.github/actions/libfdkaac/action.yml
vendored
@ -35,7 +35,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
md build dist
|
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
|
- name: Publish artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
44
.github/actions/libkvazaar/action.yml
vendored
Normal file
44
.github/actions/libkvazaar/action.yml
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
name: libkvazaar
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
refId:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
config:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Set up GIT
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
git config --global core.eol lf
|
||||||
|
- name: Checkout KVAZAAR
|
||||||
|
uses: actions/checkout@v3.0.0
|
||||||
|
with:
|
||||||
|
repository: ultravideo/kvazaar
|
||||||
|
ref: ${{ inputs.refId }}
|
||||||
|
path: kvazaar
|
||||||
|
- name: Set up MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: base-devel binutils autotools automake mingw-w64-x86_64-cmake nasm
|
||||||
|
path-type: inherit
|
||||||
|
- name: Build KVAZAAR
|
||||||
|
shell: cmd
|
||||||
|
env:
|
||||||
|
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
||||||
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
run: |
|
||||||
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd kvazaar ; ./autogen.sh ; CC=cl ./configure --prefix=$(realpath ../build) CPPFLAGS=-DKVZ_STATIC_LIB || true ; make -j ; make install-lib-static ; cd ../build ; tar czf ../dist/libkvazaar.tgz *'
|
||||||
|
- name: Publish artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: libopus-${{ runner.os }}-${{ inputs.config }}
|
||||||
|
path: dist/libkvazaar.tgz
|
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.
2
.github/actions/libvpx/action.yml
vendored
2
.github/actions/libvpx/action.yml
vendored
@ -30,7 +30,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
md build build\include build\lib build\lib\pkgconfig dist
|
md build build\include build\lib build\lib\pkgconfig dist
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vpx ; ./configure --prefix=../build --target=x86_64-win64-vs17 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests --disable-postproc ; make -j ; make install ; mv ../build/lib/x64/vpxmd.lib ../build/lib/vpx.lib ; rm -rf ../build/lib/x64 ; cd ../build ; tar czf ../dist/libvpx.tgz *'
|
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd vpx ; ./configure --prefix=../build --target=x86_64-win64-vs17 --enable-vp9-highbitdepth --disable-shared --disable-examples --disable-tools --disable-docs --disable-libyuv --disable-unit_tests ; make -j ; make install ; mv ../build/lib/x64/vpxmd.lib ../build/lib/vpx.lib ; rm -rf ../build/lib/x64 ; cd ../build ; tar czf ../dist/libvpx.tgz *'
|
||||||
- name: Publish artifact
|
- name: Publish artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
205
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
205
.github/workflows/ffmpeg-lgpl.yaml
vendored
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
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: 'release/6.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: "--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: v2023.3.1
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
#libkvazaar:
|
||||||
|
# runs-on: ${{ inputs.system }}
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/checkout@v3
|
||||||
|
# - uses: ./.github/actions/libkvazaar
|
||||||
|
# with:
|
||||||
|
# refId: v2.3.0
|
||||||
|
# config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
ffmpeg:
|
||||||
|
runs-on: ${{ inputs.system }}
|
||||||
|
needs: [libvpl,libsvtav1,libsnappy,libvpx,libmp3lame,libzimg,libopus]
|
||||||
|
#libkvazaar,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: Create PFX certificate
|
||||||
|
id: create-pfx
|
||||||
|
shell: pwsh
|
||||||
|
env:
|
||||||
|
PFX_CONTENT: ${{ secrets.CODESIGN_PFX }}
|
||||||
|
run: |
|
||||||
|
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx";
|
||||||
|
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT);
|
||||||
|
Set-Content $pfxPath -Value $encodedBytes -AsByteStream;
|
||||||
|
Write-Output "::set-output name=PFX_PATH::$pfxPath";
|
||||||
|
- 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 --enable-cuda ${{ 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
|
28
.github/workflows/ffmpeg.yml
vendored
28
.github/workflows/ffmpeg.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: 'Build FFmpeg'
|
name: 'Build FFmpeg (GPL)'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -23,7 +23,7 @@ on:
|
|||||||
config:
|
config:
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: 'debug'
|
default: 'release'
|
||||||
description: 'Configuration'
|
description: 'Configuration'
|
||||||
options:
|
options:
|
||||||
- debug
|
- debug
|
||||||
@ -32,7 +32,7 @@ on:
|
|||||||
ffmpegRef:
|
ffmpegRef:
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
default: 'release/5.1'
|
default: 'release/6.1'
|
||||||
description: 'FFmpeg refId'
|
description: 'FFmpeg refId'
|
||||||
|
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@ -52,7 +52,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
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-libvorbis --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfdk-aac"
|
||||||
NASM_EXECUTABLE: nasm
|
NASM_EXECUTABLE: nasm
|
||||||
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
||||||
@ -65,7 +65,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libvpl
|
- uses: ./.github/actions/libvpl
|
||||||
with:
|
with:
|
||||||
refId: master
|
refId: v2023.4.0
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
liboggvorbis:
|
liboggvorbis:
|
||||||
@ -84,16 +84,16 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libsvtav1
|
- uses: ./.github/actions/libsvtav1
|
||||||
with:
|
with:
|
||||||
refId: v1.2.0
|
refId: v1.7.0
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
libsnappy:
|
libsnappy:
|
||||||
runs-on: ${{ inputs.system }}
|
runs-on: ${{ inputs.system }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libsnappy
|
- uses: ./.github/actions/libsnappy
|
||||||
with:
|
with:
|
||||||
refId: 1.1.9
|
refId: 1.1.10
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
libvpx:
|
libvpx:
|
||||||
@ -102,7 +102,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libvpx
|
- uses: ./.github/actions/libvpx
|
||||||
with:
|
with:
|
||||||
refId: v1.12.0
|
refId: v1.13.1
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
libmp3lame:
|
libmp3lame:
|
||||||
@ -120,7 +120,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libzimg
|
- uses: ./.github/actions/libzimg
|
||||||
with:
|
with:
|
||||||
refId: release-3.0.4
|
refId: release-3.0.5
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
libopus:
|
libopus:
|
||||||
@ -129,7 +129,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libopus
|
- uses: ./.github/actions/libopus
|
||||||
with:
|
with:
|
||||||
refId: v1.3.1
|
refId: v1.4
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
libfdkaac:
|
libfdkaac:
|
||||||
@ -180,7 +180,7 @@ jobs:
|
|||||||
|
|
||||||
ffmpeg:
|
ffmpeg:
|
||||||
runs-on: ${{ inputs.system }}
|
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:
|
steps:
|
||||||
- name: Set up MSYS2
|
- name: Set up MSYS2
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
@ -221,8 +221,8 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat"
|
||||||
md build dist 0001-dynamic-loading-of-shared-fdk-aac-library-cw-5.0.patch
|
md build dist
|
||||||
D:\a\_temp\setup-msys2\msys2.cmd -c 'cd ffmpeg ; 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 *'
|
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
|
- name: Publish FFmpeg artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
35
.github/workflows/test.yml
vendored
35
.github/workflows/test.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: 'SVT-AV1'
|
name: 'Test'
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -14,7 +14,7 @@ on:
|
|||||||
type:
|
type:
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: 'static'
|
default: 'shared'
|
||||||
description: Type
|
description: Type
|
||||||
options:
|
options:
|
||||||
- static
|
- static
|
||||||
@ -23,7 +23,7 @@ on:
|
|||||||
config:
|
config:
|
||||||
type: choice
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: 'debug'
|
default: 'release'
|
||||||
description: 'Configuration'
|
description: 'Configuration'
|
||||||
options:
|
options:
|
||||||
- debug
|
- debug
|
||||||
@ -32,23 +32,40 @@ on:
|
|||||||
ffmpegRef:
|
ffmpegRef:
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
default: 'release/5.1'
|
default: 'release/6.1'
|
||||||
description: 'FFmpeg refId'
|
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:
|
env:
|
||||||
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\
|
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-libopus --enable-libkvazaar"
|
||||||
|
#--enable-libvorbis
|
||||||
NASM_EXECUTABLE: nasm
|
NASM_EXECUTABLE: nasm
|
||||||
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
cFlags: ${{ inputs.config == 'release' && '-MD' || '-MDd' }}
|
||||||
variant: ${{ inputs.type == 'static' && ' --pkg-config-flags="--static" --disable-shared --enable-static' || ' --disable-static --enable-shared' }}
|
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' }}
|
msbuildConfig: ${{ inputs.config == 'release' && 'Release' || 'Debug' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
libsvtav1:
|
libkvazaar:
|
||||||
runs-on: ${{ inputs.system }}
|
runs-on: ${{ inputs.system }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/libsvtav1
|
- uses: ./.github/actions/libkvazaar
|
||||||
with:
|
with:
|
||||||
refId: v1.2.0
|
refId: v2.3.0
|
||||||
config: ${{ inputs.config }}
|
config: ${{ inputs.config }}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
diff --git a/configure b/configure
|
diff --git a/configure b/configure
|
||||||
index 77facac8c9..ab117fba2c 100755
|
index b6616f00b6..d02f5099fe 100755
|
||||||
--- a/configure
|
--- a/configure
|
||||||
+++ b/configure
|
+++ b/configure
|
||||||
@@ -1785,7 +1785,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
@@ -1774,7 +1774,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
|
||||||
|
|
||||||
EXTERNAL_LIBRARY_NONFREE_LIST="
|
EXTERNAL_LIBRARY_NONFREE_LIST="
|
||||||
decklink
|
decklink
|
||||||
@ -10,7 +10,7 @@ index 77facac8c9..ab117fba2c 100755
|
|||||||
libtls
|
libtls
|
||||||
"
|
"
|
||||||
|
|
||||||
@@ -1882,6 +1881,7 @@ EXTERNAL_LIBRARY_LIST="
|
@@ -1873,6 +1872,7 @@ EXTERNAL_LIBRARY_LIST="
|
||||||
openssl
|
openssl
|
||||||
pocketsphinx
|
pocketsphinx
|
||||||
vapoursynth
|
vapoursynth
|
||||||
@ -18,7 +18,7 @@ index 77facac8c9..ab117fba2c 100755
|
|||||||
"
|
"
|
||||||
|
|
||||||
HWACCEL_AUTODETECT_LIBRARY_LIST="
|
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 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 libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
|
||||||
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
|
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"
|
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 libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
|
||||||
enabled fontconfig && enable libfontconfig
|
enabled fontconfig && enable libfontconfig
|
||||||
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
|
diff --git a/libavcodec/libfdk-aac_internal.h b/libavcodec/libfdk-aac_internal.h
|
||||||
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
|
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000..9bcfdb9aba
|
index 0000000000..9bcfdb9aba
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libfdk-aac_internal.h
|
+++ b/libavcodec/libfdk-aac_internal.h
|
||||||
@@ -0,0 +1,84 @@
|
@@ -0,0 +1,84 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (c) 2018 Gianluigi Tiesi
|
+ * Copyright (c) 2018 Gianluigi Tiesi
|
||||||
@ -247,3 +120,130 @@ index 0000000000..9bcfdb9aba
|
|||||||
+
|
+
|
||||||
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
+#endif /* AVCODEC_LIBFDK_AAC_INTERNAL_H */
|
||||||
\ No newline at end of file
|
\ 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