mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
428 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f74f82796 | ||
|
|
876b576679 | ||
|
|
c927e4785b | ||
|
|
97672828e8 | ||
|
|
b96978494b | ||
|
|
2f105cbe15 | ||
|
|
2539a07b7d | ||
|
|
73f903f402 | ||
|
|
94c48a4c2d | ||
|
|
eb8d938c94 | ||
|
|
92b8316182 | ||
|
|
610cb2626b | ||
|
|
2033f813da | ||
|
|
a6fbd0fe69 | ||
|
|
abadb7f80f | ||
|
|
1c6be3f400 | ||
|
|
52111be20a | ||
|
|
eae29bb1f2 | ||
|
|
9191e8ce91 | ||
|
|
2b4c7d12b6 | ||
|
|
7dd1f7321a | ||
|
|
088630a999 | ||
|
|
d2a5cdcca7 | ||
|
|
4b50d016b5 | ||
|
|
7a073e0e8d | ||
|
|
b56958abe4 | ||
|
|
57d042ca4a | ||
|
|
3895f3c826 | ||
|
|
75aed7c44f | ||
|
|
041c0ce86c | ||
|
|
90aabdf499 | ||
|
|
40f7ec3ca1 | ||
|
|
1e32fcaebe | ||
|
|
9f23755a62 | ||
|
|
dad03478fd | ||
|
|
484b75f755 | ||
|
|
7138faa5cd | ||
|
|
fef1706fc8 | ||
|
|
1929b20a6c | ||
|
|
3991ff5d3a | ||
|
|
e4b1c89719 | ||
|
|
3d51eec89c | ||
|
|
f9016f3ea7 | ||
|
|
3dce969a5e | ||
|
|
542d257b8f | ||
|
|
2eb7c47572 | ||
|
|
32621a9369 | ||
|
|
7676a74f73 | ||
|
|
1fae35231b | ||
|
|
cd4daa115f | ||
|
|
ad0190d6ed | ||
|
|
296dcccd81 | ||
|
|
7ba7e04a13 | ||
|
|
3109c5ef67 | ||
|
|
d5776e8946 | ||
|
|
c59ea602c5 | ||
|
|
16bebbea50 | ||
|
|
0e21b6da3d | ||
|
|
b3403c40e1 | ||
|
|
863e8bb290 | ||
|
|
1a16a527b3 | ||
|
|
c72329d990 | ||
|
|
dffeb2b5dd | ||
|
|
fef06a1544 | ||
|
|
7d9ad6daab | ||
|
|
822b166753 | ||
|
|
8fad768d39 | ||
|
|
d46b8390f1 | ||
|
|
4262715590 | ||
|
|
9818446c7d | ||
|
|
22682e4150 | ||
|
|
1d63779b7d | ||
|
|
c82f800794 | ||
|
|
d96dea49bf | ||
|
|
c574c3e08c | ||
|
|
e7e6f765b5 | ||
|
|
240586875c | ||
|
|
d6c5903569 | ||
|
|
55da5cc397 | ||
|
|
943359e328 | ||
|
|
92c54cc1f8 | ||
|
|
6ec0b44487 | ||
|
|
85d2ca626f | ||
|
|
68865a2bca | ||
|
|
8362e6f435 | ||
|
|
3804a58729 | ||
|
|
fbb67a6ee9 | ||
|
|
19d8b59ca7 | ||
|
|
7ca726492f | ||
|
|
96a43ca254 | ||
|
|
bf34eb32ed | ||
|
|
433612cde0 | ||
|
|
807db91140 | ||
|
|
7791809224 | ||
|
|
9b3d31cd47 | ||
|
|
65a3a97ab2 | ||
|
|
e3593574b0 | ||
|
|
f81d391546 | ||
|
|
bd3b00793a | ||
|
|
757a72fb57 | ||
|
|
fbbec480af | ||
|
|
ba3b43c66c | ||
|
|
e040b83b2c | ||
|
|
76f4a5b2fe | ||
|
|
4f4b9956b3 | ||
|
|
ba37a0f3a9 | ||
|
|
d4acb95d7c | ||
|
|
2887baefb8 | ||
|
|
9678bf1e2f | ||
|
|
e2fc68ff2d | ||
|
|
4a7b641bc3 | ||
|
|
719b83bf42 | ||
|
|
f201a2e5dd | ||
|
|
fd6f47f5ca | ||
|
|
8524fbbaf9 | ||
|
|
a371c5b7d0 | ||
|
|
ef7ce4dfc8 | ||
|
|
189f6fa2a3 | ||
|
|
472f4922bd | ||
|
|
8ba2f342df | ||
|
|
5d6b9d25bd | ||
|
|
1231499aaa | ||
|
|
9c4788432d | ||
|
|
4ded2caa0b | ||
|
|
494afb9d43 | ||
|
|
c994e4828d | ||
|
|
e50f12a925 | ||
|
|
df75d70df4 | ||
|
|
c5aa04d4eb | ||
|
|
81ae1ce362 | ||
|
|
e1921e660d | ||
|
|
32aa24f6fd | ||
|
|
7fbc63b8e8 | ||
|
|
443adcdd5b | ||
|
|
05b064d513 | ||
|
|
b327033333 | ||
|
|
36c9b68b6c | ||
|
|
7d8d16091e | ||
|
|
c1c6bde429 | ||
|
|
8f0901e7a5 | ||
|
|
6edba3820b | ||
|
|
db1e1bcc1f | ||
|
|
51aeaeb508 | ||
|
|
dcd0a1f002 | ||
|
|
819b61937f | ||
|
|
9da7628083 | ||
|
|
c5f47a8db3 | ||
|
|
c2786b91ce | ||
|
|
4290c16997 | ||
|
|
475e90b654 | ||
|
|
ebb291e06d | ||
|
|
a2c9069dda | ||
|
|
48cfe9ca73 | ||
|
|
b53e9856b8 | ||
|
|
20420da326 | ||
|
|
9162f176a2 | ||
|
|
3c140c2ef4 | ||
|
|
511d37e7c3 | ||
|
|
10a5ea2a29 | ||
|
|
c049f6814b | ||
|
|
0716abdbf8 | ||
|
|
989f2bbbb0 | ||
|
|
45c564749c | ||
|
|
a62737b244 | ||
|
|
1fa3111e67 | ||
|
|
0e78f3f3bc | ||
|
|
6bf07086a0 | ||
|
|
b3f8f4e8ec | ||
|
|
65ee7e82aa | ||
|
|
c78f3b4e24 | ||
|
|
51aa7c8ecf | ||
|
|
64ab92ced6 | ||
|
|
8f9f351940 | ||
|
|
a9a1af7307 | ||
|
|
5057dfedba | ||
|
|
ecabadbf95 | ||
|
|
97630039d8 | ||
|
|
e7f1178469 | ||
|
|
87245ef978 | ||
|
|
455aa28724 | ||
|
|
92f70228c9 | ||
|
|
5fa862b346 | ||
|
|
d5c6c318ba | ||
|
|
02133a0290 | ||
|
|
92b6c1c08d | ||
|
|
08649b7aa8 | ||
|
|
9e19ef0d03 | ||
|
|
33af3392aa | ||
|
|
e5a5cf0ef0 | ||
|
|
c1ca3888ec | ||
|
|
1b76bf59a1 | ||
|
|
699c6bf13d | ||
|
|
d9dbf2c5e9 | ||
|
|
c22f794a20 | ||
|
|
972135e184 | ||
|
|
96fad124ac | ||
|
|
ce7c466041 | ||
|
|
db0c7ca907 | ||
|
|
9f62ecdb33 | ||
|
|
f91f257a7d | ||
|
|
28a197b8cd | ||
|
|
9d2d8c0713 | ||
|
|
b431f1dc0d | ||
|
|
67eb2975f6 | ||
|
|
4192de7dac | ||
|
|
82cecc89e2 | ||
|
|
113e264617 | ||
|
|
a705a69022 | ||
|
|
d757360f4e | ||
|
|
cc978daeef | ||
|
|
d38ad1df94 | ||
|
|
1fd7bcf9a9 | ||
|
|
06abb70624 | ||
|
|
78e20868df | ||
|
|
e52766d047 | ||
|
|
224460e62d | ||
|
|
3c408de5c9 | ||
|
|
ea803ff2d4 | ||
|
|
14a0786982 | ||
|
|
1dbccb5e3d | ||
|
|
adca796d94 | ||
|
|
732aa96656 | ||
|
|
6beaec8ba1 | ||
|
|
2ae78f6e2f | ||
|
|
a889acb332 | ||
|
|
81236209db | ||
|
|
52266d7ac0 | ||
|
|
ab4592b8e9 | ||
|
|
7cda571d72 | ||
|
|
d0ce4c52b0 | ||
|
|
64ed6f5572 | ||
|
|
987bebffc7 | ||
|
|
e9c3807509 | ||
|
|
db642b05c0 | ||
|
|
7da904aa00 | ||
|
|
8c09daa22d | ||
|
|
7ebc04bc34 | ||
|
|
9254403a51 | ||
|
|
b4250965e6 | ||
|
|
3fbe704e21 | ||
|
|
4bfbc355a2 | ||
|
|
4d22102fd1 | ||
|
|
129efbda40 | ||
|
|
828fb8972c | ||
|
|
29b97209fe | ||
|
|
9c71bec4a0 | ||
|
|
1bc24c8d7c | ||
|
|
76ae5f3b12 | ||
|
|
7a6c0c6b4b | ||
|
|
db42792abf | ||
|
|
131f16b731 | ||
|
|
16e47f1d6b | ||
|
|
79e1fd1ea4 | ||
|
|
0c3cc59228 | ||
|
|
15db9e1778 | ||
|
|
19cf29e5cf | ||
|
|
d51d51b3cc | ||
|
|
c40e132284 | ||
|
|
f8f54bd892 | ||
|
|
5302cdcf2b | ||
|
|
8fe9282bd9 | ||
|
|
07ed213b1f | ||
|
|
8a1b8d2091 | ||
|
|
034ef5692c | ||
|
|
b9b9405c35 | ||
|
|
ca8d4f9ff0 | ||
|
|
0dc39a66d7 | ||
|
|
55e73bb4b9 | ||
|
|
6f9164b986 | ||
|
|
8d27c32418 | ||
|
|
a17a7ad1ec | ||
|
|
585868f930 | ||
|
|
795d0a6682 | ||
|
|
3c0b7f7724 | ||
|
|
ff23f87010 | ||
|
|
989fca99c6 | ||
|
|
b44e10df3c | ||
|
|
c9e9f92c93 | ||
|
|
bb1a366989 | ||
|
|
1458511756 | ||
|
|
3ebfc81727 | ||
|
|
8d0d59175d | ||
|
|
a46b3f2ed9 | ||
|
|
cb224789e2 | ||
|
|
cd4d829f9f | ||
|
|
faa25f2a96 | ||
|
|
36e8f49b63 | ||
|
|
e2a4657777 | ||
|
|
261b3f7e5c | ||
|
|
d6ba2aa76a | ||
|
|
fb135a87ab | ||
|
|
286fabaddc | ||
|
|
a79ad44370 | ||
|
|
2046a9b414 | ||
|
|
c77d8b3709 | ||
|
|
7b428bb6b0 | ||
|
|
6986030cd9 | ||
|
|
cc9b9a1935 | ||
|
|
2b7eeba55c | ||
|
|
c87dd99824 | ||
|
|
fbd837eadb | ||
|
|
7c9c8e197c | ||
|
|
0366929231 | ||
|
|
10d5261153 | ||
|
|
3278856764 | ||
|
|
ff5a9e0ea1 | ||
|
|
59b0c09443 | ||
|
|
ae772e6a74 | ||
|
|
0a58783a86 | ||
|
|
6f6de13fd4 | ||
|
|
89dcb78efa | ||
|
|
703c02c32c | ||
|
|
adcfca4db3 | ||
|
|
c359223fd4 | ||
|
|
c4c7d26bb3 | ||
|
|
c06bc16b22 | ||
|
|
f7bc05c735 | ||
|
|
ff02d41992 | ||
|
|
ec180e2771 | ||
|
|
dffa9e0b8c | ||
|
|
497e06bcd9 | ||
|
|
4c67c165fa | ||
|
|
2c175c0c7e | ||
|
|
6babbc1ff9 | ||
|
|
8af9aace3c | ||
|
|
601b75b611 | ||
|
|
350037fc75 | ||
|
|
f6bcfc3abd | ||
|
|
a480c972f7 | ||
|
|
581ded2c93 | ||
|
|
06176e291a | ||
|
|
14ee1b40d0 | ||
|
|
9acb98a2c8 | ||
|
|
daf50df337 | ||
|
|
c4d136383c | ||
|
|
5b5016bfd4 | ||
|
|
02352ab231 | ||
|
|
a4909d3575 | ||
|
|
fbb50e2895 | ||
|
|
0e4bf501f1 | ||
|
|
89b97456b7 | ||
|
|
fc4112c459 | ||
|
|
b6923f49b1 | ||
|
|
b476ed9186 | ||
|
|
b6ba3f9059 | ||
|
|
4d921cc9f9 | ||
|
|
e5ac7d66ba | ||
|
|
d8173873c1 | ||
|
|
36c27188a4 | ||
|
|
0cf4cb6e4f | ||
|
|
29420c25e4 | ||
|
|
161cead2e4 | ||
|
|
03242a2953 | ||
|
|
9613b43d50 | ||
|
|
8a8e6c5d20 | ||
|
|
5d64a2b889 | ||
|
|
85b41e23f0 | ||
|
|
9d1c60239e | ||
|
|
de433cb896 | ||
|
|
683c8d0cc3 | ||
|
|
bca20c9e27 | ||
|
|
1de3e0986e | ||
|
|
8b2fa73b45 | ||
|
|
1b953c1dc7 | ||
|
|
c33960b411 | ||
|
|
8d5728097b | ||
|
|
9706045656 | ||
|
|
3a953eb5df | ||
|
|
35971b29bc | ||
|
|
76cbc64f99 | ||
|
|
8f8c85273c | ||
|
|
25b953b7ec | ||
|
|
c40f205bd3 | ||
|
|
be1b698af1 | ||
|
|
c9ec71eeba | ||
|
|
4df27e6efb | ||
|
|
02f3279dec | ||
|
|
21900555dc | ||
|
|
5a4e21287a | ||
|
|
3e8e5216eb | ||
|
|
c679de8e39 | ||
|
|
a979d2283f | ||
|
|
3254714b70 | ||
|
|
65374f50cf | ||
|
|
1a62cd064c | ||
|
|
40bd19ccbb | ||
|
|
642adffeb8 | ||
|
|
5b942f0508 | ||
|
|
b4b5b58e35 | ||
|
|
bf4672fb2b | ||
|
|
d6e2dcd25b | ||
|
|
3b7d22153f | ||
|
|
490a8d35cb | ||
|
|
260846e9e9 | ||
|
|
d1ed5aadc2 | ||
|
|
1067ed309a | ||
|
|
1ef9bc464d | ||
|
|
ba3a7fc11a | ||
|
|
c44b4c3d35 | ||
|
|
c79c79fe0e | ||
|
|
a7c70a3916 | ||
|
|
325a8cba58 | ||
|
|
35387eeabb | ||
|
|
9d3de8631c | ||
|
|
940e211bb6 | ||
|
|
5eb425bc4c | ||
|
|
bd6b529157 | ||
|
|
0d59e0a2e9 | ||
|
|
1826d122f5 | ||
|
|
ed6dd6f6cd | ||
|
|
81da9fb5a4 | ||
|
|
ec35330593 | ||
|
|
f741953ee4 | ||
|
|
c0343897cd | ||
|
|
d880f8cde5 | ||
|
|
1175bd822c | ||
|
|
63a141abe6 | ||
|
|
abce57ce9c | ||
|
|
c471f7cf6c | ||
|
|
656c2775ac | ||
|
|
a2c6e050d7 | ||
|
|
f3adb05b1c | ||
|
|
bfc3d2e1d4 | ||
|
|
680affd1fe | ||
|
|
ab1d2009a0 | ||
|
|
8196f46721 | ||
|
|
44460365c0 | ||
|
|
38d9aa5e73 |
10
.github/ISSUE_TEMPLATE/app_bug_report.yaml
vendored
10
.github/ISSUE_TEMPLATE/app_bug_report.yaml
vendored
@@ -27,7 +27,6 @@ body:
|
||||
- If your bug is the result of upscaling please use the forums or discord for assistance with various upscaling workarounds. Additionally, the unofficial PCSX2 [Wiki](https://wiki.pcsx2.net/Main_Page) often lists various fixes for upscaling issues.
|
||||
- We do **not** accept issues relating to Widescreen/no-interlace patches at this time.
|
||||
- Any issues pertaining to Widescreen/no-interlace patches please forward them to the [patches repository](https://github.com/PCSX2/pcsx2_patches).
|
||||
-If PCSX2 crashed, please post crash logs and the .dmp file if appropiate.
|
||||
|
||||
- type: textarea
|
||||
id: desc
|
||||
@@ -80,3 +79,12 @@ body:
|
||||
placeholder: "Example: Arch"
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
id: logsDumps
|
||||
attributes:
|
||||
label: "Logs & Dumps"
|
||||
description: |
|
||||
Please feel free to attach any logs here.
|
||||
If PCSX2 crashed, please post crash logs and the .dmp file (in a zip file) if appropriate.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/emu_bug_report.yaml
vendored
2
.github/ISSUE_TEMPLATE/emu_bug_report.yaml
vendored
@@ -140,7 +140,7 @@ body:
|
||||
label: "Logs & Dumps"
|
||||
description: |
|
||||
Please feel free to attach any logs, block dumps, GSdump, etc here.
|
||||
If PCSX2 crashed, please post crash logs and the .dmp file if appropiate.
|
||||
If PCSX2 crashed, please post crash logs and the .dmp file (in a zip file) if appropriate.
|
||||
If your problem is graphical in nature it is highly recommended that you provide a GSdump. [GSdump Guide](https://forums.pcsx2.net/Thread-How-to-create-a-proper-GS-dump)
|
||||
validations:
|
||||
required: false
|
||||
|
||||
8
.github/labeler.yml
vendored
8
.github/labeler.yml
vendored
@@ -115,11 +115,11 @@
|
||||
- 'pcsx2/IPU/*'
|
||||
- 'pcsx2/IPU/**/*'
|
||||
'Memory Card':
|
||||
- 'pcsx2/gui/MemoryCard*'
|
||||
- 'pcsx2/gui/**/MemoryCard*'
|
||||
- 'pcsx2/SIO/Memcard/*'
|
||||
- 'pcsx2/SIO/Memcard/**/*'
|
||||
'PAD':
|
||||
- 'pcsx2/PAD/*'
|
||||
- 'pcsx2/PAD/**/*'
|
||||
- 'pcsx2/SIO/Pad/*'
|
||||
- 'pcsx2/SIO/Pad/**/*'
|
||||
'SPU2':
|
||||
- 'pcsx2/SPU2/*'
|
||||
- 'pcsx2/SPU2/**/*'
|
||||
|
||||
41
.github/workflows/cron_publish_flatpak.yml
vendored
Normal file
41
.github/workflows/cron_publish_flatpak.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: 📦 Publish Flathub Release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # Every day at 12am UTC.
|
||||
workflow_dispatch: # As well as manually.
|
||||
|
||||
jobs:
|
||||
check:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "Check if release is needed"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
PCSX2_RELEASE: ${{ steps.getinfo.outputs.PCSX2_RELEASE }}
|
||||
FLATHUB_RELEASE: ${{ steps.getinfo.outputs.FLATHUB_RELEASE }}
|
||||
steps:
|
||||
- name: Get latest tag and Flathub release
|
||||
id: getinfo
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
PCSX2_RELEASE=$(gh api -H 'Accept: application/vnd.github+json' -H 'X-GitHub-Api-Version: 2022-11-28' /repos/PCSX2/pcsx2/releases | jq -r '.[0].tag_name')
|
||||
FLATHUB_RELEASE=$(curl -L -s https://flathub.org/api/v2/appstream/net.pcsx2.PCSX2 | jq -r '.releases | max_by(.version) | .version')
|
||||
echo "Latest PCSX2 release is: '${PCSX2_RELEASE}'"
|
||||
echo "Latest Flathub release is: '${FLATHUB_RELEASE}'"
|
||||
echo "PCSX2_RELEASE=${PCSX2_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
echo "FLATHUB_RELEASE=${FLATHUB_RELEASE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
needs: check
|
||||
if: needs.check.outputs.FLATHUB_RELEASE < needs.check.outputs.PCSX2_RELEASE
|
||||
name: "Build and publish Flatpak"
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
publish: true
|
||||
branch: stable
|
||||
secrets: inherit
|
||||
|
||||
28
.github/workflows/cron_update_base_translation.yml
vendored
Normal file
28
.github/workflows/cron_update_base_translation.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: 🌎 Update Base Translation
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # Every day at 12am UTC.
|
||||
workflow_dispatch: # As well as manually.
|
||||
|
||||
jobs:
|
||||
update:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "Update Base Translation"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Update Base Translation
|
||||
run: ./.github/workflows/scripts/common/update_base_translation.sh
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
title: "Qt: Update Base Translation"
|
||||
commit-message: "Qt: Update Base Translation"
|
||||
committer: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
|
||||
author: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
|
||||
body: "Daily update of base translation sources."
|
||||
branch: update-base-translation
|
||||
delete-branch: true
|
||||
4
.github/workflows/lint_gamedb.yml
vendored
4
.github/workflows/lint_gamedb.yml
vendored
@@ -2,8 +2,8 @@ name: 📝 Validate GameDB
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
branches-ignore:
|
||||
- "l10n_master"
|
||||
paths:
|
||||
- '**/GameIndex.yaml'
|
||||
pull_request:
|
||||
|
||||
121
.github/workflows/linux_build_flatpak.yml
vendored
Normal file
121
.github/workflows/linux_build_flatpak.yml
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
name: Flatpak Build Steps
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
jobName:
|
||||
required: true
|
||||
type: string
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
default: ubuntu-22.04
|
||||
platform:
|
||||
required: false
|
||||
type: string
|
||||
default: x64
|
||||
compiler:
|
||||
required: true
|
||||
type: string
|
||||
cmakeflags:
|
||||
required: true
|
||||
type: string
|
||||
branch:
|
||||
required: false
|
||||
type: string
|
||||
default: "stable"
|
||||
publish:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
||||
fetchTags:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
name: ${{ inputs.jobName }}
|
||||
runs-on: ${{ inputs.os }}
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# Hackity hack. When running the workflow on a schedule, we don't have the tag,
|
||||
# it doesn't fetch tags, therefore we don't get a version. So grab them manually.
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch tags
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: linux
|
||||
BUILD_SYSTEM: flatpak
|
||||
ARCH: ${{ inputs.platform }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
PR_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: ./.github/workflows/scripts/common/name-artifacts.sh
|
||||
|
||||
- name: Install Packages
|
||||
env:
|
||||
COMPILER: ${{ inputs.compiler }}
|
||||
run: .github/workflows/scripts/linux/install-packages-flatpak.sh
|
||||
|
||||
- name: Download patches
|
||||
run: |
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
- name: Generate AppStream XML
|
||||
run: |
|
||||
./.github/workflows/scripts/linux/generate-metainfo.sh .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
cat .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
flatpak run org.freedesktop.appstream-glib validate .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml
|
||||
|
||||
- name: Build Flatpak
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6.1
|
||||
with:
|
||||
bundle: ${{ steps.artifact-metadata.outputs.artifact-name }}.flatpak
|
||||
manifest-path: .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
|
||||
arch: x86_64
|
||||
build-bundle: true
|
||||
verbose: true
|
||||
mirror-screenshots-url: https://dl.flathub.org/repo/screenshots
|
||||
branch: ${{ inputs.branch }}
|
||||
cache: true
|
||||
restore-cache: true
|
||||
cache-key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} flatpak ${{ hashFiles('.github/workflows/scripts/linux/flatpak/**/*.json') }}
|
||||
|
||||
- name: Commit screenshots to OSTree
|
||||
run: |
|
||||
ostree commit --repo=repo --canonical-permissions --branch=screenshots/x86_64 flatpak_app/screenshots
|
||||
|
||||
- name: Push to Flathub beta
|
||||
if: inputs.publish == true && inputs.branch == 'beta'
|
||||
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
repository: beta
|
||||
token: ${{ secrets.FLATHUB_BETA_TOKEN }}
|
||||
|
||||
- name: Push to Flathub stable
|
||||
if: inputs.publish == true && inputs.branch == 'stable'
|
||||
uses: flatpak/flatpak-github-actions/flat-manager@v6.1
|
||||
with:
|
||||
flat-manager-url: https://hub.flathub.org/
|
||||
repository: stable
|
||||
token: ${{ secrets.FLATHUB_TOKEN }}
|
||||
|
||||
17
.github/workflows/linux_build_matrix.yml
vendored
17
.github/workflows/linux_build_matrix.yml
vendored
@@ -2,8 +2,8 @@ name: 🐧 Linux Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
branches-ignore:
|
||||
- "l10n_master"
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
@@ -11,10 +11,21 @@ on:
|
||||
jobs:
|
||||
build_linux_qt:
|
||||
name: "AppImage"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/linux_build_qt.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
jobName: "AppImage Build"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
buildAppImage: true
|
||||
secrets: inherit
|
||||
build_linux_flatpak:
|
||||
name: "Flatpak"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Flatpak Build"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
publish: false
|
||||
secrets: inherit
|
||||
|
||||
31
.github/workflows/linux_build_qt.yml
vendored
31
.github/workflows/linux_build_qt.yml
vendored
@@ -9,7 +9,7 @@ on:
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
default: ubuntu-20.04
|
||||
default: ubuntu-22.04
|
||||
platform:
|
||||
required: false
|
||||
type: string
|
||||
@@ -28,10 +28,14 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: ""
|
||||
cheats_url:
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
||||
fetchTags:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_linux:
|
||||
@@ -52,12 +56,16 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch Tags
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: linux
|
||||
GUI_FRAMEWORK: QT
|
||||
ARCH: ${{ inputs.platform }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
@@ -87,22 +95,25 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: .github/workflows/scripts/linux/build-dependencies-qt.sh
|
||||
|
||||
- name: Download cheats
|
||||
- name: Download patches
|
||||
run: |
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.cheats_url }}/cheats_ni.zip" "${{ inputs.cheats_url }}/cheats_ws.zip"
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
- name: Generate CMake
|
||||
env:
|
||||
COMPILER: ${{ inputs.compiler }}
|
||||
ADDITIONAL_CMAKE_ARGS: ${{ inputs.cmakeflags }}
|
||||
run: .github/workflows/scripts/linux/generate-cmake-qt.sh
|
||||
CLANG_PATH: /usr/bin/clang-16
|
||||
CLANGXX_PATH: /usr/bin/clang++-16
|
||||
run: |
|
||||
DEPS_PREFIX="$HOME/deps" .github/workflows/scripts/linux/generate-cmake-qt.sh
|
||||
|
||||
- name: Build PCSX2
|
||||
working-directory: build
|
||||
@@ -117,9 +128,9 @@ jobs:
|
||||
env:
|
||||
NAME: ${{ steps.artifact-metadata.outputs.artifact-name }}
|
||||
run: |
|
||||
.github/workflows/scripts/linux/appimage-qt.sh "$(realpath .)" "$(realpath ./build)" "$HOME/deps" "$NAME"
|
||||
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
mv "${NAME}.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
.github/workflows/scripts/linux/appimage-qt.sh "$(realpath .)" "$(realpath ./build)" "$HOME/deps" "$NAME"
|
||||
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
mv "${NAME}.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts/
|
||||
|
||||
- name: Upload artifact
|
||||
if: inputs.buildAppImage == true
|
||||
|
||||
47
.github/workflows/macos_build.yml
vendored
47
.github/workflows/macos_build.yml
vendored
@@ -9,18 +9,15 @@ on:
|
||||
os:
|
||||
required: false
|
||||
type: string
|
||||
default: macos-11.0
|
||||
platform:
|
||||
required: false
|
||||
type: string
|
||||
default: x64
|
||||
gui:
|
||||
required: true
|
||||
type: string
|
||||
cheats_url:
|
||||
default: macos-13
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
||||
fetchTags:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_macos:
|
||||
@@ -42,13 +39,19 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch Tags
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Use Xcode 14.3.1
|
||||
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: macos
|
||||
GUI_FRAMEWORK: ${{ inputs.gui }}
|
||||
ARCH: ${{ inputs.platform }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_NUM: ${{ github.event.pull_request.number }}
|
||||
@@ -57,16 +60,16 @@ jobs:
|
||||
|
||||
- name: Install Packages
|
||||
env:
|
||||
PLATFORM: ${{ inputs.platform }}
|
||||
PLATFORM: "x64"
|
||||
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
||||
HOMEBREW_NO_ANALYTICS: 1
|
||||
run: |
|
||||
brew unlink libjpeg || true # Conflicts with our self-built dependencies
|
||||
brew unlink libpng || true
|
||||
# Unlike other packages, brew's MoltenVK build uses MoltenVK's minimum macOS version of 10.13 so we can use it
|
||||
if ! brew install molten-vk ccache; then
|
||||
if ! brew install molten-vk ccache nasm; then
|
||||
brew update
|
||||
brew install molten-vk ccache
|
||||
brew install molten-vk ccache nasm
|
||||
fi
|
||||
|
||||
- name: Cache Dependencies
|
||||
@@ -74,18 +77,16 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/deps
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh') }}
|
||||
key: ${{ inputs.os }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh') }}
|
||||
|
||||
- name: Build Dependencies
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
env:
|
||||
GUI: ${{ inputs.gui }}
|
||||
run: .github/workflows/scripts/macos/build-dependencies.sh
|
||||
|
||||
- name: Download cheats
|
||||
- name: Download patches
|
||||
run: |
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.cheats_url }}/cheats_ni.zip" "${{ inputs.cheats_url }}/cheats_ws.zip"
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
|
||||
- name: Prepare ccache timestamp
|
||||
@@ -96,8 +97,8 @@ jobs:
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .ccache
|
||||
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
restore-keys: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} ccache
|
||||
key: ${{ inputs.os }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
|
||||
restore-keys: ${{ inputs.os }} ccache
|
||||
|
||||
- name: Generate CMake Files
|
||||
run: |
|
||||
@@ -108,6 +109,7 @@ jobs:
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
|
||||
-DUSE_SYSTEM_LIBS=OFF \
|
||||
-DUSE_SYSTEM_SDL2=ON \
|
||||
-DUSE_LINKED_FFMPEG=ON \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON \
|
||||
@@ -130,7 +132,6 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Run Tests
|
||||
if: inputs.gui == 'Qt'
|
||||
working-directory: build
|
||||
run: make -j$(getconf _NPROCESSORS_ONLN) unittests
|
||||
|
||||
@@ -146,7 +147,7 @@ jobs:
|
||||
mv build/pcsx2*/PCSX2.app "$APPNAME.app"
|
||||
tar --options xz:compression-level=9 -cvJf "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.xz" "$APPNAME.app"
|
||||
mkdir ci-artifacts
|
||||
cp "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.xz" ci-artifacts/macOS-${{ inputs.gui }}.tar.xz
|
||||
cp "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.xz" ci-artifacts/macOS.tar.xz
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
8
.github/workflows/macos_build_matrix.yml
vendored
8
.github/workflows/macos_build_matrix.yml
vendored
@@ -2,8 +2,8 @@ name: 🍎 MacOS Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
branches-ignore:
|
||||
- "l10n_master"
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
@@ -11,8 +11,8 @@ on:
|
||||
jobs:
|
||||
build_macos_qt:
|
||||
name: "Defaults"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/macos_build.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
gui: "Qt"
|
||||
jobName: "MacOS Build"
|
||||
secrets: inherit
|
||||
|
||||
186
.github/workflows/release_cut_new.yml
vendored
Normal file
186
.github/workflows/release_cut_new.yml
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
# Whenever a commit is pushed to master (ideally via a pull-request!)
|
||||
# this action will create the next release, which means:
|
||||
# 1. tag master with the proper version
|
||||
# 2. create a new draft release (pre-released if a nightly build)
|
||||
# 3. add release notes
|
||||
|
||||
name: 🏭 Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
# TODO - future work
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# isStable:
|
||||
# description: 'Should it be a stable release?'
|
||||
# required: true
|
||||
# default: 'false'
|
||||
# versionTag:
|
||||
# description: 'The version to tag with'
|
||||
# required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
cut-release:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
name: "Create Tag and Release"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Docs - https://github.com/mathieudutour/github-tag-action
|
||||
- name: Bump Version and Push Tag
|
||||
id: tag_version
|
||||
uses: mathieudutour/github-tag-action@v6.1
|
||||
with:
|
||||
github_token: ${{ github.token }}
|
||||
tag_prefix: v
|
||||
default_bump: patch
|
||||
|
||||
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
|
||||
# with PRs -- not commits (determine how much we care).
|
||||
# - name: Create Draft Release
|
||||
# run: |
|
||||
# echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}"
|
||||
# gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }}
|
||||
|
||||
- name: Generate Release Notes
|
||||
env:
|
||||
OWNER: PCSX2
|
||||
REPO: pcsx2
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
COMMIT_SHA: ${{ github.SHA }}
|
||||
run: |
|
||||
cd ./.github/workflows/scripts/releases/generate-release-notes
|
||||
npm ci
|
||||
node index.js
|
||||
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
||||
|
||||
- name: Create a GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: steps.tag_version.outputs.new_tag
|
||||
with:
|
||||
body_path: ./release-notes.md
|
||||
draft: true
|
||||
prerelease: true
|
||||
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||
|
||||
# Build Everything
|
||||
# Linux
|
||||
build_linux_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- cut-release
|
||||
name: "Linux"
|
||||
uses: ./.github/workflows/linux_build_qt.yml
|
||||
with:
|
||||
jobName: "AppImage Build"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
buildAppImage: true
|
||||
fetchTags: true
|
||||
secrets: inherit
|
||||
|
||||
build_linux_flatpak:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- cut-release
|
||||
name: "Linux"
|
||||
uses: ./.github/workflows/linux_build_flatpak.yml
|
||||
with:
|
||||
jobName: "Flatpak Build"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
branch: "stable"
|
||||
publish: false
|
||||
fetchTags: true
|
||||
secrets: inherit
|
||||
|
||||
# Windows
|
||||
build_windows_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- cut-release
|
||||
name: "Windows"
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: "Windows Build"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
fetchTags: true
|
||||
secrets: inherit
|
||||
|
||||
# MacOS
|
||||
build_macos_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- cut-release
|
||||
name: "MacOS"
|
||||
uses: ./.github/workflows/macos_build.yml
|
||||
with:
|
||||
jobName: "MacOS Build"
|
||||
fetchTags: true
|
||||
secrets: inherit
|
||||
|
||||
# Upload the Artifacts
|
||||
upload_artifacts:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- build_linux_flatpak
|
||||
- build_linux_qt
|
||||
- build_windows_qt
|
||||
- build_macos_qt
|
||||
name: "Upload Artifacts"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch Tags
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Prepare Artifact Folder
|
||||
run: mkdir ./ci-artifacts/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
name: Download all Artifacts
|
||||
with:
|
||||
path: ./ci-artifacts/
|
||||
|
||||
- name: Display structure of downloaded files
|
||||
run: ls ./ci-artifacts/
|
||||
|
||||
# Prepare artifacts, they are all zips from github!
|
||||
- name: Prepare Artifacts
|
||||
working-directory: ./ci-artifacts/
|
||||
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
|
||||
|
||||
# Artifact Naming:
|
||||
# MacOS: PCSX2-<tag>-macOS-[additional hyphen seperated tags]
|
||||
# Windows|Linux: PCSX2-<tag>-<windows|linux>-<32bit|64bit>--[additional hyphen seperated tags]
|
||||
- name: Name and Upload the Release Assets
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
||||
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
run: |
|
||||
TAG_VAL=$(git tag --points-at HEAD)
|
||||
echo "TAG_VAL=${TAG_VAL}"
|
||||
gh release list --repo PCSX2/pcsx2
|
||||
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
TAG_VAL=${TAG_VAL} python ./.github/workflows/scripts/releases/rename-release-assets.py
|
||||
ls ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/out/* --repo PCSX2/pcsx2 --clobber
|
||||
|
||||
- name: Publish Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
TAG_VAL=$(git tag --points-at HEAD)
|
||||
echo "TAG_VAL=${TAG_VAL}"
|
||||
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2
|
||||
71
.github/workflows/release_new_tag.yml
vendored
71
.github/workflows/release_new_tag.yml
vendored
@@ -1,71 +0,0 @@
|
||||
# Whenever a commit is pushed to master (ideally via a pull-request!)
|
||||
# this action will create the next release, which means:
|
||||
# 1. tag master with the proper version
|
||||
# 2. create a new draft release (pre-released if a nightly build)
|
||||
# 3. add release notes
|
||||
|
||||
name: 🏭 Create Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
# TODO - future work
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# isStable:
|
||||
# description: 'Should it be a stable release?'
|
||||
# required: true
|
||||
# default: 'false'
|
||||
# versionTag:
|
||||
# description: 'The version to tag with'
|
||||
# required: true
|
||||
|
||||
jobs:
|
||||
cut-release:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
runs-on: ubuntu-latest
|
||||
name: "Create Tag and Release"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Docs - https://github.com/mathieudutour/github-tag-action
|
||||
- name: Bump Version and Push Tag
|
||||
id: tag_version
|
||||
uses: mathieudutour/github-tag-action@v6.1
|
||||
with:
|
||||
# Workflows cannot trigger other workflows implicitly
|
||||
# - https://github.community/t/github-actions-workflow-not-triggering-with-tag-push/17053/7
|
||||
github_token: ${{ secrets.BOT_PAT }}
|
||||
tag_prefix: v
|
||||
default_bump: patch
|
||||
|
||||
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
|
||||
# with PRs -- not commits (determine how much we care).
|
||||
# - name: Create Draft Release
|
||||
# env:
|
||||
# GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
||||
# run: |
|
||||
# echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}"
|
||||
# gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }}
|
||||
|
||||
- name: Generate Release Notes
|
||||
env:
|
||||
OWNER: PCSX2
|
||||
REPO: pcsx2
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
COMMIT_SHA: ${{ github.SHA }}
|
||||
run: |
|
||||
cd ./.github/workflows/scripts/releases/generate-release-notes
|
||||
npm ci
|
||||
node index.js
|
||||
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
|
||||
|
||||
- name: Create a GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: steps.tag_version.outputs.new_tag
|
||||
with:
|
||||
body_path: ./release-notes.md
|
||||
draft: true
|
||||
prerelease: true
|
||||
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||
95
.github/workflows/release_pipeline.yml
vendored
95
.github/workflows/release_pipeline.yml
vendored
@@ -1,95 +0,0 @@
|
||||
name: 🏭 Release Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
# Build Everything
|
||||
# Linux
|
||||
build_linux_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "Linux"
|
||||
uses: ./.github/workflows/linux_build_qt.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
compiler: clang
|
||||
cmakeflags: ""
|
||||
buildAppImage: true
|
||||
secrets: inherit
|
||||
|
||||
# Windows
|
||||
build_windows_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "Windows"
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
|
||||
secrets: inherit
|
||||
|
||||
# MacOS
|
||||
build_macos_qt:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
name: "MacOS"
|
||||
uses: ./.github/workflows/macos_build.yml
|
||||
with:
|
||||
jobName: "Qt"
|
||||
gui: "Qt"
|
||||
secrets: inherit
|
||||
|
||||
# Upload the Artifacts
|
||||
upload_artifacts:
|
||||
if: github.repository == 'PCSX2/pcsx2'
|
||||
needs:
|
||||
- build_linux_qt
|
||||
- build_windows_qt
|
||||
- build_macos_qt
|
||||
name: "Upload Artifacts"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare Artifact Folder
|
||||
run: mkdir ./ci-artifacts/
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
name: Download all Artifacts
|
||||
with:
|
||||
path: ./ci-artifacts/
|
||||
|
||||
- name: Display structure of downloaded files
|
||||
run: ls ./ci-artifacts/
|
||||
|
||||
# Prepare artifacts, they are all zips from github!
|
||||
- name: Prepare Artifacts
|
||||
working-directory: ./ci-artifacts/
|
||||
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
|
||||
|
||||
# Artifact Naming:
|
||||
# MacOS: PCSX2-<tag>-macOS-[additional hyphen seperated tags]
|
||||
# Windows|Linux: PCSX2-<tag>-<windows|linux>-<32bit|64bit>--[additional hyphen seperated tags]
|
||||
- name: Name and Upload the Release Assets
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ github.REF }}
|
||||
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
|
||||
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
run: |
|
||||
gh release list --repo PCSX2/pcsx2
|
||||
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
python ./.github/workflows/scripts/releases/rename-release-assets.py
|
||||
ls ${{ github.WORKSPACE }}/ci-artifacts/out
|
||||
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
|
||||
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/out/* --repo PCSX2/pcsx2 --clobber
|
||||
|
||||
- name: Publish Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
||||
run: |
|
||||
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
|
||||
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Artifact Naming Scheme:
|
||||
# PCSX2-<OS>-<GUI>-[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\]
|
||||
# PCSX2-<OS>-Qt-[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\]
|
||||
# -- limited to 200 chars
|
||||
# Outputs:
|
||||
# - artifact-name
|
||||
@@ -9,7 +9,6 @@
|
||||
# Inputs as env-vars
|
||||
# OS
|
||||
# BUILD_SYSTEM
|
||||
# GUI_FRAMEWORK
|
||||
# ARCH
|
||||
# SIMD
|
||||
# EVENT_NAME
|
||||
@@ -20,17 +19,18 @@
|
||||
NAME=""
|
||||
|
||||
if [ "${OS}" == "macos" ]; then
|
||||
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}"
|
||||
# MacOS has combined binaries for x64 and ARM64.
|
||||
NAME="PCSX2-${OS}-Qt"
|
||||
elif [[ ("${OS}" == "windows" && "$BUILD_SYSTEM" != "cmake") ]]; then
|
||||
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}-${ARCH}-${SIMD}"
|
||||
NAME="PCSX2-${OS}-Qt-${ARCH}-${SIMD}"
|
||||
else
|
||||
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}-${ARCH}"
|
||||
NAME="PCSX2-${OS}-Qt-${ARCH}"
|
||||
fi
|
||||
|
||||
# Add cmake if used to differentate it from msbuild builds
|
||||
# Else the two artifacts will have the same name and the files will be merged
|
||||
if [[ ! -z "${BUILD_SYSTEM}" ]]; then
|
||||
if [ "${BUILD_SYSTEM}" == "cmake" ]; then
|
||||
if [[ "${BUILD_SYSTEM}" == "cmake" ]] || [[ "${BUILD_SYSTEM}" == "flatpak" ]]; then
|
||||
NAME="${NAME}-${BUILD_SYSTEM}"
|
||||
fi
|
||||
fi
|
||||
|
||||
12
.github/workflows/scripts/common/update_base_translation.sh
vendored
Executable file
12
.github/workflows/scripts/common/update_base_translation.sh
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/../linux/functions.sh"
|
||||
|
||||
set -e
|
||||
|
||||
# While we use custom Qt builds for our releases, the Qt6 package will be good enough
|
||||
# for just updating translations. Saves building it for this action alone.
|
||||
retry_command sudo apt-get -y install qt6-l10n-tools
|
||||
|
||||
PATH=/usr/lib/qt6/bin:$PATH "$SCRIPTDIR/../../../../pcsx2-qt/Translations/update_en_translation.sh"
|
||||
4
.github/workflows/scripts/linux/AppRun-qt
vendored
4
.github/workflows/scripts/linux/AppRun-qt
vendored
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
APPDIR=$(dirname "$0")
|
||||
exec "$APPDIR/usr/bin/pcsx2-qt" "$@"
|
||||
316
.github/workflows/scripts/linux/appimage-qt.sh
vendored
316
.github/workflows/scripts/linux/appimage-qt.sh
vendored
@@ -40,256 +40,118 @@ NAME=$4
|
||||
|
||||
BINARY=pcsx2-qt
|
||||
APPDIRNAME=PCSX2.AppDir
|
||||
STRIP=llvm-strip-12
|
||||
STRIP=strip
|
||||
|
||||
declare -a SYSLIBS=(
|
||||
"libaio.so.1"
|
||||
"libz.so.1"
|
||||
"libuuid.so.1"
|
||||
"libapparmor.so.1"
|
||||
"libblkid.so.1"
|
||||
"libbsd.so.0"
|
||||
"libdbus-1.so.3"
|
||||
"libgcrypt.so.20"
|
||||
"liblzma.so.5"
|
||||
"libmount.so.1"
|
||||
"libnsl.so.1"
|
||||
"libpcre.so.3"
|
||||
"libselinux.so.1"
|
||||
"libsystemd.so.0"
|
||||
"libudev.so.1"
|
||||
"libwrap.so.0"
|
||||
"libharfbuzz.so.0"
|
||||
"libFLAC.so.8"
|
||||
"libSoundTouch.so.1"
|
||||
"libXau.so.6"
|
||||
"libXcomposite.so.1"
|
||||
"libXcursor.so.1"
|
||||
"libXdamage.so.1"
|
||||
"libXdmcp.so.6"
|
||||
"libXext.so.6"
|
||||
"libXfixes.so.3"
|
||||
"libXi.so.6"
|
||||
"libXinerama.so.1"
|
||||
"libXrandr.so.2"
|
||||
"libXrender.so.1"
|
||||
"libXxf86vm.so.1"
|
||||
"libasyncns.so.0"
|
||||
"libcrypto.so.1.1"
|
||||
"libjpeg.so.8"
|
||||
"liblz4.so.1"
|
||||
"libogg.so.0"
|
||||
"libpcap.so.0.8"
|
||||
"libpng16.so.16"
|
||||
"libpulse.so.0"
|
||||
"libsamplerate.so.0"
|
||||
"libsndfile.so.1"
|
||||
"libvorbis.so.0"
|
||||
"libvorbisenc.so.2"
|
||||
"libxcb.so.1"
|
||||
"libxcb-cursor.so.0"
|
||||
"libxcb-render.so.0"
|
||||
"libxcb-shm.so.0"
|
||||
"libxkbcommon.so.0"
|
||||
"libxkbcommon-x11.so.0"
|
||||
"pulseaudio/libpulsecommon-13.99.so"
|
||||
"libasound.so.2"
|
||||
"libfreetype.so.6"
|
||||
"libpcre2-16.so.0"
|
||||
"libexpat.so.1"
|
||||
"libffi.so.7"
|
||||
"libgraphite2.so.3"
|
||||
"libresolv.so.2"
|
||||
"libgpg-error.so.0"
|
||||
"libpcre2-16.so.0"
|
||||
"libpng16.so.16"
|
||||
"libxcb-icccm.so.4"
|
||||
"libxcb-image.so.0"
|
||||
"libxcb-keysyms.so.1"
|
||||
"libxcb-randr.so.0"
|
||||
"libxcb-render.so.0"
|
||||
"libxcb-render-util.so.0"
|
||||
"libxcb-shape.so.0"
|
||||
"libxcb-sync.so.1"
|
||||
"libxcb-util.so.1"
|
||||
"libxcb-xfixes.so.0"
|
||||
"libxcb-xkb.so.1"
|
||||
"libevdev.so.2"
|
||||
"libgudev-1.0.so.0"
|
||||
"libinput.so.10"
|
||||
"libjpeg.so.8"
|
||||
"libmtdev.so.1"
|
||||
"libpng16.so.16"
|
||||
"libudev.so.1"
|
||||
"libuuid.so.1"
|
||||
"libcurl.so.4"
|
||||
"libnghttp2.so.14"
|
||||
"libidn2.so.0"
|
||||
"librtmp.so.1"
|
||||
"libssh.so.4"
|
||||
"libpsl.so.5"
|
||||
"libssl.so.1.1"
|
||||
"libnettle.so.7"
|
||||
"libgnutls.so.30"
|
||||
"libgssapi_krb5.so.2"
|
||||
"libldap_r-2.4.so.2"
|
||||
"liblber-2.4.so.2"
|
||||
"libbrotlidec.so.1"
|
||||
"libunistring.so.2"
|
||||
"libhogweed.so.5"
|
||||
"libgmp.so.10"
|
||||
"libp11-kit.so.0"
|
||||
"libtasn1.so.6"
|
||||
"libkrb5.so.3"
|
||||
"libk5crypto.so.3"
|
||||
"libcom_err.so.2"
|
||||
"libkrb5support.so.0"
|
||||
"libsasl2.so.2"
|
||||
"libgssapi.so.3"
|
||||
"libbrotlicommon.so.1"
|
||||
"libkeyutils.so.1"
|
||||
"libheimntlm.so.0"
|
||||
"libkrb5.so.26"
|
||||
"libasn1.so.8"
|
||||
"libhcrypto.so.4"
|
||||
"libroken.so.18"
|
||||
"libwind.so.0"
|
||||
"libheimbase.so.1"
|
||||
"libhx509.so.5"
|
||||
"libsqlite3.so.0"
|
||||
"libcrypt.so.1"
|
||||
"libdbus-1.so.3"
|
||||
)
|
||||
|
||||
declare -a DEPLIBS=(
|
||||
"libSDL2-2.0.so.0"
|
||||
)
|
||||
|
||||
declare -a QTLIBS=(
|
||||
"libQt6Core.so.6"
|
||||
"libQt6Gui.so.6"
|
||||
"libQt6Network.so.6"
|
||||
"libQt6OpenGL.so.6"
|
||||
"libQt6Svg.so.6"
|
||||
"libQt6WaylandClient.so.6"
|
||||
"libQt6WaylandCompositor.so.6"
|
||||
declare -a MANUAL_QT_LIBS=(
|
||||
"libQt6WaylandEglClientHwIntegration.so.6"
|
||||
"libQt6WaylandEglCompositorHwIntegration.so.6"
|
||||
"libQt6Widgets.so.6"
|
||||
"libQt6XcbQpa.so.6"
|
||||
)
|
||||
|
||||
declare -a QTPLUGINS=(
|
||||
"plugins/iconengines"
|
||||
"plugins/imageformats"
|
||||
"plugins/platforms"
|
||||
#"plugins/platformthemes" # Enable this if we want to ship GTK+ themes at any point.
|
||||
"plugins/tls"
|
||||
"plugins/wayland-decoration-client"
|
||||
"plugins/wayland-graphics-integration-client"
|
||||
"plugins/wayland-graphics-integration-server"
|
||||
"plugins/wayland-shell-integration"
|
||||
"plugins/xcbglintegrations"
|
||||
declare -a MANUAL_QT_PLUGINS=(
|
||||
"wayland-decoration-client"
|
||||
"wayland-graphics-integration-client"
|
||||
"wayland-shell-integration"
|
||||
)
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -f appimagetool-x86_64.AppImage ]; then
|
||||
retry_command wget -O appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
chmod +x appimagetool-x86_64.AppImage
|
||||
LINUXDEPLOY=./linuxdeploy-x86_64.AppImage
|
||||
LINUXDEPLOY_PLUGIN_QT=./linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
APPIMAGETOOL=./appimagetool-x86_64.AppImage
|
||||
PATCHELF=patchelf
|
||||
|
||||
if [ ! -f "$LINUXDEPLOY" ]; then
|
||||
retry_command wget -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY"
|
||||
fi
|
||||
|
||||
if [ ! -f "$LINUXDEPLOY_PLUGIN_QT" ]; then
|
||||
retry_command wget -O "$LINUXDEPLOY_PLUGIN_QT" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY_PLUGIN_QT"
|
||||
fi
|
||||
|
||||
if [ ! -f "$APPIMAGETOOL" ]; then
|
||||
retry_command wget -O "$APPIMAGETOOL" https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
chmod +x "$APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
OUTDIR=$(realpath "./$APPDIRNAME")
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
rm -fr "$OUTDIR"
|
||||
mkdir "$OUTDIR"
|
||||
mkdir "$OUTDIR/usr"
|
||||
|
||||
echo "Copying binary and resources..."
|
||||
cp -a "$BUILDDIR/bin" "$OUTDIR/usr"
|
||||
# Why the nastyness? linuxdeploy strips our main binary, and there's no option to turn it off.
|
||||
# It also doesn't strip the Qt libs. We can't strip them after running linuxdeploy, because
|
||||
# patchelf corrupts the libraries (but they still work), but patchelf+strip makes them crash
|
||||
# on load. So, make a backup copy, strip the original (since that's where linuxdeploy finds
|
||||
# the libs to copy), then swap them back after we're done.
|
||||
# Isn't Linux packaging amazing?
|
||||
|
||||
# Get rid of unit tests, we don't want them bloating the squashfs.
|
||||
rm -fv "$OUTDIR"/usr/bin/*_test
|
||||
|
||||
# Patch RPATH so the binary goes hunting for shared libraries in the AppDir instead of system.
|
||||
echo "Patching RPATH in ${BINARY}..."
|
||||
patchelf --set-rpath '$ORIGIN/../lib' "$OUTDIR/usr/bin/$BINARY"
|
||||
|
||||
# Currently we leave the main binary unstripped, uncomment if this is not desired.
|
||||
#$STRIP "$OUTDIR/usr/bin/$BINARY"
|
||||
|
||||
# Libraries we pull in from the system.
|
||||
echo "Copying system libraries..."
|
||||
mkdir -p "$OUTDIR/usr/lib" "$OUTDIR/usr/lib/pulseaudio"
|
||||
for lib in "${SYSLIBS[@]}"; do
|
||||
blib=$(basename "$lib")
|
||||
if [ -f "/lib/x86_64-linux-gnu/$lib" ]; then
|
||||
cp "/lib/x86_64-linux-gnu/$lib" "$OUTDIR/usr/lib/$blib"
|
||||
elif [ -f "$CHROOT/usr/lib/x86_64-linux-gnu/$lib" ]; then
|
||||
cp "$CHROOT/usr/lib/x86_64-linux-gnu/$lib" "$OUTDIR/usr/lib/$blib"
|
||||
elif [ -f "$CHROOT/lib/$lib" ]; then
|
||||
cp "$CHROOT/lib/$lib" "$OUTDIR/usr/lib/$blib"
|
||||
elif [ -f "$CHROOT/usr/lib/$lib" ]; then
|
||||
cp "$CHROOT/usr/lib/$lib" "$OUTDIR/usr/lib/$blib"
|
||||
else
|
||||
echo "*** Failed to find '$blib'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$STRIP "$OUTDIR/usr/lib/$blib"
|
||||
rm -fr "$DEPSDIR.bak"
|
||||
cp -a "$DEPSDIR" "$DEPSDIR.bak"
|
||||
IFS="
|
||||
"
|
||||
for i in $(find "$DEPSDIR" -iname '*.so'); do
|
||||
echo "Stripping deps library ${i}"
|
||||
strip "$i"
|
||||
done
|
||||
|
||||
# Dependencies we built, at this point it's just SDL.
|
||||
echo "Copying dependency libraries..."
|
||||
for lib in "${DEPLIBS[@]}"; do
|
||||
blib=$(basename "$lib")
|
||||
if [ -f "$DEPSDIR/lib/$lib" ]; then
|
||||
cp "$DEPSDIR/lib/$lib" "$OUTDIR/usr/lib/$blib"
|
||||
else
|
||||
echo "*** Failed to find '$blib'"
|
||||
exit 1
|
||||
fi
|
||||
echo "Copying desktop file..."
|
||||
cp "$PCSX2DIR/.github/workflows/scripts/linux/pcsx2-qt.desktop" "net.pcsx2.PCSX2.desktop"
|
||||
cp "$PCSX2DIR/bin/resources/icons/AppIconLarge.png" "PCSX2.png"
|
||||
|
||||
$STRIP "$OUTDIR/usr/lib/$blib"
|
||||
echo "Running linuxdeploy to create AppDir..."
|
||||
EXTRA_QT_PLUGINS="core;gui;network;svg;waylandclient;widgets;xcbqpa" \
|
||||
EXTRA_PLATFORM_PLUGINS="libqwayland-egl.so;libqwayland-generic.so" \
|
||||
QMAKE="$DEPSDIR/bin/qmake" \
|
||||
NO_STRIP="1" \
|
||||
$LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/pcsx2-qt" \
|
||||
--desktop-file="net.pcsx2.PCSX2.desktop" --icon-file="PCSX2.png"
|
||||
|
||||
echo "Copying resources into AppDir..."
|
||||
cp -a "$BUILDDIR/bin/resources" "$OUTDIR/usr/bin"
|
||||
|
||||
# LinuxDeploy's Qt plugin doesn't include Wayland support. So manually copy in the additional Wayland libraries.
|
||||
echo "Copying Qt Wayland libraries..."
|
||||
for lib in "${MANUAL_QT_LIBS[@]}"; do
|
||||
srcpath="$DEPSDIR/lib/$lib"
|
||||
dstpath="$OUTDIR/usr/lib/$lib"
|
||||
echo " $srcpath -> $dstpath"
|
||||
cp "$srcpath" "$dstpath"
|
||||
$PATCHELF --set-rpath '$ORIGIN' "$dstpath"
|
||||
done
|
||||
|
||||
echo "Copying Qt libraries..."
|
||||
for lib in "${QTLIBS[@]}"; do
|
||||
cp -aL "$DEPSDIR/lib/$lib" "$OUTDIR/usr/lib"
|
||||
$STRIP "$OUTDIR/usr/lib/$lib"
|
||||
# .. and plugins.
|
||||
echo "Copying Qt Wayland plugins..."
|
||||
for GROUP in "${MANUAL_QT_PLUGINS[@]}"; do
|
||||
srcpath="$DEPSDIR/plugins/$GROUP"
|
||||
dstpath="$OUTDIR/usr/plugins/$GROUP"
|
||||
echo " $srcpath -> $dstpath"
|
||||
mkdir -p "$dstpath"
|
||||
|
||||
for srcsopath in $(find "$DEPSDIR/plugins/$GROUP" -iname '*.so'); do
|
||||
# This is ../../ because it's usually plugins/group/name.so
|
||||
soname=$(basename "$srcsopath")
|
||||
dstsopath="$dstpath/$soname"
|
||||
echo " $srcsopath -> $dstsopath"
|
||||
cp "$srcsopath" "$dstsopath"
|
||||
$PATCHELF --set-rpath '$ORIGIN/../../lib:$ORIGIN' "$dstsopath"
|
||||
done
|
||||
done
|
||||
|
||||
echo "Copying Qt plugins..."
|
||||
mkdir -p "$OUTDIR/usr/lib/plugins"
|
||||
for plugin in "${QTPLUGINS[@]}"; do
|
||||
mkdir -p "$OUTDIR/usr/lib/$plugin"
|
||||
cp -aL "$DEPSDIR/$plugin"/*.so "$OUTDIR/usr/lib/$plugin/"
|
||||
done
|
||||
# Restore unstripped deps (for cache).
|
||||
rm -fr "$DEPSDIR"
|
||||
mv "$DEPSDIR.bak" "$DEPSDIR"
|
||||
|
||||
for so in $(find "$OUTDIR/usr/lib/plugins" -iname '*.so'); do
|
||||
# This is ../../ because it's usually plugins/group/name.so
|
||||
echo "Patching RPATH in ${so}..."
|
||||
patchelf --set-rpath '$ORIGIN/../..' "$so"
|
||||
$STRIP "$so"
|
||||
done
|
||||
# Fix up translations.
|
||||
rm -fr "$OUTDIR/usr/bin/translations"
|
||||
mv "$OUTDIR/usr/translations" "$OUTDIR/usr/bin"
|
||||
cp -a "$BUILDDIR/bin/translations" "$OUTDIR/usr/bin"
|
||||
|
||||
for so in $(find "$OUTDIR/usr/lib" -maxdepth 1); do
|
||||
if [ -f "$so" ]; then
|
||||
echo "Patching RPATH in ${so}"
|
||||
patchelf --set-rpath '$ORIGIN' "$so"
|
||||
fi
|
||||
done
|
||||
# Generate AppStream meta-info.
|
||||
echo "Generating AppStream metainfo..."
|
||||
mkdir -p "$OUTDIR/usr/share/metainfo"
|
||||
"$SCRIPTDIR/generate-metainfo.sh" "$OUTDIR/usr/share/metainfo/net.pcsx2.PCSX2.appdata.xml"
|
||||
|
||||
echo "Creating qt.conf..."
|
||||
cat > "$OUTDIR/usr/bin/qt.conf" << EOF
|
||||
[Paths]
|
||||
Plugins = ../lib/plugins
|
||||
EOF
|
||||
echo "Generating AppImage..."
|
||||
rm -f "$NAME.AppImage"
|
||||
$APPIMAGETOOL -v "$OUTDIR" "$NAME.AppImage"
|
||||
|
||||
echo "Copy desktop/icon..."
|
||||
cp "$PCSX2DIR/pcsx2/Resources/AppIcon64.png" "$OUTDIR/PCSX2.png"
|
||||
cp "$SCRIPTDIR/pcsx2-qt.desktop" "$OUTDIR/PCSX2.desktop"
|
||||
cp "$SCRIPTDIR/AppRun-qt" "$OUTDIR/AppRun"
|
||||
|
||||
echo "Generate AppImage"
|
||||
./appimagetool-x86_64.AppImage -v "$OUTDIR" "$NAME.AppImage"
|
||||
|
||||
@@ -4,27 +4,29 @@ set -e
|
||||
|
||||
INSTALLDIR="$HOME/deps"
|
||||
NPROCS="$(getconf _NPROCESSORS_ONLN)"
|
||||
SDL=SDL2-2.26.5
|
||||
QT=6.5.0
|
||||
SDL=SDL2-2.28.1
|
||||
QT=6.5.2
|
||||
LIBBACKTRACE=ad106d5fdd5d960bd33fae1c48a351af567fd075
|
||||
|
||||
mkdir -p deps-build
|
||||
cd deps-build
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
ad8fea3da1be64c83c45b1d363a6b4ba8fd60f5bde3b23ec73855709ec5eabf7 $SDL.tar.gz
|
||||
4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d $SDL.tar.gz
|
||||
fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.zip
|
||||
fde1aa7b4fbe64ec1b4fc576a57f4688ad1453d2fab59cbadd948a10a6eaf5ef qtbase-everywhere-src-$QT.tar.xz
|
||||
64ca7e61f44d51e28bcbb4e0509299b53a9a7e38879e00a7fe91643196067a4f qtsvg-everywhere-src-$QT.tar.xz
|
||||
49c33d96b0a44988be954269b8ce3d1a495b439726e03a6be7c0d50a686369c4 qttools-everywhere-src-$QT.tar.xz
|
||||
fc85d0fd8393f518653ccada1014177a56df6e73f30f3b64eea0c2e4a0067a3d qttranslations-everywhere-src-$QT.tar.xz
|
||||
ccc57fa277fc5f1c1c2c4733eae80a60996b67a067233c47809e542aa31759a3 qtwayland-everywhere-src-$QT.tar.xz
|
||||
3db4c729b4d80a9d8fda8dd77128406353baff4755ca619177eda4cddae71269 qtbase-everywhere-src-$QT.tar.xz
|
||||
aae0c08924c6a5e47f9d57e031673d611ffff7aab2bee2e1cc460471ecac6743 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
48b4cc1093af2e0ab3bea30f60651bddd877a2335d16e7207879a2e9e81963a3 qtsvg-everywhere-src-$QT.tar.xz
|
||||
551ffb22751d8fd4d88e9ebd55b9131f4ca55341ee497fdbbba4da8d10d94341 qttools-everywhere-src-$QT.tar.xz
|
||||
337c45637e757e754c2f0ea65c20de3e6e53a841dda1253db15baa622515beeb qttranslations-everywhere-src-$QT.tar.xz
|
||||
3020be86fb7fd0abb8509906ca6583cadcaee168159abceaeb5b3e9d42563c9a qtwayland-everywhere-src-$QT.tar.xz
|
||||
EOF
|
||||
|
||||
curl -L \
|
||||
-O "https://libsdl.org/release/$SDL.tar.gz" \
|
||||
-O "https://github.com/ianlancetaylor/libbacktrace/archive/$LIBBACKTRACE.zip" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
|
||||
@@ -73,6 +75,16 @@ cmake --build . --parallel
|
||||
cmake --install .
|
||||
cd ../../
|
||||
|
||||
echo "Building Qt Image Formats..."
|
||||
tar xf "qtimageformats-everywhere-src-$QT.tar.xz"
|
||||
cd "qtimageformats-everywhere-src-$QT"
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
|
||||
cmake --build . --parallel
|
||||
cmake --install .
|
||||
cd ../../
|
||||
|
||||
echo "Building Qt Wayland..."
|
||||
tar xf "qtwayland-everywhere-src-$QT.tar.xz"
|
||||
cd "qtwayland-everywhere-src-$QT"
|
||||
|
||||
24
.github/workflows/scripts/linux/flatpak/modules/10-libpcap.json
vendored
Normal file
24
.github/workflows/scripts/linux/flatpak/modules/10-libpcap.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "libpcap",
|
||||
"buildsystem": "cmake-ninja",
|
||||
"build-options": {
|
||||
"strip": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/the-tcpdump-group/libpcap.git",
|
||||
"tag": "libpcap-1.10.4",
|
||||
"commit": "104271ba4a14de6743e43bcf87536786d8fddea4"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/bin",
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la",
|
||||
"/lib/pkgconfig",
|
||||
"/share/man"
|
||||
]
|
||||
}
|
||||
|
||||
24
.github/workflows/scripts/linux/flatpak/modules/11-libaio.json
vendored
Normal file
24
.github/workflows/scripts/linux/flatpak/modules/11-libaio.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "libaio",
|
||||
"no-autogen": true,
|
||||
"make-install-args": [
|
||||
"prefix=/app"
|
||||
],
|
||||
"build-options": {
|
||||
"strip": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://pagure.io/libaio.git",
|
||||
"tag": "libaio-0.3.113",
|
||||
"commit": "1b18bfafc6a2f7b9fa2c6be77a95afed8b7be448"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la"
|
||||
]
|
||||
}
|
||||
|
||||
45
.github/workflows/scripts/linux/flatpak/modules/20-sdl2.json
vendored
Normal file
45
.github/workflows/scripts/linux/flatpak/modules/20-sdl2.json
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "sdl2",
|
||||
"buildsystem": "autotools",
|
||||
"no-autogen": true,
|
||||
"config-opts": [
|
||||
"--disable-dbus",
|
||||
"--without-x",
|
||||
"--disable-video-opengl",
|
||||
"--disable-video-opengles",
|
||||
"--disable-video-vulkan",
|
||||
"--disable-wayland-shared",
|
||||
"--disable-ime",
|
||||
"--disable-oss",
|
||||
"--disable-alsa",
|
||||
"--disable-jack",
|
||||
"--disable-esd",
|
||||
"--disable-pipewire",
|
||||
"--disable-pulseaudio",
|
||||
"--disable-arts",
|
||||
"--disable-nas",
|
||||
"--disable-sndio",
|
||||
"--disable-fusionsound",
|
||||
"--disable-diskaudio"
|
||||
],
|
||||
"build-options": {
|
||||
"strip": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://libsdl.org/release/SDL2-2.28.1.tar.gz",
|
||||
"sha256": "4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/bin",
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la",
|
||||
"/lib/cmake",
|
||||
"/lib/pkgconfig",
|
||||
"/share/aclocal"
|
||||
]
|
||||
}
|
||||
|
||||
22
.github/workflows/scripts/linux/flatpak/modules/21-libbacktrace.json
vendored
Normal file
22
.github/workflows/scripts/linux/flatpak/modules/21-libbacktrace.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "libbacktrace",
|
||||
"buildsystem": "autotools",
|
||||
"no-autogen": true,
|
||||
"build-options": {
|
||||
"strip": false,
|
||||
"no-debuginfo": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/ianlancetaylor/libbacktrace.git",
|
||||
"commit": "ad106d5fdd5d960bd33fae1c48a351af567fd075"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
"/include",
|
||||
"/lib/*.a",
|
||||
"/lib/*.la"
|
||||
]
|
||||
}
|
||||
|
||||
68
.github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
vendored
Normal file
68
.github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"app-id": "net.pcsx2.PCSX2",
|
||||
"runtime": "org.kde.Platform",
|
||||
"runtime-version": "6.5",
|
||||
"sdk": "org.kde.Sdk",
|
||||
"sdk-extensions": [
|
||||
"org.freedesktop.Sdk.Extension.llvm16"
|
||||
],
|
||||
"add-extensions": {
|
||||
"org.freedesktop.Platform.ffmpeg-full": {
|
||||
"directory": "lib/ffmpeg",
|
||||
"version": "22.08",
|
||||
"add-ld-path": ".",
|
||||
"autodownload": true
|
||||
}
|
||||
},
|
||||
"command": "pcsx2-qt",
|
||||
"finish-args": [
|
||||
"--device=all",
|
||||
"--share=network",
|
||||
"--share=ipc",
|
||||
"--socket=fallback-x11",
|
||||
"--socket=wayland",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=host:ro",
|
||||
"--talk-name=org.freedesktop.ScreenSaver"
|
||||
],
|
||||
"modules": [
|
||||
"modules/10-libpcap.json",
|
||||
"modules/11-libaio.json",
|
||||
"modules/20-sdl2.json",
|
||||
"modules/21-libbacktrace.json",
|
||||
{
|
||||
"name": "pcsx2",
|
||||
"buildsystem": "simple",
|
||||
"build-options": {
|
||||
"strip": false,
|
||||
"no-debuginfo": true,
|
||||
"env": {
|
||||
"DEPS_PREFIX": "/app",
|
||||
"COMPILER": "clang",
|
||||
"CLANG_PATH": "/usr/lib/sdk/llvm16/bin/clang",
|
||||
"CLANGXX_PATH": "/usr/lib/sdk/llvm16/bin/clang++",
|
||||
"ADDITIONAL_CMAKE_ARGS": "-DUSE_LINKED_FFMPEG=ON"
|
||||
}
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"type": "dir",
|
||||
"path": "../../../../.."
|
||||
}
|
||||
],
|
||||
"build-commands": [
|
||||
".github/workflows/scripts/linux/generate-cmake-qt.sh",
|
||||
"cd build && ../.github/workflows/scripts/linux/compile.sh && cd ..",
|
||||
"cp -a build/bin ${FLATPAK_DEST}",
|
||||
"cd build && ninja unittests && cd .."
|
||||
],
|
||||
"post-install": [
|
||||
"install -Dm644 bin/resources/icons/AppIconLarge.png ${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/net.pcsx2.PCSX2.png",
|
||||
"install -Dm644 .github/workflows/scripts/linux/pcsx2-qt.desktop ${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop",
|
||||
"desktop-file-edit --set-key=Icon --set-value=net.pcsx2.PCSX2 ${FLATPAK_DEST}/share/applications/net.pcsx2.PCSX2.desktop",
|
||||
"install -Dm644 .github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.metainfo.xml ${FLATPAK_DEST}/share/metainfo/net.pcsx2.PCSX2.metainfo.xml"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
BIN
.github/workflows/scripts/linux/flatpak/screenshots/screenshot1.png
vendored
Normal file
BIN
.github/workflows/scripts/linux/flatpak/screenshots/screenshot1.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
.github/workflows/scripts/linux/flatpak/screenshots/screenshot2.png
vendored
Normal file
BIN
.github/workflows/scripts/linux/flatpak/screenshots/screenshot2.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -2,16 +2,28 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "${DEPS_PREFIX}" ]]; then
|
||||
echo "DEPS_PREFIX is not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using build dependencies from: ${DEPS_PREFIX}"
|
||||
|
||||
if [ "${COMPILER}" = "clang" ]; then
|
||||
if [[ -z "${CLANG_PATH}" ]] || [[ -z "${CLANGXX_PATH}" ]]; then
|
||||
echo "CLANG_PATH or CLANGXX_PATH is not set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Using clang toolchain"
|
||||
cat > "$HOME/clang-toolchain.cmake" << EOF
|
||||
set(CMAKE_C_COMPILER /usr/bin/clang-12)
|
||||
set(CMAKE_CXX_COMPILER /usr/bin/clang++-12)
|
||||
cat > "clang-toolchain.cmake" << EOF
|
||||
set(CMAKE_C_COMPILER "${CLANG_PATH}")
|
||||
set(CMAKE_CXX_COMPILER "${CLANGXX_PATH}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
||||
EOF
|
||||
ADDITIONAL_CMAKE_ARGS="$ADDITIONAL_CMAKE_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE=$HOME/clang-toolchain.cmake"
|
||||
ADDITIONAL_CMAKE_ARGS="$ADDITIONAL_CMAKE_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE=clang-toolchain.cmake"
|
||||
fi
|
||||
|
||||
echo "Additional CMake Args - ${ADDITIONAL_CMAKE_ARGS}"
|
||||
@@ -31,7 +43,7 @@ cmake \
|
||||
-DX11_API=ON \
|
||||
-DWAYLAND_API=ON \
|
||||
-DENABLE_SETCAP=OFF \
|
||||
-DCMAKE_PREFIX_PATH="$HOME/deps" \
|
||||
-DCMAKE_PREFIX_PATH="${DEPS_PREFIX}" \
|
||||
-DUSE_SYSTEM_SDL2=ON \
|
||||
-DUSE_SYSTEM_ZSTD=OFF \
|
||||
-DDISABLE_ADVANCE_SIMD=TRUE
|
||||
|
||||
32
.github/workflows/scripts/linux/generate-metainfo.sh
vendored
Executable file
32
.github/workflows/scripts/linux/generate-metainfo.sh
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Output file must be provided as a parameter"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OUTFILE=$1
|
||||
GIT_DATE=$(git log -1 --pretty=%cd --date=short)
|
||||
GIT_VERSION=$(git tag --points-at HEAD)
|
||||
GIT_HASH=$(git rev-parse HEAD)
|
||||
|
||||
if [[ "${GIT_VERSION}" == "" ]]; then
|
||||
# In the odd event that we run this script before the release gets tagged.
|
||||
GIT_VERSION=$(git describe --tags)
|
||||
if [[ "${GIT_VERSION}" == "" ]]; then
|
||||
GIT_VERSION=$(git rev-parse HEAD)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "GIT_DATE: ${GIT_DATE}"
|
||||
echo "GIT_VERSION: ${GIT_VERSION}"
|
||||
echo "GIT_HASH: ${GIT_HASH}"
|
||||
|
||||
cp "${SCRIPTDIR}"/pcsx2-qt.metainfo.xml.in "${OUTFILE}"
|
||||
|
||||
sed -i -e "s/@GIT_VERSION@/${GIT_VERSION}/" "${OUTFILE}"
|
||||
sed -i -e "s/@GIT_DATE@/${GIT_DATE}/" "${OUTFILE}"
|
||||
sed -i -e "s/@GIT_HASH@/${GIT_HASH}/" "${OUTFILE}"
|
||||
|
||||
55
.github/workflows/scripts/linux/install-packages-flatpak.sh
vendored
Executable file
55
.github/workflows/scripts/linux/install-packages-flatpak.sh
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
|
||||
source "$SCRIPTDIR/functions.sh"
|
||||
|
||||
set -e
|
||||
|
||||
ARCH=x86_64
|
||||
KDE_BRANCH=6.5
|
||||
BRANCH=22.08
|
||||
FLAT_MANAGER_CLIENT_DIR="$HOME/.local/bin"
|
||||
|
||||
# Build packages. Mostly needed for flat-manager-client.
|
||||
declare -a BUILD_PACKAGES=(
|
||||
"flatpak"
|
||||
"flatpak-builder"
|
||||
"appstream-util"
|
||||
"python3-aiohttp"
|
||||
"python3-tenacity"
|
||||
"python3-gi"
|
||||
"gobject-introspection"
|
||||
"libappstream-glib8"
|
||||
"libappstream-glib-dev"
|
||||
"libappstream-dev"
|
||||
"gir1.2-ostree-1.0"
|
||||
)
|
||||
|
||||
# Flatpak runtimes and SDKs.
|
||||
declare -a FLATPAK_PACKAGES=(
|
||||
"org.kde.Platform/${ARCH}/${KDE_BRANCH}"
|
||||
"org.kde.Sdk/${ARCH}/${KDE_BRANCH}"
|
||||
"org.freedesktop.Platform.ffmpeg-full/${ARCH}/${BRANCH}"
|
||||
"org.freedesktop.Sdk.Extension.llvm16/${ARCH}/${BRANCH}"
|
||||
"org.freedesktop.appstream-glib/${ARCH}/stable"
|
||||
)
|
||||
|
||||
retry_command sudo apt-get -qq update
|
||||
|
||||
# Install packages needed for building
|
||||
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
|
||||
retry_command sudo apt-get -y install "${BUILD_PACKAGES[@]}"
|
||||
|
||||
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
||||
# Install packages needed for building
|
||||
echo "Will install the following packages for building - ${FLATPAK_PACKAGES[*]}"
|
||||
retry_command sudo flatpak -y install "${FLATPAK_PACKAGES[@]}"
|
||||
|
||||
echo "Downloading flat-manager-client"
|
||||
mkdir -p "$FLAT_MANAGER_CLIENT_DIR"
|
||||
pushd "$FLAT_MANAGER_CLIENT_DIR"
|
||||
aria2c -Z "https://raw.githubusercontent.com/flatpak/flat-manager/9401efbdc0d6bd489507d8401c567ba219d735d5/flat-manager-client"
|
||||
chmod +x flat-manager-client
|
||||
echo "$FLAT_MANAGER_CLIENT_DIR" >> $GITHUB_PATH
|
||||
popd
|
||||
@@ -8,14 +8,13 @@ set -e
|
||||
# Packages - Build and Qt
|
||||
declare -a BUILD_PACKAGES=(
|
||||
"build-essential"
|
||||
"g++"
|
||||
"git"
|
||||
"cmake"
|
||||
"ccache"
|
||||
"ninja-build"
|
||||
"libclang-dev" # Qt goes hunting for libclang-11 specifically.
|
||||
"libclang-11-dev"
|
||||
"libclang-12-dev"
|
||||
"patchelf"
|
||||
"libfuse2"
|
||||
"libglib2.0-dev"
|
||||
"libfontconfig1-dev"
|
||||
"libharfbuzz-dev"
|
||||
@@ -37,6 +36,7 @@ declare -a BUILD_PACKAGES=(
|
||||
|
||||
# Packages - PCSX2
|
||||
declare -a PCSX2_PACKAGES=(
|
||||
"extra-cmake-modules"
|
||||
"libaio-dev"
|
||||
"libasound2-dev"
|
||||
"libbz2-dev"
|
||||
@@ -52,17 +52,23 @@ declare -a PCSX2_PACKAGES=(
|
||||
"libpulse-dev"
|
||||
"librsvg2-dev"
|
||||
"libsamplerate0-dev"
|
||||
"libsoundtouch-dev"
|
||||
"libudev-dev"
|
||||
"libx11-xcb-dev"
|
||||
"libavcodec-dev"
|
||||
"libavformat-dev"
|
||||
"libavutil-dev"
|
||||
"libswresample-dev"
|
||||
"libswscale-dev"
|
||||
"pkg-config"
|
||||
"zlib1g-dev"
|
||||
)
|
||||
|
||||
if [ "${COMPILER}" = "gcc" ]; then
|
||||
BUILD_PACKAGES+=("g++-10")
|
||||
else
|
||||
BUILD_PACKAGES+=("llvm-12" "lld-12" "clang-12")
|
||||
if [ "${COMPILER}" = "clang" ]; then
|
||||
BUILD_PACKAGES+=("llvm-16" "lld-16" "clang-16")
|
||||
|
||||
# Ubuntu 22.04 doesn't ship with LLVM 16, so we need to pull it from the llvm.org repos.
|
||||
retry_command wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo apt-add-repository -n 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
|
||||
fi
|
||||
|
||||
retry_command sudo apt-get -qq update && break
|
||||
|
||||
37
.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in
vendored
Normal file
37
.github/workflows/scripts/linux/pcsx2-qt.metainfo.xml.in
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>net.pcsx2.PCSX2</id>
|
||||
<launchable type="desktop-id">net.pcsx2.PCSX2.desktop</launchable>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0</project_license>
|
||||
<name>PCSX2</name>
|
||||
<developer_name>PCSX2</developer_name>
|
||||
<summary>PlayStation 2 Emulator</summary>
|
||||
<description>
|
||||
<p>PCSX2 is a free and open-source PlayStation 2 (PS2) emulator. Its purpose is to emulate the PS2's hardware, using a combination of MIPS CPU Interpreters, Recompilers and a Virtual Machine which manages hardware states and PS2 system memory. This allows you to play PS2 games on your PC, with many additional features and benefits.</p>
|
||||
<p>PlayStation 2 and PS2 are registered trademarks of Sony Interactive Entertainment. This application is not affiliated in any way with Sony Interactive Entertainment.</p>
|
||||
</description>
|
||||
<url type="homepage">https://pcsx2.net/</url>
|
||||
<url type="bugtracker">https://github.com/PCSX2/pcsx2/issues</url>
|
||||
<url type="donation">https://github.com/sponsors/PCSX2</url>
|
||||
<url type="faq">https://pcsx2.net/docs/</url>
|
||||
<url type="help">https://discord.com/invite/TCz3t9k</url>
|
||||
<url type="translate">https://crowdin.com/project/pcsx2-emulator</url>
|
||||
<url type="vcs-browser">https://github.com/PCSX2/pcsx2</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot1.png</image>
|
||||
</screenshot>
|
||||
<screenshot>
|
||||
<image>https://raw.githubusercontent.com/PCSX2/pcsx2/master/.github/workflows/scripts/linux/flatpak/screenshots/screenshot2.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1"/>
|
||||
<update_contact>stenzek_AT_gmail.com</update_contact>
|
||||
<releases>
|
||||
<release version="@GIT_VERSION@" date="@GIT_DATE@" />
|
||||
</releases>
|
||||
<custom>
|
||||
<value key="flathub::manifest">https://raw.githubusercontent.com/PCSX2/pcsx2/@GIT_HASH@/.github/workflows/scripts/linux/flatpak/net.pcsx2.PCSX2.json</value>
|
||||
</custom>
|
||||
</component>
|
||||
@@ -6,11 +6,12 @@ export MACOSX_DEPLOYMENT_TARGET=10.14
|
||||
|
||||
INSTALLDIR="$HOME/deps"
|
||||
NPROCS="$(getconf _NPROCESSORS_ONLN)"
|
||||
SDL=SDL2-2.26.5
|
||||
SDL=SDL2-2.28.1
|
||||
PNG=1.6.37
|
||||
JPG=9e
|
||||
SOUNDTOUCH=soundtouch-2.3.1
|
||||
QT=6.4.3
|
||||
FFMPEG=6.0
|
||||
QT=6.4.3 # Currently stuck on Qt 6.4 due to 6.5 requiring macOS 11.0.
|
||||
|
||||
mkdir deps-build
|
||||
cd deps-build
|
||||
@@ -21,11 +22,13 @@ export CFLAGS="-I$INSTALLDIR/include -Os $CFLAGS"
|
||||
export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS"
|
||||
|
||||
cat > SHASUMS <<EOF
|
||||
ad8fea3da1be64c83c45b1d363a6b4ba8fd60f5bde3b23ec73855709ec5eabf7 $SDL.tar.gz
|
||||
4977ceba5c0054dbe6c2f114641aced43ce3bf2b41ea64b6a372d6ba129cb15d $SDL.tar.gz
|
||||
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca libpng-$PNG.tar.xz
|
||||
4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d jpegsrc.v$JPG.tar.gz
|
||||
6900996607258496ce126924a19fe9d598af9d892cf3f33d1e4daaa9b42ae0b1 $SOUNDTOUCH.tar.gz
|
||||
57be87c22d9b49c112b6d24bc67d42508660e6b718b3db89c44e47e289137082 ffmpeg-$FFMPEG.tar.xz
|
||||
5087c9e5b0165e7bc3c1a4ab176b35d0cd8f52636aea903fa377bdba00891a60 qtbase-everywhere-src-$QT.tar.xz
|
||||
0aff58062e74b84617c5da8325d8cdad5368d8f4d2a11ceafcd58329fe99b798 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
88315f886cf81898705e487cedba6e6160724359d23c518c92c333c098879a4a qtsvg-everywhere-src-$QT.tar.xz
|
||||
867df829cd5cd3ae8efe62e825503123542764b13c96953511e567df70c5a091 qttools-everywhere-src-$QT.tar.xz
|
||||
79e56b7800d49649a8a8010818538c367a829e0b7a09d5f60bd3aecf5abe972c qttranslations-everywhere-src-$QT.tar.xz
|
||||
@@ -36,7 +39,9 @@ curl -L \
|
||||
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$PNG/libpng-$PNG.tar.xz" \
|
||||
-O "https://www.ijg.org/files/jpegsrc.v$JPG.tar.gz" \
|
||||
-O "https://www.surina.net/soundtouch/$SOUNDTOUCH.tar.gz" \
|
||||
-O "https://ffmpeg.org/releases/ffmpeg-$FFMPEG.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtimageformats-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
|
||||
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
|
||||
@@ -75,10 +80,106 @@ make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
|
||||
echo "Installing FFmpeg..."
|
||||
tar xf "ffmpeg-$FFMPEG.tar.xz"
|
||||
cd "ffmpeg-$FFMPEG"
|
||||
./configure --prefix="$INSTALLDIR" --disable-all --disable-autodetect --disable-static --enable-shared \
|
||||
--enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale \
|
||||
--enable-audiotoolbox --enable-videotoolbox \
|
||||
--enable-encoder=ffv1,qtrle,pcm_s16be,pcm_s16le,*_at,*_videotoolbox \
|
||||
--enable-muxer=avi,matroska,mov,mp3,mp4,wav \
|
||||
--enable-protocol=file
|
||||
make "-j$NPROCS"
|
||||
make install
|
||||
cd ..
|
||||
|
||||
echo "Installing Qt Base..."
|
||||
tar xf "qtbase-everywhere-src-$QT.tar.xz"
|
||||
cd "qtbase-everywhere-src-$QT"
|
||||
# Qt's panel:shouldEnableURL: implementation does a whole bunch of things that activate macOS's sandbox permissions dialog
|
||||
# Since this is called on every file being displayed in the open/save panel, that spams users with permissions dialogs
|
||||
# Simple solution: Hopefully no one needs any filters that aren't simple file extension filters, remove all other handling
|
||||
patch -u src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm <<EOF
|
||||
--- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
|
||||
+++ src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
|
||||
@@ -133,7 +133,5 @@
|
||||
NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()];
|
||||
- bool selectable = (m_options->acceptMode() == QFileDialogOptions::AcceptSave)
|
||||
- || [self panel:m_panel shouldEnableURL:url];
|
||||
|
||||
m_panel.directoryURL = [NSURL fileURLWithPath:m_currentDirectory];
|
||||
- m_panel.nameFieldStringValue = selectable ? info.fileName().toNSString() : @"";
|
||||
+ m_panel.nameFieldStringValue = info.fileName().toNSString();
|
||||
|
||||
@@ -203,61 +201,2 @@
|
||||
return hidden;
|
||||
-}
|
||||
-
|
||||
-- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url
|
||||
-{
|
||||
- Q_UNUSED(sender);
|
||||
-
|
||||
- NSString *filename = url.path;
|
||||
- if (!filename.length)
|
||||
- return NO;
|
||||
-
|
||||
- // Always accept directories regardless of their names (unless it is a bundle):
|
||||
- NSFileManager *fm = NSFileManager.defaultManager;
|
||||
- NSDictionary *fileAttrs = [fm attributesOfItemAtPath:filename error:nil];
|
||||
- if (!fileAttrs)
|
||||
- return NO; // Error accessing the file means 'no'.
|
||||
- NSString *fileType = fileAttrs.fileType;
|
||||
- bool isDir = [fileType isEqualToString:NSFileTypeDirectory];
|
||||
- if (isDir) {
|
||||
- if (!m_panel.treatsFilePackagesAsDirectories) {
|
||||
- if ([NSWorkspace.sharedWorkspace isFilePackageAtPath:filename] == NO)
|
||||
- return YES;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- // Treat symbolic links and aliases to directories like directories
|
||||
- QFileInfo fileInfo(QString::fromNSString(filename));
|
||||
- if (fileInfo.isSymLink() && QFileInfo(fileInfo.symLinkTarget()).isDir())
|
||||
- return YES;
|
||||
-
|
||||
- QString qtFileName = fileInfo.fileName();
|
||||
- // No filter means accept everything
|
||||
- bool nameMatches = m_selectedNameFilter->isEmpty();
|
||||
- // Check if the current file name filter accepts the file:
|
||||
- for (int i = 0; !nameMatches && i < m_selectedNameFilter->size(); ++i) {
|
||||
- if (QDir::match(m_selectedNameFilter->at(i), qtFileName))
|
||||
- nameMatches = true;
|
||||
- }
|
||||
- if (!nameMatches)
|
||||
- return NO;
|
||||
-
|
||||
- QDir::Filters filter = m_options->filter();
|
||||
- if ((!(filter & (QDir::Dirs | QDir::AllDirs)) && isDir)
|
||||
- || (!(filter & QDir::Files) && [fileType isEqualToString:NSFileTypeRegular])
|
||||
- || ((filter & QDir::NoSymLinks) && [fileType isEqualToString:NSFileTypeSymbolicLink]))
|
||||
- return NO;
|
||||
-
|
||||
- bool filterPermissions = ((filter & QDir::PermissionMask)
|
||||
- && (filter & QDir::PermissionMask) != QDir::PermissionMask);
|
||||
- if (filterPermissions) {
|
||||
- if ((!(filter & QDir::Readable) && [fm isReadableFileAtPath:filename])
|
||||
- || (!(filter & QDir::Writable) && [fm isWritableFileAtPath:filename])
|
||||
- || (!(filter & QDir::Executable) && [fm isExecutableFileAtPath:filename]))
|
||||
- return NO;
|
||||
- }
|
||||
- if (!(filter & QDir::Hidden)
|
||||
- && (qtFileName.startsWith(u'.') || [self isHiddenFileAtURL:url]))
|
||||
- return NO;
|
||||
-
|
||||
- return YES;
|
||||
}
|
||||
@@ -406,5 +345,2 @@
|
||||
{
|
||||
- if (m_options->acceptMode() != QFileDialogOptions::AcceptSave)
|
||||
- return nil; // panel:shouldEnableURL: does the file filtering for NSOpenPanel
|
||||
-
|
||||
QStringList fileTypes;
|
||||
EOF
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_optimize_size=ON -DFEATURE_dbus=OFF -DFEATURE_framework=OFF -DFEATURE_icu=OFF -DFEATURE_opengl=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF -DFEATURE_gssapi=OFF
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
@@ -90,6 +191,13 @@ cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTAL
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
echo "Installing Qt Image Formats..."
|
||||
tar xf "qtimageformats-everywhere-src-$QT.tar.xz"
|
||||
cd "qtimageformats-everywhere-src-$QT"
|
||||
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
|
||||
make -C build "-j$NPROCS"
|
||||
make -C build install
|
||||
cd ..
|
||||
echo "Installing Qt Tools..."
|
||||
tar xf "qttools-everywhere-src-$QT.tar.xz"
|
||||
cd "qttools-everywhere-src-$QT"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
tag = os.environ['TAG'].split("refs/tags/")[1]
|
||||
tag = os.environ['TAG_VAL']
|
||||
scan_dir = os.environ['SCAN_DIR']
|
||||
output_dir = os.environ['OUT_DIR']
|
||||
accepted_exts = ["AppImage", "tar.xz", "7z"]
|
||||
accepted_exts = ["AppImage", "flatpak", "tar.xz", "7z"]
|
||||
|
||||
|
||||
for dir_name in os.listdir(scan_dir):
|
||||
@@ -12,9 +12,12 @@ for dir_name in os.listdir(scan_dir):
|
||||
if "macos" in dir_name.lower():
|
||||
asset_name += "-macos"
|
||||
elif "linux" in dir_name.lower():
|
||||
asset_name += "-linux-AppImage-64bit"
|
||||
if "flatpak" in dir_name.lower():
|
||||
asset_name += "-linux-flatpak-x64"
|
||||
else:
|
||||
asset_name += "-linux-appimage-x64"
|
||||
elif "windows" in dir_name.lower():
|
||||
asset_name += "-windows-64bit"
|
||||
asset_name += "-windows-x64"
|
||||
else:
|
||||
continue;
|
||||
|
||||
|
||||
23
.github/workflows/windows_build_matrix.yml
vendored
23
.github/workflows/windows_build_matrix.yml
vendored
@@ -2,8 +2,8 @@ name: 🖥️ Windows Builds
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
branches-ignore:
|
||||
- "l10n_master"
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
@@ -12,6 +12,7 @@ jobs:
|
||||
# MSBUILD
|
||||
lint_vs_proj_files:
|
||||
name: Lint VS Project Files
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
@@ -22,9 +23,10 @@ jobs:
|
||||
build_qt_sse4:
|
||||
needs: lint_vs_proj_files
|
||||
name: "SSE4"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt
|
||||
jobName: "MSVC SSE4"
|
||||
configuration: Release
|
||||
simd: "SSE4"
|
||||
secrets: inherit
|
||||
@@ -32,17 +34,19 @@ jobs:
|
||||
build_qt_avx2:
|
||||
needs: lint_vs_proj_files
|
||||
name: "AVX2"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt
|
||||
jobName: "MSVC AVX2"
|
||||
configuration: Release AVX2
|
||||
secrets: inherit
|
||||
|
||||
build_qt_cmake:
|
||||
name: "CMake"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt
|
||||
jobName: "CMake MSVC"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
secrets: inherit
|
||||
@@ -50,9 +54,10 @@ jobs:
|
||||
build_qt_clang_sse4:
|
||||
needs: lint_vs_proj_files
|
||||
name: "SSE4"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt Clang
|
||||
jobName: "Clang SSE4"
|
||||
configuration: Release Clang
|
||||
simd: "SSE4"
|
||||
secrets: inherit
|
||||
@@ -60,17 +65,19 @@ jobs:
|
||||
build_qt_clang_avx2:
|
||||
needs: lint_vs_proj_files
|
||||
name: "AVX2"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt Clang
|
||||
jobName: "Clang AVX2"
|
||||
configuration: Release Clang AVX2
|
||||
secrets: inherit
|
||||
|
||||
build_qt_cmake_clang:
|
||||
name: "CMake"
|
||||
if: github.repository != 'PCSX2/pcsx2' || github.event_name == 'pull_request'
|
||||
uses: ./.github/workflows/windows_build_qt.yml
|
||||
with:
|
||||
jobName: Qt Clang
|
||||
jobName: "CMake Clang"
|
||||
configuration: CMake
|
||||
buildSystem: cmake
|
||||
cmakeFlags: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DPCSX2_EXE_NAME=pcsx2-qt-clang
|
||||
|
||||
16
.github/workflows/windows_build_qt.yml
vendored
16
.github/workflows/windows_build_qt.yml
vendored
@@ -37,10 +37,14 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
default: 3rdparty\qt\6.5.0\msvc2022_64
|
||||
cheats_url:
|
||||
patchesUrl:
|
||||
required: false
|
||||
type: string
|
||||
default: https://github.com/PCSX2/pcsx2_patches/releases/latest/download
|
||||
fetchTags:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
build_windows_qt:
|
||||
@@ -57,13 +61,17 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
# actions/checkout elides tags, fetch them primarily for releases
|
||||
- name: Fetch Tags
|
||||
if: ${{ inputs.fetchTags }}
|
||||
run: git fetch --tags --no-recurse-submodules
|
||||
|
||||
- name: Prepare Artifact Metadata
|
||||
id: artifact-metadata
|
||||
shell: bash
|
||||
env:
|
||||
OS: windows
|
||||
BUILD_SYSTEM: ${{ inputs.buildSystem }}
|
||||
GUI_FRAMEWORK: Qt
|
||||
ARCH: ${{ inputs.platform }}
|
||||
SIMD: ${{ inputs.simd }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
@@ -84,11 +92,11 @@ jobs:
|
||||
7z x qt-*-x64.7z
|
||||
del qt-*-x64.7z
|
||||
|
||||
- name: Download cheats
|
||||
- name: Download patches
|
||||
shell: cmd
|
||||
run: |
|
||||
cd bin/resources
|
||||
aria2c -Z "${{ inputs.cheats_url }}/cheats_ni.zip" "${{ inputs.cheats_url }}/cheats_ws.zip"
|
||||
aria2c -Z "${{ inputs.patchesUrl }}/patches.zip"
|
||||
|
||||
- name: Generate CMake
|
||||
if: inputs.configuration == 'CMake'
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -90,8 +90,6 @@ oprofile_data/
|
||||
/ipch
|
||||
|
||||
!/3rdparty/libjpeg/change.log
|
||||
/pcsx2/gui/Resources/*.h
|
||||
!/pcsx2/gui/Resources/EmbeddedImage.h
|
||||
/tools/bin
|
||||
.vs
|
||||
|
||||
|
||||
3
3rdparty/3rdparty.props
vendored
3
3rdparty/3rdparty.props
vendored
@@ -9,9 +9,10 @@
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>__WIN32__;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RuntimeTypeInfo>false</RuntimeTypeInfo>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<WarningLevel>TurnOffAllWarnings</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
|
||||
20
3rdparty/demangler/src/gparser.cpp
vendored
20
3rdparty/demangler/src/gparser.cpp
vendored
@@ -4764,23 +4764,9 @@ void cGram::demangleClassName(const std::string& input, cName* retvalue, cGram::
|
||||
std::string sLength = match[1];
|
||||
std::string name = match[2];
|
||||
|
||||
unsigned long length = 0;
|
||||
|
||||
bool ok = true;
|
||||
try {
|
||||
length = std::stoul(sLength);
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
ok = false;
|
||||
}
|
||||
catch (const std::out_of_range&) {
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
if (name.length() == length) {
|
||||
className = name;
|
||||
}
|
||||
unsigned long length = std::stoul(sLength);
|
||||
if (name.length() == length) {
|
||||
className = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
3rdparty/ffmpeg/headers-version.txt
vendored
2
3rdparty/ffmpeg/headers-version.txt
vendored
@@ -1 +1 @@
|
||||
ffmpeg-4.4.3 from https://ffmpeg.org/releases/ffmpeg-4.4.3.tar.xz
|
||||
ffmpeg-6.0.0 from https://ffmpeg.org/releases/ffmpeg-6.0.tar.xz
|
||||
|
||||
1458
3rdparty/ffmpeg/include/libavcodec/avcodec.h
vendored
1458
3rdparty/ffmpeg/include/libavcodec/avcodec.h
vendored
File diff suppressed because it is too large
Load Diff
73
3rdparty/ffmpeg/include/libavcodec/bsf.h
vendored
73
3rdparty/ffmpeg/include/libavcodec/bsf.h
vendored
@@ -30,12 +30,31 @@
|
||||
#include "packet.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @defgroup lavc_bsf Bitstream filters
|
||||
* @ingroup libavc
|
||||
*
|
||||
* Bitstream filters transform encoded media data without decoding it. This
|
||||
* allows e.g. manipulating various header values. Bitstream filters operate on
|
||||
* @ref AVPacket "AVPackets".
|
||||
*
|
||||
* The bitstream filtering API is centered around two structures:
|
||||
* AVBitStreamFilter and AVBSFContext. The former represents a bitstream filter
|
||||
* in abstract, the latter a specific filtering process. Obtain an
|
||||
* AVBitStreamFilter using av_bsf_get_by_name() or av_bsf_iterate(), then pass
|
||||
* it to av_bsf_alloc() to create an AVBSFContext. Fill in the user-settable
|
||||
* AVBSFContext fields, as described in its documentation, then call
|
||||
* av_bsf_init() to prepare the filter context for use.
|
||||
*
|
||||
* Submit packets for filtering using av_bsf_send_packet(), obtain filtered
|
||||
* results with av_bsf_receive_packet(). When no more input packets will be
|
||||
* sent, submit a NULL AVPacket to signal the end of the stream to the filter.
|
||||
* av_bsf_receive_packet() will then return trailing packets, if any are
|
||||
* produced by the filter.
|
||||
*
|
||||
* Finally, free the filter context with av_bsf_free().
|
||||
* @{
|
||||
*/
|
||||
|
||||
typedef struct AVBSFInternal AVBSFInternal;
|
||||
|
||||
/**
|
||||
* The bitstream filter state.
|
||||
*
|
||||
@@ -57,12 +76,6 @@ typedef struct AVBSFContext {
|
||||
*/
|
||||
const struct AVBitStreamFilter *filter;
|
||||
|
||||
/**
|
||||
* Opaque libavcodec internal data. Must not be touched by the caller in any
|
||||
* way.
|
||||
*/
|
||||
AVBSFInternal *internal;
|
||||
|
||||
/**
|
||||
* Opaque filter-specific private data. If filter->priv_class is non-NULL,
|
||||
* this is an AVOptions-enabled struct.
|
||||
@@ -115,20 +128,6 @@ typedef struct AVBitStreamFilter {
|
||||
* code to this class.
|
||||
*/
|
||||
const AVClass *priv_class;
|
||||
|
||||
/*****************************************************************
|
||||
* No fields below this line are part of the public API. They
|
||||
* may not be used outside of libavcodec and can be changed and
|
||||
* removed at will.
|
||||
* New public fields should be added right above.
|
||||
*****************************************************************
|
||||
*/
|
||||
|
||||
int priv_data_size;
|
||||
int (*init)(AVBSFContext *ctx);
|
||||
int (*filter)(AVBSFContext *ctx, AVPacket *pkt);
|
||||
void (*close)(AVBSFContext *ctx);
|
||||
void (*flush)(AVBSFContext *ctx);
|
||||
} AVBitStreamFilter;
|
||||
|
||||
/**
|
||||
@@ -154,9 +153,9 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque);
|
||||
* av_bsf_init() before sending any data to the filter.
|
||||
*
|
||||
* @param filter the filter for which to allocate an instance.
|
||||
* @param ctx a pointer into which the pointer to the newly-allocated context
|
||||
* will be written. It must be freed with av_bsf_free() after the
|
||||
* filtering is done.
|
||||
* @param[out] ctx a pointer into which the pointer to the newly-allocated context
|
||||
* will be written. It must be freed with av_bsf_free() after the
|
||||
* filtering is done.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR code on failure
|
||||
*/
|
||||
@@ -165,6 +164,8 @@ int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx);
|
||||
/**
|
||||
* Prepare the filter for use, after all the parameters and options have been
|
||||
* set.
|
||||
*
|
||||
* @param ctx a AVBSFContext previously allocated with av_bsf_alloc()
|
||||
*/
|
||||
int av_bsf_init(AVBSFContext *ctx);
|
||||
|
||||
@@ -175,6 +176,7 @@ int av_bsf_init(AVBSFContext *ctx);
|
||||
* av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or
|
||||
* AVERROR_EOF.
|
||||
*
|
||||
* @param ctx an initialized AVBSFContext
|
||||
* @param pkt the packet to filter. The bitstream filter will take ownership of
|
||||
* the packet and reset the contents of pkt. pkt is not touched if an error occurs.
|
||||
* If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero),
|
||||
@@ -182,15 +184,18 @@ int av_bsf_init(AVBSFContext *ctx);
|
||||
* sending more empty packets does nothing) and will cause the filter to output
|
||||
* any packets it may have buffered internally.
|
||||
*
|
||||
* @return 0 on success. AVERROR(EAGAIN) if packets need to be retrieved from the
|
||||
* filter (using av_bsf_receive_packet()) before new input can be consumed. Another
|
||||
* negative AVERROR value if an error occurs.
|
||||
* @return
|
||||
* - 0 on success.
|
||||
* - AVERROR(EAGAIN) if packets need to be retrieved from the filter (using
|
||||
* av_bsf_receive_packet()) before new input can be consumed.
|
||||
* - Another negative AVERROR value if an error occurs.
|
||||
*/
|
||||
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
|
||||
|
||||
/**
|
||||
* Retrieve a filtered packet.
|
||||
*
|
||||
* @param ctx an initialized AVBSFContext
|
||||
* @param[out] pkt this struct will be filled with the contents of the filtered
|
||||
* packet. It is owned by the caller and must be freed using
|
||||
* av_packet_unref() when it is no longer needed.
|
||||
@@ -201,10 +206,12 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt);
|
||||
* overwritten by the returned data. On failure, pkt is not
|
||||
* touched.
|
||||
*
|
||||
* @return 0 on success. AVERROR(EAGAIN) if more packets need to be sent to the
|
||||
* filter (using av_bsf_send_packet()) to get more output. AVERROR_EOF if there
|
||||
* will be no further output from the filter. Another negative AVERROR value if
|
||||
* an error occurs.
|
||||
* @return
|
||||
* - 0 on success.
|
||||
* - AVERROR(EAGAIN) if more packets need to be sent to the filter (using
|
||||
* av_bsf_send_packet()) to get more output.
|
||||
* - AVERROR_EOF if there will be no further output from the filter.
|
||||
* - Another negative AVERROR value if an error occurs.
|
||||
*
|
||||
* @note one input packet may result in several output packets, so after sending
|
||||
* a packet with av_bsf_send_packet(), this function needs to be called
|
||||
|
||||
173
3rdparty/ffmpeg/include/libavcodec/codec.h
vendored
173
3rdparty/ffmpeg/include/libavcodec/codec.h
vendored
@@ -31,7 +31,7 @@
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#include "libavcodec/codec_id.h"
|
||||
#include "libavcodec/version.h"
|
||||
#include "libavcodec/version_major.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
@@ -50,7 +50,6 @@
|
||||
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
|
||||
*/
|
||||
#define AV_CODEC_CAP_DR1 (1 << 1)
|
||||
#define AV_CODEC_CAP_TRUNCATED (1 << 3)
|
||||
/**
|
||||
* Encoder or decoder requires flushing with NULL input at the end in order to
|
||||
* give the complete and correct output.
|
||||
@@ -120,9 +119,6 @@
|
||||
* multithreading-capable external libraries.
|
||||
*/
|
||||
#define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
|
||||
#if FF_API_AUTO_THREADS
|
||||
#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS
|
||||
#endif
|
||||
/**
|
||||
* Audio encoder supports receiving a different number of samples in each call.
|
||||
*/
|
||||
@@ -138,17 +134,6 @@
|
||||
*/
|
||||
#define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
|
||||
|
||||
#if FF_API_UNUSED_CODEC_CAPS
|
||||
/**
|
||||
* Deprecated and unused. Use AVCodecDescriptor.props instead
|
||||
*/
|
||||
#define AV_CODEC_CAP_INTRA_ONLY 0x40000000
|
||||
/**
|
||||
* Deprecated and unused. Use AVCodecDescriptor.props instead
|
||||
*/
|
||||
#define AV_CODEC_CAP_LOSSLESS 0x80000000
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Codec is backed by a hardware implementation. Typically used to
|
||||
* identify a non-hwaccel hardware decoder. For information about hwaccels, use
|
||||
@@ -164,9 +149,9 @@
|
||||
#define AV_CODEC_CAP_HYBRID (1 << 19)
|
||||
|
||||
/**
|
||||
* This codec takes the reordered_opaque field from input AVFrames
|
||||
* and returns it in the corresponding field in AVCodecContext after
|
||||
* encoding.
|
||||
* This encoder can reorder user opaque values from input AVFrames and return
|
||||
* them with corresponding output packets.
|
||||
* @see AV_CODEC_FLAG_COPY_OPAQUE
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
|
||||
|
||||
@@ -177,6 +162,14 @@
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
|
||||
|
||||
/**
|
||||
* The encoder is able to output reconstructed frame data, i.e. raw frames that
|
||||
* would be produced by decoding the encoded bitstream.
|
||||
*
|
||||
* Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag.
|
||||
*/
|
||||
#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22)
|
||||
|
||||
/**
|
||||
* AVProfile.
|
||||
*/
|
||||
@@ -185,12 +178,6 @@ typedef struct AVProfile {
|
||||
const char *name; ///< short name for the profile
|
||||
} AVProfile;
|
||||
|
||||
typedef struct AVCodecDefault AVCodecDefault;
|
||||
|
||||
struct AVCodecContext;
|
||||
struct AVSubtitle;
|
||||
struct AVPacket;
|
||||
|
||||
/**
|
||||
* AVCodec.
|
||||
*/
|
||||
@@ -214,12 +201,18 @@ typedef struct AVCodec {
|
||||
* see AV_CODEC_CAP_*
|
||||
*/
|
||||
int capabilities;
|
||||
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
|
||||
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
|
||||
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
|
||||
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
|
||||
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* @deprecated use ch_layouts instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
|
||||
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
|
||||
#endif
|
||||
const AVClass *priv_class; ///< AVClass for the private context
|
||||
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
|
||||
|
||||
@@ -235,117 +228,10 @@ typedef struct AVCodec {
|
||||
*/
|
||||
const char *wrapper_name;
|
||||
|
||||
/*****************************************************************
|
||||
* No fields below this line are part of the public API. They
|
||||
* may not be used outside of libavcodec and can be changed and
|
||||
* removed at will.
|
||||
* New public fields should be added right above.
|
||||
*****************************************************************
|
||||
*/
|
||||
int priv_data_size;
|
||||
#if FF_API_NEXT
|
||||
struct AVCodec *next;
|
||||
#endif
|
||||
/**
|
||||
* @name Frame-level threading support functions
|
||||
* @{
|
||||
* Array of supported channel layouts, terminated with a zeroed layout.
|
||||
*/
|
||||
/**
|
||||
* Copy necessary context variables from a previous thread context to the current one.
|
||||
* If not defined, the next thread will start automatically; otherwise, the codec
|
||||
* must call ff_thread_finish_setup().
|
||||
*
|
||||
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
|
||||
*/
|
||||
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Private codec-specific defaults.
|
||||
*/
|
||||
const AVCodecDefault *defaults;
|
||||
|
||||
/**
|
||||
* Initialize codec static data, called from av_codec_iterate().
|
||||
*
|
||||
* This is not intended for time consuming operations as it is
|
||||
* run for every codec regardless of that codec being used.
|
||||
*/
|
||||
void (*init_static_data)(struct AVCodec *codec);
|
||||
|
||||
int (*init)(struct AVCodecContext *);
|
||||
int (*encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size,
|
||||
const struct AVSubtitle *sub);
|
||||
/**
|
||||
* Encode data to an AVPacket.
|
||||
*
|
||||
* @param avctx codec context
|
||||
* @param avpkt output AVPacket
|
||||
* @param[in] frame AVFrame containing the raw data to be encoded
|
||||
* @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
|
||||
* non-empty packet was returned in avpkt.
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
int (*encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt,
|
||||
const struct AVFrame *frame, int *got_packet_ptr);
|
||||
/**
|
||||
* Decode picture or subtitle data.
|
||||
*
|
||||
* @param avctx codec context
|
||||
* @param outdata codec type dependent output struct
|
||||
* @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a
|
||||
* non-empty frame or subtitle was returned in
|
||||
* outdata.
|
||||
* @param[in] avpkt AVPacket containing the data to be decoded
|
||||
* @return amount of bytes read from the packet on success, negative error
|
||||
* code on failure
|
||||
*/
|
||||
int (*decode)(struct AVCodecContext *avctx, void *outdata,
|
||||
int *got_frame_ptr, struct AVPacket *avpkt);
|
||||
int (*close)(struct AVCodecContext *);
|
||||
/**
|
||||
* Encode API with decoupled frame/packet dataflow. This function is called
|
||||
* to get one output packet. It should call ff_encode_get_frame() to obtain
|
||||
* input data.
|
||||
*/
|
||||
int (*receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt);
|
||||
|
||||
/**
|
||||
* Decode API with decoupled packet/frame dataflow. This function is called
|
||||
* to get one output frame. It should call ff_decode_get_packet() to obtain
|
||||
* input data.
|
||||
*/
|
||||
int (*receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame);
|
||||
/**
|
||||
* Flush buffers.
|
||||
* Will be called when seeking
|
||||
*/
|
||||
void (*flush)(struct AVCodecContext *);
|
||||
/**
|
||||
* Internal codec capabilities.
|
||||
* See FF_CODEC_CAP_* in internal.h
|
||||
*/
|
||||
int caps_internal;
|
||||
|
||||
/**
|
||||
* Decoding only, a comma-separated list of bitstream filters to apply to
|
||||
* packets before decoding.
|
||||
*/
|
||||
const char *bsfs;
|
||||
|
||||
/**
|
||||
* Array of pointers to hardware configurations supported by the codec,
|
||||
* or NULL if no hardware supported. The array is terminated by a NULL
|
||||
* pointer.
|
||||
*
|
||||
* The user can only access this field via avcodec_get_hw_config().
|
||||
*/
|
||||
const struct AVCodecHWConfigInternal *const *hw_configs;
|
||||
|
||||
/**
|
||||
* List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
|
||||
*/
|
||||
const uint32_t *codec_tags;
|
||||
const AVChannelLayout *ch_layouts;
|
||||
} AVCodec;
|
||||
|
||||
/**
|
||||
@@ -365,7 +251,7 @@ const AVCodec *av_codec_iterate(void **opaque);
|
||||
* @param id AVCodecID of the requested decoder
|
||||
* @return A decoder if one was found, NULL otherwise.
|
||||
*/
|
||||
AVCodec *avcodec_find_decoder(enum AVCodecID id);
|
||||
const AVCodec *avcodec_find_decoder(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Find a registered decoder with the specified name.
|
||||
@@ -373,7 +259,7 @@ AVCodec *avcodec_find_decoder(enum AVCodecID id);
|
||||
* @param name name of the requested decoder
|
||||
* @return A decoder if one was found, NULL otherwise.
|
||||
*/
|
||||
AVCodec *avcodec_find_decoder_by_name(const char *name);
|
||||
const AVCodec *avcodec_find_decoder_by_name(const char *name);
|
||||
|
||||
/**
|
||||
* Find a registered encoder with a matching codec ID.
|
||||
@@ -381,7 +267,7 @@ AVCodec *avcodec_find_decoder_by_name(const char *name);
|
||||
* @param id AVCodecID of the requested encoder
|
||||
* @return An encoder if one was found, NULL otherwise.
|
||||
*/
|
||||
AVCodec *avcodec_find_encoder(enum AVCodecID id);
|
||||
const AVCodec *avcodec_find_encoder(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Find a registered encoder with the specified name.
|
||||
@@ -389,7 +275,7 @@ AVCodec *avcodec_find_encoder(enum AVCodecID id);
|
||||
* @param name name of the requested encoder
|
||||
* @return An encoder if one was found, NULL otherwise.
|
||||
*/
|
||||
AVCodec *avcodec_find_encoder_by_name(const char *name);
|
||||
const AVCodec *avcodec_find_encoder_by_name(const char *name);
|
||||
/**
|
||||
* @return a non-zero number if codec is an encoder, zero otherwise
|
||||
*/
|
||||
@@ -400,6 +286,15 @@ int av_codec_is_encoder(const AVCodec *codec);
|
||||
*/
|
||||
int av_codec_is_decoder(const AVCodec *codec);
|
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available.
|
||||
*
|
||||
* @param codec the codec that is searched for the given profile
|
||||
* @param profile the profile value for which a name is requested
|
||||
* @return A name for the profile if found, NULL otherwise.
|
||||
*/
|
||||
const char *av_get_profile_name(const AVCodec *codec, int profile);
|
||||
|
||||
enum {
|
||||
/**
|
||||
* The codec supports this format via the hw_device_ctx interface.
|
||||
|
||||
95
3rdparty/ffmpeg/include/libavcodec/codec_id.h
vendored
95
3rdparty/ffmpeg/include/libavcodec/codec_id.h
vendored
@@ -22,6 +22,9 @@
|
||||
#define AVCODEC_CODEC_ID_H
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#include "version_major.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
@@ -246,12 +249,13 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_MSP2,
|
||||
AV_CODEC_ID_VVC,
|
||||
#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
|
||||
|
||||
AV_CODEC_ID_Y41P = 0x8000,
|
||||
AV_CODEC_ID_Y41P,
|
||||
AV_CODEC_ID_AVRP,
|
||||
AV_CODEC_ID_012V,
|
||||
AV_CODEC_ID_AVUI,
|
||||
#if FF_API_AYUV_CODECID
|
||||
AV_CODEC_ID_AYUV,
|
||||
#endif
|
||||
AV_CODEC_ID_TARGA_Y216,
|
||||
AV_CODEC_ID_V308,
|
||||
AV_CODEC_ID_V408,
|
||||
@@ -307,6 +311,15 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_CRI,
|
||||
AV_CODEC_ID_SIMBIOSIS_IMX,
|
||||
AV_CODEC_ID_SGA_VIDEO,
|
||||
AV_CODEC_ID_GEM,
|
||||
AV_CODEC_ID_VBN,
|
||||
AV_CODEC_ID_JPEGXL,
|
||||
AV_CODEC_ID_QOI,
|
||||
AV_CODEC_ID_PHM,
|
||||
AV_CODEC_ID_RADIANCE_HDR,
|
||||
AV_CODEC_ID_WBMP,
|
||||
AV_CODEC_ID_MEDIA100,
|
||||
AV_CODEC_ID_VQC,
|
||||
|
||||
/* various PCM "codecs" */
|
||||
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
|
||||
@@ -341,8 +354,7 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_PCM_S24LE_PLANAR,
|
||||
AV_CODEC_ID_PCM_S32LE_PLANAR,
|
||||
AV_CODEC_ID_PCM_S16BE_PLANAR,
|
||||
|
||||
AV_CODEC_ID_PCM_S64LE = 0x10800,
|
||||
AV_CODEC_ID_PCM_S64LE,
|
||||
AV_CODEC_ID_PCM_S64BE,
|
||||
AV_CODEC_ID_PCM_F16LE,
|
||||
AV_CODEC_ID_PCM_F24LE,
|
||||
@@ -381,8 +393,7 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_ADPCM_G722,
|
||||
AV_CODEC_ID_ADPCM_IMA_APC,
|
||||
AV_CODEC_ID_ADPCM_VIMA,
|
||||
|
||||
AV_CODEC_ID_ADPCM_AFC = 0x11800,
|
||||
AV_CODEC_ID_ADPCM_AFC,
|
||||
AV_CODEC_ID_ADPCM_IMA_OKI,
|
||||
AV_CODEC_ID_ADPCM_DTK,
|
||||
AV_CODEC_ID_ADPCM_IMA_RAD,
|
||||
@@ -401,6 +412,8 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_ADPCM_IMA_MTF,
|
||||
AV_CODEC_ID_ADPCM_IMA_CUNNING,
|
||||
AV_CODEC_ID_ADPCM_IMA_MOFLEX,
|
||||
AV_CODEC_ID_ADPCM_IMA_ACORN,
|
||||
AV_CODEC_ID_ADPCM_XMD,
|
||||
|
||||
/* AMR */
|
||||
AV_CODEC_ID_AMR_NB = 0x12000,
|
||||
@@ -415,10 +428,11 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_INTERPLAY_DPCM,
|
||||
AV_CODEC_ID_XAN_DPCM,
|
||||
AV_CODEC_ID_SOL_DPCM,
|
||||
|
||||
AV_CODEC_ID_SDX2_DPCM = 0x14800,
|
||||
AV_CODEC_ID_SDX2_DPCM,
|
||||
AV_CODEC_ID_GREMLIN_DPCM,
|
||||
AV_CODEC_ID_DERF_DPCM,
|
||||
AV_CODEC_ID_WADY_DPCM,
|
||||
AV_CODEC_ID_CBD2_DPCM,
|
||||
|
||||
/* audio codecs */
|
||||
AV_CODEC_ID_MP2 = 0x15000,
|
||||
@@ -489,8 +503,7 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_ON2AVC,
|
||||
AV_CODEC_ID_DSS_SP,
|
||||
AV_CODEC_ID_CODEC2,
|
||||
|
||||
AV_CODEC_ID_FFWAVESYNTH = 0x15800,
|
||||
AV_CODEC_ID_FFWAVESYNTH,
|
||||
AV_CODEC_ID_SONIC,
|
||||
AV_CODEC_ID_SONIC_LS,
|
||||
AV_CODEC_ID_EVRC,
|
||||
@@ -517,6 +530,14 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_SIREN,
|
||||
AV_CODEC_ID_HCA,
|
||||
AV_CODEC_ID_FASTAUDIO,
|
||||
AV_CODEC_ID_MSNSIREN,
|
||||
AV_CODEC_ID_DFPWM,
|
||||
AV_CODEC_ID_BONK,
|
||||
AV_CODEC_ID_MISC4,
|
||||
AV_CODEC_ID_APAC,
|
||||
AV_CODEC_ID_FTR,
|
||||
AV_CODEC_ID_WAVARC,
|
||||
AV_CODEC_ID_RKA,
|
||||
|
||||
/* subtitle codecs */
|
||||
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
|
||||
@@ -529,8 +550,7 @@ enum AVCodecID {
|
||||
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
|
||||
AV_CODEC_ID_DVB_TELETEXT,
|
||||
AV_CODEC_ID_SRT,
|
||||
|
||||
AV_CODEC_ID_MICRODVD = 0x17800,
|
||||
AV_CODEC_ID_MICRODVD,
|
||||
AV_CODEC_ID_EIA_608,
|
||||
AV_CODEC_ID_JACOSUB,
|
||||
AV_CODEC_ID_SAMI,
|
||||
@@ -554,7 +574,7 @@ enum AVCodecID {
|
||||
|
||||
AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
|
||||
AV_CODEC_ID_EPG,
|
||||
AV_CODEC_ID_BINTEXT = 0x18800,
|
||||
AV_CODEC_ID_BINTEXT,
|
||||
AV_CODEC_ID_XBIN,
|
||||
AV_CODEC_ID_IDF,
|
||||
AV_CODEC_ID_OTF,
|
||||
@@ -572,6 +592,16 @@ enum AVCodecID {
|
||||
* stream (only used by libavformat) */
|
||||
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
|
||||
AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket
|
||||
/**
|
||||
* Dummy null video codec, useful mainly for development and debugging.
|
||||
* Null encoder/decoder discard all input and never return any output.
|
||||
*/
|
||||
AV_CODEC_ID_VNULL,
|
||||
/**
|
||||
* Dummy null audio codec, useful mainly for development and debugging.
|
||||
* Null encoder/decoder discard all input and never return any output.
|
||||
*/
|
||||
AV_CODEC_ID_ANULL,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -585,6 +615,45 @@ enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
|
||||
*/
|
||||
const char *avcodec_get_name(enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Return codec bits per sample.
|
||||
*
|
||||
* @param[in] codec_id the codec
|
||||
* @return Number of bits per sample or zero if unknown for the given codec.
|
||||
*/
|
||||
int av_get_bits_per_sample(enum AVCodecID codec_id);
|
||||
|
||||
/**
|
||||
* Return codec bits per sample.
|
||||
* Only return non-zero if the bits per sample is exactly correct, not an
|
||||
* approximation.
|
||||
*
|
||||
* @param[in] codec_id the codec
|
||||
* @return Number of bits per sample or zero if unknown for the given codec.
|
||||
*/
|
||||
int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
|
||||
|
||||
/**
|
||||
* Return a name for the specified profile, if available.
|
||||
*
|
||||
* @param codec_id the ID of the codec to which the requested profile belongs
|
||||
* @param profile the profile value for which a name is requested
|
||||
* @return A name for the profile if found, NULL otherwise.
|
||||
*
|
||||
* @note unlike av_get_profile_name(), which searches a list of profiles
|
||||
* supported by a specific decoder or encoder implementation, this
|
||||
* function searches the list of profiles from the AVCodecDescriptor
|
||||
*/
|
||||
const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
|
||||
|
||||
/**
|
||||
* Return the PCM codec associated with a sample format.
|
||||
* @param be endianness, 0 for little, 1 for big,
|
||||
* -1 (or anything else) for native
|
||||
* @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
|
||||
*/
|
||||
enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
26
3rdparty/ffmpeg/include/libavcodec/codec_par.h
vendored
26
3rdparty/ffmpeg/include/libavcodec/codec_par.h
vendored
@@ -24,6 +24,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
||||
@@ -31,15 +32,16 @@
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_core
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVFieldOrder {
|
||||
AV_FIELD_UNKNOWN,
|
||||
AV_FIELD_PROGRESSIVE,
|
||||
AV_FIELD_TT, //< Top coded_first, top displayed first
|
||||
AV_FIELD_BB, //< Bottom coded first, bottom displayed first
|
||||
AV_FIELD_TB, //< Top coded first, bottom displayed first
|
||||
AV_FIELD_BT, //< Bottom coded first, top displayed first
|
||||
AV_FIELD_TT, ///< Top coded_first, top displayed first
|
||||
AV_FIELD_BB, ///< Bottom coded first, bottom displayed first
|
||||
AV_FIELD_TB, ///< Top coded first, bottom displayed first
|
||||
AV_FIELD_BT, ///< Bottom coded first, top displayed first
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -154,16 +156,22 @@ typedef struct AVCodecParameters {
|
||||
*/
|
||||
int video_delay;
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* Audio only. The channel layout bitmask. May be 0 if the channel layout is
|
||||
* unknown or unspecified, otherwise the number of bits set must be equal to
|
||||
* the channels field.
|
||||
* @deprecated use ch_layout
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint64_t channel_layout;
|
||||
/**
|
||||
* Audio only. The number of audio channels.
|
||||
* @deprecated use ch_layout.nb_channels
|
||||
*/
|
||||
attribute_deprecated
|
||||
int channels;
|
||||
#endif
|
||||
/**
|
||||
* Audio only. The number of audio samples per second.
|
||||
*/
|
||||
@@ -198,6 +206,11 @@ typedef struct AVCodecParameters {
|
||||
* Audio only. Number of samples to skip after a discontinuity.
|
||||
*/
|
||||
int seek_preroll;
|
||||
|
||||
/**
|
||||
* Audio only. The channel layout and number of channels.
|
||||
*/
|
||||
AVChannelLayout ch_layout;
|
||||
} AVCodecParameters;
|
||||
|
||||
/**
|
||||
@@ -221,6 +234,11 @@ void avcodec_parameters_free(AVCodecParameters **par);
|
||||
*/
|
||||
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src);
|
||||
|
||||
/**
|
||||
* This function is the same as av_get_audio_frame_duration(), except it works
|
||||
* with AVCodecParameters instead of an AVCodecContext.
|
||||
*/
|
||||
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
192
3rdparty/ffmpeg/include/libavcodec/defs.h
vendored
Normal file
192
3rdparty/ffmpeg/include/libavcodec/defs.h
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
*
|
||||
* 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_DEFS_H
|
||||
#define AVCODEC_DEFS_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavc
|
||||
* Misc types and constants that do not belong anywhere else.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding
|
||||
* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
|
||||
* This is mainly needed because some optimized bitstream readers read
|
||||
* 32 or 64 bit at once and could read over the end.<br>
|
||||
* Note: If the first 23 bits of the additional bytes are not 0, then damaged
|
||||
* MPEG bitstreams could cause overread and segfault.
|
||||
*/
|
||||
#define AV_INPUT_BUFFER_PADDING_SIZE 64
|
||||
|
||||
/**
|
||||
* Verify checksums embedded in the bitstream (could be of either encoded or
|
||||
* decoded data, depending on the format) and print an error message on mismatch.
|
||||
* If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
|
||||
* decoder/demuxer returning an error.
|
||||
*/
|
||||
#define AV_EF_CRCCHECK (1<<0)
|
||||
#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations
|
||||
#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length
|
||||
#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection
|
||||
|
||||
#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue
|
||||
#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors
|
||||
#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors
|
||||
#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error
|
||||
|
||||
#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software.
|
||||
#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences.
|
||||
#define FF_COMPLIANCE_NORMAL 0
|
||||
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
|
||||
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
|
||||
|
||||
/**
|
||||
* @ingroup lavc_decoding
|
||||
*/
|
||||
enum AVDiscard{
|
||||
/* We leave some space between them for extensions (drop some
|
||||
* keyframes for intra-only or drop just some bidir frames). */
|
||||
AVDISCARD_NONE =-16, ///< discard nothing
|
||||
AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
|
||||
AVDISCARD_NONREF = 8, ///< discard all non reference
|
||||
AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
|
||||
AVDISCARD_NONINTRA= 24, ///< discard all non intra frames
|
||||
AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
|
||||
AVDISCARD_ALL = 48, ///< discard all
|
||||
};
|
||||
|
||||
enum AVAudioServiceType {
|
||||
AV_AUDIO_SERVICE_TYPE_MAIN = 0,
|
||||
AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
|
||||
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
|
||||
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
|
||||
AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
|
||||
AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
|
||||
AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
|
||||
AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
|
||||
AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
|
||||
AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
|
||||
};
|
||||
|
||||
/**
|
||||
* Pan Scan area.
|
||||
* This specifies the area which should be displayed.
|
||||
* Note there may be multiple such areas for one frame.
|
||||
*/
|
||||
typedef struct AVPanScan {
|
||||
/**
|
||||
* id
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int id;
|
||||
|
||||
/**
|
||||
* width and height in 1/16 pel
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int width;
|
||||
int height;
|
||||
|
||||
/**
|
||||
* position of the top left corner in 1/16 pel for up to 3 fields/frames
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by libavcodec.
|
||||
*/
|
||||
int16_t position[3][2];
|
||||
} AVPanScan;
|
||||
|
||||
/**
|
||||
* This structure describes the bitrate properties of an encoded bitstream. It
|
||||
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
|
||||
* parameters for H.264/HEVC.
|
||||
*/
|
||||
typedef struct AVCPBProperties {
|
||||
/**
|
||||
* Maximum bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t max_bitrate;
|
||||
/**
|
||||
* Minimum bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t min_bitrate;
|
||||
/**
|
||||
* Average bitrate of the stream, in bits per second.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t avg_bitrate;
|
||||
|
||||
/**
|
||||
* The size of the buffer to which the ratecontrol is applied, in bits.
|
||||
* Zero if unknown or unspecified.
|
||||
*/
|
||||
int64_t buffer_size;
|
||||
|
||||
/**
|
||||
* The delay between the time the packet this structure is associated with
|
||||
* is received and the time when it should be decoded, in periods of a 27MHz
|
||||
* clock.
|
||||
*
|
||||
* UINT64_MAX when unknown or unspecified.
|
||||
*/
|
||||
uint64_t vbv_delay;
|
||||
} AVCPBProperties;
|
||||
|
||||
/**
|
||||
* Allocate a CPB properties structure and initialize its fields to default
|
||||
* values.
|
||||
*
|
||||
* @param size if non-NULL, the size of the allocated struct will be written
|
||||
* here. This is useful for embedding it in side data.
|
||||
*
|
||||
* @return the newly allocated struct or NULL on failure
|
||||
*/
|
||||
AVCPBProperties *av_cpb_properties_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* This structure supplies correlation between a packet timestamp and a wall clock
|
||||
* production time. The definition follows the Producer Reference Time ('prft')
|
||||
* as defined in ISO/IEC 14496-12
|
||||
*/
|
||||
typedef struct AVProducerReferenceTime {
|
||||
/**
|
||||
* A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
|
||||
*/
|
||||
int64_t wallclock;
|
||||
int flags;
|
||||
} AVProducerReferenceTime;
|
||||
|
||||
/**
|
||||
* Encode extradata length to a buffer. Used by xiph codecs.
|
||||
*
|
||||
* @param s buffer to write to; must be at least (v/255+1) bytes long
|
||||
* @param v size of extradata in bytes
|
||||
* @return number of bytes written to the buffer.
|
||||
*/
|
||||
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
||||
|
||||
#endif // AVCODEC_DEFS_H
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "avcodec.h"
|
||||
|
||||
/* minimum number of bytes to read from a DV stream in order to
|
||||
* determine the profile */
|
||||
|
||||
@@ -88,13 +88,15 @@ int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
|
||||
/**
|
||||
* Release a MediaCodec buffer and render it at the given time to the surface
|
||||
* that is associated with the decoder. The timestamp must be within one second
|
||||
* of the current java/lang/System#nanoTime() (which is implemented using
|
||||
* CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation
|
||||
* of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details.
|
||||
* of the current `java/lang/System#nanoTime()` (which is implemented using
|
||||
* `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
|
||||
* of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
|
||||
*
|
||||
* @param buffer the buffer to render
|
||||
* @param time timestamp in nanoseconds of when to render the buffer
|
||||
* @return 0 on success, < 0 otherwise
|
||||
*
|
||||
* [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
|
||||
*/
|
||||
int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);
|
||||
|
||||
|
||||
117
3rdparty/ffmpeg/include/libavcodec/packet.h
vendored
117
3rdparty/ffmpeg/include/libavcodec/packet.h
vendored
@@ -28,8 +28,9 @@
|
||||
#include "libavutil/buffer.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
#include "libavcodec/version_major.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavc_packet AVPacket
|
||||
@@ -160,7 +161,7 @@ enum AVPacketSideDataType {
|
||||
* the packet may contain "dual mono" audio specific to Japanese DTV
|
||||
* and if it is true, recommends only the selected channel to be used.
|
||||
* @code
|
||||
* u8 selected channels (0=mail/left, 1=sub/right, 2=both)
|
||||
* u8 selected channels (0=main/left, 1=sub/right, 2=both)
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_JP_DUALMONO,
|
||||
@@ -290,6 +291,14 @@ enum AVPacketSideDataType {
|
||||
*/
|
||||
AV_PKT_DATA_S12M_TIMECODE,
|
||||
|
||||
/**
|
||||
* HDR10+ dynamic metadata associated with a video frame. The metadata is in
|
||||
* the form of the AVDynamicHDRPlus struct and contains
|
||||
* information for color volume transform - application 4 of
|
||||
* SMPTE 2094-40:2016 standard.
|
||||
*/
|
||||
AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
|
||||
|
||||
/**
|
||||
* The number of side data types.
|
||||
* This is not part of the public API/ABI in the sense that it may
|
||||
@@ -305,11 +314,7 @@ enum AVPacketSideDataType {
|
||||
|
||||
typedef struct AVPacketSideData {
|
||||
uint8_t *data;
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size;
|
||||
#else
|
||||
size_t size;
|
||||
#endif
|
||||
enum AVPacketSideDataType type;
|
||||
} AVPacketSideData;
|
||||
|
||||
@@ -388,15 +393,29 @@ typedef struct AVPacket {
|
||||
|
||||
int64_t pos; ///< byte position in stream, -1 if unknown
|
||||
|
||||
#if FF_API_CONVERGENCE_DURATION
|
||||
/**
|
||||
* @deprecated Same as the duration field, but as int64_t. This was required
|
||||
* for Matroska subtitles, whose duration values could overflow when the
|
||||
* duration field was still an int.
|
||||
* for some private data of the user
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t convergence_duration;
|
||||
#endif
|
||||
void *opaque;
|
||||
|
||||
/**
|
||||
* AVBufferRef for free use by the API user. FFmpeg will never check the
|
||||
* contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when
|
||||
* the packet is unreferenced. av_packet_copy_props() calls create a new
|
||||
* reference with av_buffer_ref() for the target packet's opaque_ref field.
|
||||
*
|
||||
* This is unrelated to the opaque field, although it serves a similar
|
||||
* purpose.
|
||||
*/
|
||||
AVBufferRef *opaque_ref;
|
||||
|
||||
/**
|
||||
* Time base of the packet's timestamps.
|
||||
* In the future, this field may be set on packets output by encoders or
|
||||
* demuxers, but its value will be by default ignored on input to decoders
|
||||
* or muxers.
|
||||
*/
|
||||
AVRational time_base;
|
||||
} AVPacket;
|
||||
|
||||
#if FF_API_INIT_PACKET
|
||||
@@ -429,8 +448,13 @@ typedef struct AVPacketList {
|
||||
#define AV_PKT_FLAG_DISPOSABLE 0x0010
|
||||
|
||||
enum AVSideDataParamChangeFlags {
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* @deprecated those are not used by any decoder
|
||||
*/
|
||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001,
|
||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
|
||||
#endif
|
||||
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004,
|
||||
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008,
|
||||
};
|
||||
@@ -529,45 +553,6 @@ int av_grow_packet(AVPacket *pkt, int grow_by);
|
||||
*/
|
||||
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
|
||||
|
||||
#if FF_API_AVPACKET_OLD_API
|
||||
/**
|
||||
* @warning This is a hack - the packet memory allocation stuff is broken. The
|
||||
* packet is allocated if it was not really allocated.
|
||||
*
|
||||
* @deprecated Use av_packet_ref or av_packet_make_refcounted
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_dup_packet(AVPacket *pkt);
|
||||
/**
|
||||
* Copy packet, including contents
|
||||
*
|
||||
* @return 0 on success, negative AVERROR on fail
|
||||
*
|
||||
* @deprecated Use av_packet_ref
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_copy_packet(AVPacket *dst, const AVPacket *src);
|
||||
|
||||
/**
|
||||
* Copy packet side data
|
||||
*
|
||||
* @return 0 on success, negative AVERROR on fail
|
||||
*
|
||||
* @deprecated Use av_packet_copy_props
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
|
||||
|
||||
/**
|
||||
* Free a packet.
|
||||
*
|
||||
* @deprecated Use av_packet_unref
|
||||
*
|
||||
* @param pkt packet to free
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_free_packet(AVPacket *pkt);
|
||||
#endif
|
||||
/**
|
||||
* Allocate new information of a packet.
|
||||
*
|
||||
@@ -577,11 +562,7 @@ void av_free_packet(AVPacket *pkt);
|
||||
* @return pointer to fresh allocated data or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size);
|
||||
#else
|
||||
size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Wrap an existing array as a packet side data.
|
||||
@@ -608,11 +589,7 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
* @return 0 on success, < 0 on failure
|
||||
*/
|
||||
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size);
|
||||
#else
|
||||
size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get side information from packet.
|
||||
@@ -624,19 +601,7 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
* @return pointer to data if present or NULL otherwise
|
||||
*/
|
||||
uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type,
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int *size);
|
||||
#else
|
||||
size_t *size);
|
||||
#endif
|
||||
|
||||
#if FF_API_MERGE_SD_API
|
||||
attribute_deprecated
|
||||
int av_packet_merge_side_data(AVPacket *pkt);
|
||||
|
||||
attribute_deprecated
|
||||
int av_packet_split_side_data(AVPacket *pkt);
|
||||
#endif
|
||||
|
||||
const char *av_packet_side_data_name(enum AVPacketSideDataType type);
|
||||
|
||||
@@ -647,11 +612,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type);
|
||||
* @param size pointer to store the size of the returned data
|
||||
* @return pointer to data if successful, NULL otherwise
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size);
|
||||
#else
|
||||
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size);
|
||||
#endif
|
||||
/**
|
||||
* Unpack a dictionary from side_data.
|
||||
*
|
||||
@@ -660,12 +621,8 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size);
|
||||
* @param dict the metadata storage dictionary
|
||||
* @return 0 on success, < 0 on failure
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict);
|
||||
#else
|
||||
int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
|
||||
AVDictionary **dict);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Convenience function to free all the side data stored.
|
||||
|
||||
4
3rdparty/ffmpeg/include/libavcodec/qsv.h
vendored
4
3rdparty/ffmpeg/include/libavcodec/qsv.h
vendored
@@ -21,7 +21,7 @@
|
||||
#ifndef AVCODEC_QSV_H
|
||||
#define AVCODEC_QSV_H
|
||||
|
||||
#include <mfx/mfxvideo.h>
|
||||
#include <mfxvideo.h>
|
||||
|
||||
#include "libavutil/buffer.h"
|
||||
|
||||
@@ -61,6 +61,8 @@ typedef struct AVQSVContext {
|
||||
* required by the encoder and the user-provided value nb_opaque_surfaces.
|
||||
* The array of the opaque surfaces will be exported to the caller through
|
||||
* the opaque_surfaces field.
|
||||
*
|
||||
* The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)
|
||||
*/
|
||||
int opaque_alloc;
|
||||
|
||||
|
||||
86
3rdparty/ffmpeg/include/libavcodec/vaapi.h
vendored
86
3rdparty/ffmpeg/include/libavcodec/vaapi.h
vendored
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Video Acceleration API (shared data between FFmpeg and the video player)
|
||||
* HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
|
||||
*
|
||||
* Copyright (C) 2008-2009 Splitted-Desktop Systems
|
||||
*
|
||||
* 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_VAAPI_H
|
||||
#define AVCODEC_VAAPI_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavc_codec_hwaccel_vaapi
|
||||
* Public libavcodec VA API header.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "libavutil/attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
#if FF_API_STRUCT_VAAPI_CONTEXT
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* This structure is used to share data between the FFmpeg library and
|
||||
* the client video application.
|
||||
* This shall be zero-allocated and available as
|
||||
* AVCodecContext.hwaccel_context. All user members can be set once
|
||||
* during initialization or through each AVCodecContext.get_buffer()
|
||||
* function call. In any case, they must be valid prior to calling
|
||||
* decoding functions.
|
||||
*
|
||||
* Deprecated: use AVCodecContext.hw_frames_ctx instead.
|
||||
*/
|
||||
struct attribute_deprecated vaapi_context {
|
||||
/**
|
||||
* Window system dependent data
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
void *display;
|
||||
|
||||
/**
|
||||
* Configuration ID
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
uint32_t config_id;
|
||||
|
||||
/**
|
||||
* Context ID (video decode pipeline)
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user
|
||||
*/
|
||||
uint32_t context_id;
|
||||
};
|
||||
|
||||
/* @} */
|
||||
|
||||
#endif /* FF_API_STRUCT_VAAPI_CONTEXT */
|
||||
|
||||
#endif /* AVCODEC_VAAPI_H */
|
||||
21
3rdparty/ffmpeg/include/libavcodec/vdpau.h
vendored
21
3rdparty/ffmpeg/include/libavcodec/vdpau.h
vendored
@@ -55,7 +55,6 @@
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "version.h"
|
||||
|
||||
struct AVCodecContext;
|
||||
struct AVFrame;
|
||||
@@ -153,24 +152,6 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
|
||||
*/
|
||||
AVVDPAUContext *av_vdpau_alloc_context(void);
|
||||
|
||||
#if FF_API_VDPAU_PROFILE
|
||||
/**
|
||||
* Get a decoder profile that should be used for initializing a VDPAU decoder.
|
||||
* Should be called from the AVCodecContext.get_format() callback.
|
||||
*
|
||||
* @deprecated Use av_vdpau_bind_context() instead.
|
||||
*
|
||||
* @param avctx the codec context being used for decoding the stream
|
||||
* @param profile a pointer into which the result will be written on success.
|
||||
* The contents of profile are undefined if this function returns
|
||||
* an error.
|
||||
*
|
||||
* @return 0 on success (non-negative), a negative AVERROR on failure.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
|
||||
#endif
|
||||
|
||||
/* @}*/
|
||||
/** @} */
|
||||
|
||||
#endif /* AVCODEC_VDPAU_H */
|
||||
|
||||
133
3rdparty/ffmpeg/include/libavcodec/version.h
vendored
133
3rdparty/ffmpeg/include/libavcodec/version.h
vendored
@@ -27,8 +27,9 @@
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 58
|
||||
#define LIBAVCODEC_VERSION_MINOR 134
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MINOR 3
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
@@ -41,132 +42,4 @@
|
||||
|
||||
#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*/
|
||||
|
||||
#ifndef FF_API_AVCTX_TIMEBASE
|
||||
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CODED_FRAME
|
||||
#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_SIDEDATA_ONLY_PKT
|
||||
#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_VDPAU_PROFILE
|
||||
#define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CONVERGENCE_DURATION
|
||||
#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_AVPICTURE
|
||||
#define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_AVPACKET_OLD_API
|
||||
#define FF_API_AVPACKET_OLD_API (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_RTP_CALLBACK
|
||||
#define FF_API_RTP_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_VBV_DELAY
|
||||
#define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CODER_TYPE
|
||||
#define FF_API_CODER_TYPE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_STAT_BITS
|
||||
#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_PRIVATE_OPT
|
||||
#define FF_API_PRIVATE_OPT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_ASS_TIMING
|
||||
#define FF_API_ASS_TIMING (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_BSF
|
||||
#define FF_API_OLD_BSF (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_COPY_CONTEXT
|
||||
#define FF_API_COPY_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_GET_CONTEXT_DEFAULTS
|
||||
#define FF_API_GET_CONTEXT_DEFAULTS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NVENC_OLD_NAME
|
||||
#define FF_API_NVENC_OLD_NAME (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_STRUCT_VAAPI_CONTEXT
|
||||
#define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_MERGE_SD_API
|
||||
#define FF_API_MERGE_SD_API (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_TAG_STRING
|
||||
#define FF_API_TAG_STRING (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_GETCHROMA
|
||||
#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CODEC_GET_SET
|
||||
#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_USER_VISIBLE_AVHWACCEL
|
||||
#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LOCKMGR
|
||||
#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_UNSANITIZED_BITRATES
|
||||
#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OPENH264_SLICE_MODE
|
||||
#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OPENH264_CABAC
|
||||
#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_UNUSED_CODEC_CAPS
|
||||
#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_AVPRIV_PUT_BITS
|
||||
#define FF_API_AVPRIV_PUT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ENCDEC
|
||||
#define FF_API_OLD_ENCDEC (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_AVCODEC_PIX_FMT
|
||||
#define FF_API_AVCODEC_PIX_FMT (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_MPV_RC_STRATEGY
|
||||
#define FF_API_MPV_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_PARSER_CHANGE
|
||||
#define FF_API_PARSER_CHANGE (LIBAVCODEC_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_THREAD_SAFE_CALLBACKS
|
||||
#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
#ifndef FF_API_DEBUG_MV
|
||||
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
#ifndef FF_API_GET_FRAME_CLASS
|
||||
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
#ifndef FF_API_AUTO_THREADS
|
||||
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
#ifndef FF_API_INIT_PACKET
|
||||
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_VERSION_H */
|
||||
|
||||
52
3rdparty/ffmpeg/include/libavcodec/version_major.h
vendored
Normal file
52
3rdparty/ffmpeg/include/libavcodec/version_major.h
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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_VERSION_MAJOR_H
|
||||
#define AVCODEC_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavc
|
||||
* Libavcodec version macros.
|
||||
*/
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 60
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*/
|
||||
|
||||
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
#define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
|
||||
// reminder to remove CrystalHD decoders on next major bump
|
||||
#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
|
||||
|
||||
#endif /* AVCODEC_VERSION_MAJOR_H */
|
||||
@@ -29,6 +29,15 @@
|
||||
* Public libavcodec Videotoolbox header.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
*
|
||||
* Hardware accelerated decoding using VideoToolbox on Apple Platforms
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define Picture QuickdrawPicture
|
||||
@@ -37,6 +46,8 @@
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
/**
|
||||
* This struct holds all the information that needs to be passed
|
||||
* between the caller and libavcodec for initializing Videotoolbox decoding.
|
||||
@@ -46,15 +57,17 @@
|
||||
typedef struct AVVideotoolboxContext {
|
||||
/**
|
||||
* Videotoolbox decompression session object.
|
||||
* Created and freed the caller.
|
||||
*/
|
||||
VTDecompressionSessionRef session;
|
||||
|
||||
#if FF_API_VT_OUTPUT_CALLBACK
|
||||
/**
|
||||
* The output callback that must be passed to the session.
|
||||
* Set by av_videottoolbox_default_init()
|
||||
*/
|
||||
attribute_deprecated
|
||||
VTDecompressionOutputCallback output_callback;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
|
||||
@@ -65,17 +78,17 @@ typedef struct AVVideotoolboxContext {
|
||||
|
||||
/**
|
||||
* CoreMedia Format Description that Videotoolbox will use to create the decompression session.
|
||||
* Set by the caller.
|
||||
*/
|
||||
CMVideoFormatDescriptionRef cm_fmt_desc;
|
||||
|
||||
/**
|
||||
* CoreMedia codec type that Videotoolbox will use to create the decompression session.
|
||||
* Set by the caller.
|
||||
*/
|
||||
int cm_codec_type;
|
||||
} AVVideotoolboxContext;
|
||||
|
||||
#if FF_API_VT_HWACCEL_CONTEXT
|
||||
|
||||
/**
|
||||
* Allocate and initialize a Videotoolbox context.
|
||||
*
|
||||
@@ -88,7 +101,9 @@ typedef struct AVVideotoolboxContext {
|
||||
* object and free the Videotoolbox context using av_free().
|
||||
*
|
||||
* @return the newly allocated context or NULL on failure
|
||||
* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVVideotoolboxContext *av_videotoolbox_alloc_context(void);
|
||||
|
||||
/**
|
||||
@@ -98,7 +113,9 @@ AVVideotoolboxContext *av_videotoolbox_alloc_context(void);
|
||||
* @param avctx the corresponding codec context
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR code on failure
|
||||
* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_videotoolbox_default_init(AVCodecContext *avctx);
|
||||
|
||||
/**
|
||||
@@ -109,7 +126,9 @@ int av_videotoolbox_default_init(AVCodecContext *avctx);
|
||||
* @param vtctx the Videotoolbox context to use
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR code on failure
|
||||
* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx);
|
||||
|
||||
/**
|
||||
@@ -117,9 +136,13 @@ int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *
|
||||
* av_videotoolbox_default_init().
|
||||
*
|
||||
* @param avctx the corresponding codec context
|
||||
* @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_videotoolbox_default_free(AVCodecContext *avctx);
|
||||
|
||||
#endif /* FF_API_VT_HWACCEL_CONTEXT */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
3
3rdparty/ffmpeg/include/libavcodec/xvmc.h
vendored
3
3rdparty/ffmpeg/include/libavcodec/xvmc.h
vendored
@@ -27,10 +27,11 @@
|
||||
* Public libavcodec XvMC header.
|
||||
*/
|
||||
|
||||
#pragma message("XvMC is no longer supported; this header is deprecated and will be removed")
|
||||
|
||||
#include <X11/extensions/XvMC.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "version.h"
|
||||
#include "avcodec.h"
|
||||
|
||||
/**
|
||||
|
||||
906
3rdparty/ffmpeg/include/libavformat/avformat.h
vendored
906
3rdparty/ffmpeg/include/libavformat/avformat.h
vendored
File diff suppressed because it is too large
Load Diff
105
3rdparty/ffmpeg/include/libavformat/avio.h
vendored
105
3rdparty/ffmpeg/include/libavformat/avio.h
vendored
@@ -27,12 +27,13 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
|
||||
#include "libavformat/version.h"
|
||||
#include "libavformat/version_major.h"
|
||||
|
||||
/**
|
||||
* Seeking works like for a local file.
|
||||
@@ -100,9 +101,13 @@ typedef struct AVIODirEntry {
|
||||
int64_t filemode; /**< Unix file mode, -1 if unknown. */
|
||||
} AVIODirEntry;
|
||||
|
||||
#if FF_API_AVIODIRCONTEXT
|
||||
typedef struct AVIODirContext {
|
||||
struct URLContext *url_context;
|
||||
} AVIODirContext;
|
||||
#else
|
||||
typedef struct AVIODirContext AVIODirContext;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Different data types that can be returned via the AVIO
|
||||
@@ -148,9 +153,9 @@ enum AVIODataMarkerType {
|
||||
|
||||
/**
|
||||
* Bytestream IO Context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
* Removal, reordering and changes to existing fields require a major
|
||||
* version bump.
|
||||
* New public fields can be added with minor version bumps.
|
||||
* Removal, reordering and changes to existing public fields require
|
||||
* a major version bump.
|
||||
* sizeof(AVIOContext) must not be used outside libav*.
|
||||
*
|
||||
* @note None of the function pointers in AVIOContext should be called
|
||||
@@ -237,12 +242,14 @@ typedef struct AVIOContext {
|
||||
int64_t (*seek)(void *opaque, int64_t offset, int whence);
|
||||
int64_t pos; /**< position in the file of the current buffer */
|
||||
int eof_reached; /**< true if was unable to read due to error or eof */
|
||||
int error; /**< contains the error code or 0 if no error happened */
|
||||
int write_flag; /**< true if open for writing */
|
||||
int max_packet_size;
|
||||
int min_packet_size; /**< Try to buffer at least this amount of data
|
||||
before flushing it. */
|
||||
unsigned long checksum;
|
||||
unsigned char *checksum_ptr;
|
||||
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
|
||||
int error; /**< contains the error code or 0 if no error happened */
|
||||
/**
|
||||
* Pause or resume playback for network streaming protocols - e.g. MMS.
|
||||
*/
|
||||
@@ -259,12 +266,6 @@ typedef struct AVIOContext {
|
||||
*/
|
||||
int seekable;
|
||||
|
||||
/**
|
||||
* max filesize, used to limit allocations
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int64_t maxsize;
|
||||
|
||||
/**
|
||||
* avio_read and avio_write should if possible be satisfied directly
|
||||
* instead of going through a buffer, and avio_seek will always
|
||||
@@ -272,37 +273,6 @@ typedef struct AVIOContext {
|
||||
*/
|
||||
int direct;
|
||||
|
||||
/**
|
||||
* Bytes read statistic
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int64_t bytes_read;
|
||||
|
||||
/**
|
||||
* seek statistic
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int seek_count;
|
||||
|
||||
/**
|
||||
* writeout statistic
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int writeout_count;
|
||||
|
||||
/**
|
||||
* Original buffer size
|
||||
* used internally after probing and ensure seekback to reset the buffer size
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int orig_buffer_size;
|
||||
|
||||
/**
|
||||
* Threshold to favor readahead over seek.
|
||||
* This is current internal only, do not use from outside.
|
||||
*/
|
||||
int short_seek_threshold;
|
||||
|
||||
/**
|
||||
* ',' separated list of allowed protocols.
|
||||
*/
|
||||
@@ -325,20 +295,6 @@ typedef struct AVIOContext {
|
||||
*/
|
||||
int ignore_boundary_point;
|
||||
|
||||
/**
|
||||
* Internal, not meant to be used from outside of AVIOContext.
|
||||
*/
|
||||
enum AVIODataMarkerType current_type;
|
||||
int64_t last_time;
|
||||
|
||||
/**
|
||||
* A callback that is used instead of short_seek_threshold.
|
||||
* This is current internal only, do not use from outside.
|
||||
*/
|
||||
int (*short_seek_get)(void *opaque);
|
||||
|
||||
int64_t written;
|
||||
|
||||
/**
|
||||
* Maximum reached position before a backward seek in the write buffer,
|
||||
* used keeping track of already written data for a later flush.
|
||||
@@ -346,9 +302,14 @@ typedef struct AVIOContext {
|
||||
unsigned char *buf_ptr_max;
|
||||
|
||||
/**
|
||||
* Try to buffer at least this amount of data before flushing it
|
||||
* Read-only statistic of bytes read for this AVIOContext.
|
||||
*/
|
||||
int min_packet_size;
|
||||
int64_t bytes_read;
|
||||
|
||||
/**
|
||||
* Read-only statistic of bytes written for this AVIOContext.
|
||||
*/
|
||||
int64_t bytes_written;
|
||||
} AVIOContext;
|
||||
|
||||
/**
|
||||
@@ -374,25 +335,6 @@ const char *avio_find_protocol_name(const char *url);
|
||||
*/
|
||||
int avio_check(const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Move or rename a resource.
|
||||
*
|
||||
* @note url_src and url_dst should share the same protocol and authority.
|
||||
*
|
||||
* @param url_src url to resource to be moved
|
||||
* @param url_dst new url to resource if the operation succeeded
|
||||
* @return >=0 on success or negative on error.
|
||||
*/
|
||||
int avpriv_io_move(const char *url_src, const char *url_dst);
|
||||
|
||||
/**
|
||||
* Delete a resource.
|
||||
*
|
||||
* @param url resource to be deleted.
|
||||
* @return >=0 on success or negative on error.
|
||||
*/
|
||||
int avpriv_io_delete(const char *url);
|
||||
|
||||
/**
|
||||
* Open directory for reading.
|
||||
*
|
||||
@@ -516,6 +458,7 @@ int avio_put_str16be(AVIOContext *s, const char *str);
|
||||
*
|
||||
* Zero-length ranges are omitted from the output.
|
||||
*
|
||||
* @param s the AVIOContext
|
||||
* @param time the stream time the current bytestream pos corresponds to
|
||||
* (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not
|
||||
* applicable
|
||||
@@ -571,6 +514,12 @@ int64_t avio_size(AVIOContext *s);
|
||||
*/
|
||||
int avio_feof(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to the context taking a va_list.
|
||||
* @return number of bytes written, < 0 on error.
|
||||
*/
|
||||
int avio_vprintf(AVIOContext *s, const char *fmt, va_list ap);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to the context.
|
||||
* @return number of bytes written, < 0 on error.
|
||||
|
||||
82
3rdparty/ffmpeg/include/libavformat/version.h
vendored
82
3rdparty/ffmpeg/include/libavformat/version.h
vendored
@@ -29,10 +29,9 @@
|
||||
|
||||
#include "libavutil/version.h"
|
||||
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 58
|
||||
#define LIBAVFORMAT_VERSION_MINOR 76
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MINOR 3
|
||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
@@ -45,79 +44,4 @@
|
||||
|
||||
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*
|
||||
*/
|
||||
#ifndef FF_API_COMPUTE_PKT_FIELDS2
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_OPEN_CALLBACKS
|
||||
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_AVCTX
|
||||
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HTTP_USER_AGENT
|
||||
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HLS_WRAP
|
||||
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_HLS_USE_LOCALTIME
|
||||
#define FF_API_HLS_USE_LOCALTIME (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
|
||||
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ROTATE_API
|
||||
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_GET_SET
|
||||
#define FF_API_FORMAT_GET_SET (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVIO_EOF_0
|
||||
#define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_FFSERVER
|
||||
#define FF_API_LAVF_FFSERVER (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_FORMAT_FILENAME
|
||||
#define FF_API_FORMAT_FILENAME (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_RTSP_OPTIONS
|
||||
#define FF_API_OLD_RTSP_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_NEXT
|
||||
#define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_DASH_MIN_SEG_DURATION
|
||||
#define FF_API_DASH_MIN_SEG_DURATION (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_MP4A_LATM
|
||||
#define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_AVIOFORMAT
|
||||
#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_DEMUXER_OPEN
|
||||
#define FF_API_DEMUXER_OPEN (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_CHAPTER_ID_INT
|
||||
#define FF_API_CHAPTER_ID_INT (LIBAVFORMAT_VERSION_MAJOR < 59)
|
||||
#endif
|
||||
#ifndef FF_API_LAVF_PRIV_OPT
|
||||
#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60)
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FF_API_R_FRAME_RATE
|
||||
#define FF_API_R_FRAME_RATE 1
|
||||
#endif
|
||||
#endif /* AVFORMAT_VERSION_H */
|
||||
|
||||
52
3rdparty/ffmpeg/include/libavformat/version_major.h
vendored
Normal file
52
3rdparty/ffmpeg/include/libavformat/version_major.h
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Version macros.
|
||||
*
|
||||
* 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 AVFORMAT_VERSION_MAJOR_H
|
||||
#define AVFORMAT_VERSION_MAJOR_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavf
|
||||
* Libavformat version macros
|
||||
*/
|
||||
|
||||
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
|
||||
// Also please add any ticket numbers that you believe might be affected here
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 60
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*
|
||||
* @note, when bumping the major version it is recommended to manually
|
||||
* disable each FF_API_* in its own commit instead of disabling them all
|
||||
* at once through the bump. This improves the git bisect-ability of the change.
|
||||
*
|
||||
*/
|
||||
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61)
|
||||
#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 61)
|
||||
#define FF_API_AVIODIRCONTEXT (LIBAVFORMAT_VERSION_MAJOR < 61)
|
||||
#define FF_API_AVFORMAT_IO_CLOSE (LIBAVFORMAT_VERSION_MAJOR < 61)
|
||||
|
||||
|
||||
#define FF_API_R_FRAME_RATE 1
|
||||
|
||||
#endif /* AVFORMAT_VERSION_MAJOR_H */
|
||||
9
3rdparty/ffmpeg/include/libavutil/adler32.h
vendored
9
3rdparty/ffmpeg/include/libavutil/adler32.h
vendored
@@ -30,7 +30,6 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_adler32 Adler-32
|
||||
@@ -40,11 +39,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
typedef unsigned long AVAdler;
|
||||
#else
|
||||
typedef uint32_t AVAdler;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Calculate the Adler32 checksum of a buffer.
|
||||
@@ -59,11 +54,7 @@ typedef uint32_t AVAdler;
|
||||
* @return updated checksum
|
||||
*/
|
||||
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
unsigned int len) av_pure;
|
||||
#else
|
||||
size_t len) av_pure;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
8
3rdparty/ffmpeg/include/libavutil/aes.h
vendored
8
3rdparty/ffmpeg/include/libavutil/aes.h
vendored
@@ -24,7 +24,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes AES
|
||||
@@ -43,6 +42,9 @@ struct AVAES *av_aes_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVAES context.
|
||||
*
|
||||
* @param a The AVAES context
|
||||
* @param key Pointer to the key
|
||||
* @param key_bits 128, 192 or 256
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
@@ -50,9 +52,11 @@ int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
|
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context.
|
||||
* @param count number of 16 byte blocks
|
||||
*
|
||||
* @param a The AVAES context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 16 byte blocks
|
||||
* @param iv initialization vector for CBC mode, if NULL then ECB will be used
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
|
||||
13
3rdparty/ffmpeg/include/libavutil/aes_ctr.h
vendored
13
3rdparty/ffmpeg/include/libavutil/aes_ctr.h
vendored
@@ -22,10 +22,15 @@
|
||||
#ifndef AVUTIL_AES_CTR_H
|
||||
#define AVUTIL_AES_CTR_H
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes_ctr AES-CTR
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
#define AES_CTR_KEY_SIZE (16)
|
||||
#define AES_CTR_IV_SIZE (8)
|
||||
@@ -39,17 +44,23 @@ struct AVAESCTR *av_aes_ctr_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVAESCTR context.
|
||||
*
|
||||
* @param a The AVAESCTR context to initialize
|
||||
* @param key encryption key, must have a length of AES_CTR_KEY_SIZE
|
||||
*/
|
||||
int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
|
||||
|
||||
/**
|
||||
* Release an AVAESCTR context.
|
||||
*
|
||||
* @param a The AVAESCTR context
|
||||
*/
|
||||
void av_aes_ctr_free(struct AVAESCTR *a);
|
||||
|
||||
/**
|
||||
* Process a buffer using a previously initialized context.
|
||||
*
|
||||
* @param a The AVAESCTR context
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param size the size of src and dst
|
||||
|
||||
72
3rdparty/ffmpeg/include/libavutil/ambient_viewing_environment.h
vendored
Normal file
72
3rdparty/ffmpeg/include/libavutil/ambient_viewing_environment.h
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Jan Ekström <jeebjp@gmail.com>
|
||||
*
|
||||
* 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 AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
|
||||
#define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "frame.h"
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
* Ambient viewing environment metadata as defined by H.274. The values are
|
||||
* saved in AVRationals so that they keep their exactness, while allowing for
|
||||
* easy access to a double value with f.ex. av_q2d.
|
||||
*
|
||||
* @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and
|
||||
* it must be allocated using av_ambient_viewing_environment_alloc.
|
||||
*/
|
||||
typedef struct AVAmbientViewingEnvironment {
|
||||
/**
|
||||
* Environmental illuminance of the ambient viewing environment in lux.
|
||||
*/
|
||||
AVRational ambient_illuminance;
|
||||
|
||||
/**
|
||||
* Normalized x chromaticity coordinate of the environmental ambient light
|
||||
* in the nominal viewing environment according to the CIE 1931 definition
|
||||
* of x and y as specified in ISO/CIE 11664-1.
|
||||
*/
|
||||
AVRational ambient_light_x;
|
||||
|
||||
/**
|
||||
* Normalized y chromaticity coordinate of the environmental ambient light
|
||||
* in the nominal viewing environment according to the CIE 1931 definition
|
||||
* of x and y as specified in ISO/CIE 11664-1.
|
||||
*/
|
||||
AVRational ambient_light_y;
|
||||
} AVAmbientViewingEnvironment;
|
||||
|
||||
/**
|
||||
* Allocate an AVAmbientViewingEnvironment structure.
|
||||
*
|
||||
* @return the newly allocated struct or NULL on failure
|
||||
*/
|
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* Allocate and add an AVAmbientViewingEnvironment structure to an existing
|
||||
* AVFrame as side data.
|
||||
*
|
||||
* @return the newly allocated struct, or NULL on failure
|
||||
*/
|
||||
AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame);
|
||||
|
||||
#endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */
|
||||
@@ -110,7 +110,7 @@
|
||||
* scheduled for removal.
|
||||
*/
|
||||
#ifndef AV_NOWARN_DEPRECATED
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,6)
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,6) || defined(__clang__)
|
||||
# define AV_NOWARN_DEPRECATED(code) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#ifndef AVUTIL_AUDIO_FIFO_H
|
||||
#define AVUTIL_AUDIO_FIFO_H
|
||||
|
||||
#include "avutil.h"
|
||||
#include "fifo.h"
|
||||
#include "attributes.h"
|
||||
#include "samplefmt.h"
|
||||
|
||||
/**
|
||||
|
||||
2
3rdparty/ffmpeg/include/libavutil/avassert.h
vendored
2
3rdparty/ffmpeg/include/libavutil/avassert.h
vendored
@@ -28,8 +28,8 @@
|
||||
#define AVUTIL_AVASSERT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "avutil.h"
|
||||
#include "log.h"
|
||||
#include "macros.h"
|
||||
|
||||
/**
|
||||
* assert() equivalent, that is always enabled.
|
||||
|
||||
10
3rdparty/ffmpeg/include/libavutil/avstring.h
vendored
10
3rdparty/ffmpeg/include/libavutil/avstring.h
vendored
@@ -135,6 +135,7 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_forma
|
||||
/**
|
||||
* Get the count of continuous non zero chars starting from the beginning.
|
||||
*
|
||||
* @param s the string whose length to count
|
||||
* @param len maximum number of characters to check in the string, that
|
||||
* is the maximum value which is returned by the function
|
||||
*/
|
||||
@@ -156,15 +157,6 @@ static inline size_t av_strnlen(const char *s, size_t len)
|
||||
*/
|
||||
char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
|
||||
|
||||
#if FF_API_D2STR
|
||||
/**
|
||||
* Convert a number to an av_malloced string.
|
||||
* @deprecated use av_asprintf() with "%f" or a more specific format
|
||||
*/
|
||||
attribute_deprecated
|
||||
char *av_d2str(double d);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Unescape the given string until a non escaped terminating char,
|
||||
* and return the token corresponding to the unescaped string.
|
||||
|
||||
6
3rdparty/ffmpeg/include/libavutil/avutil.h
vendored
6
3rdparty/ffmpeg/include/libavutil/avutil.h
vendored
@@ -331,12 +331,18 @@ unsigned av_int_list_length_for_size(unsigned elsize,
|
||||
#define av_int_list_length(list, term) \
|
||||
av_int_list_length_for_size(sizeof(*(list)), list, term)
|
||||
|
||||
#if FF_API_AV_FOPEN_UTF8
|
||||
/**
|
||||
* Open a file using a UTF-8 filename.
|
||||
* The API of this function matches POSIX fopen(), errors are returned through
|
||||
* errno.
|
||||
* @deprecated Avoid using it, as on Windows, the FILE* allocated by this
|
||||
* function may be allocated with a different CRT than the caller
|
||||
* who uses the FILE*. No replacement provided in public API.
|
||||
*/
|
||||
attribute_deprecated
|
||||
FILE *av_fopen_utf8(const char *path, const char *mode);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the fractional representation of the internal time base.
|
||||
|
||||
78
3rdparty/ffmpeg/include/libavutil/bprint.h
vendored
78
3rdparty/ffmpeg/include/libavutil/bprint.h
vendored
@@ -18,6 +18,12 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_avbprint
|
||||
* AVBPrint public header
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_BPRINT_H
|
||||
#define AVUTIL_BPRINT_H
|
||||
|
||||
@@ -26,6 +32,14 @@
|
||||
#include "attributes.h"
|
||||
#include "avstring.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_avbprint AVBPrint
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* A buffer to print data progressively
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Define a structure with extra padding to a fixed size
|
||||
* This helps ensuring binary compatibility with future versions.
|
||||
@@ -48,14 +62,14 @@ typedef struct name { \
|
||||
* Small buffers are kept in the structure itself, and thus require no
|
||||
* memory allocation at all (unless the contents of the buffer is needed
|
||||
* after the structure goes out of scope). This is almost as lightweight as
|
||||
* declaring a local "char buf[512]".
|
||||
* declaring a local `char buf[512]`.
|
||||
*
|
||||
* The length of the string can go beyond the allocated size: the buffer is
|
||||
* then truncated, but the functions still keep account of the actual total
|
||||
* length.
|
||||
*
|
||||
* In other words, buf->len can be greater than buf->size and records the
|
||||
* total length of what would have been to the buffer if there had been
|
||||
* In other words, AVBPrint.len can be greater than AVBPrint.size and records
|
||||
* the total length of what would have been to the buffer if there had been
|
||||
* enough memory.
|
||||
*
|
||||
* Append operations do not need to be tested for failure: if a memory
|
||||
@@ -63,20 +77,17 @@ typedef struct name { \
|
||||
* is still updated. This situation can be tested with
|
||||
* av_bprint_is_complete().
|
||||
*
|
||||
* The size_max field determines several possible behaviours:
|
||||
*
|
||||
* size_max = -1 (= UINT_MAX) or any large value will let the buffer be
|
||||
* reallocated as necessary, with an amortized linear cost.
|
||||
*
|
||||
* size_max = 0 prevents writing anything to the buffer: only the total
|
||||
* length is computed. The write operations can then possibly be repeated in
|
||||
* a buffer with exactly the necessary size
|
||||
* (using size_init = size_max = len + 1).
|
||||
*
|
||||
* size_max = 1 is automatically replaced by the exact size available in the
|
||||
* structure itself, thus ensuring no dynamic memory allocation. The
|
||||
* internal buffer is large enough to hold a reasonable paragraph of text,
|
||||
* such as the current paragraph.
|
||||
* The AVBPrint.size_max field determines several possible behaviours:
|
||||
* - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be
|
||||
* reallocated as necessary, with an amortized linear cost.
|
||||
* - `size_max = 0` prevents writing anything to the buffer: only the total
|
||||
* length is computed. The write operations can then possibly be repeated in
|
||||
* a buffer with exactly the necessary size
|
||||
* (using `size_init = size_max = len + 1`).
|
||||
* - `size_max = 1` is automatically replaced by the exact size available in the
|
||||
* structure itself, thus ensuring no dynamic memory allocation. The
|
||||
* internal buffer is large enough to hold a reasonable paragraph of text,
|
||||
* such as the current paragraph.
|
||||
*/
|
||||
|
||||
FF_PAD_STRUCTURE(AVBPrint, 1024,
|
||||
@@ -88,12 +99,31 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
|
||||
)
|
||||
|
||||
/**
|
||||
* @name Max size special values
|
||||
* Convenience macros for special values for av_bprint_init() size_max
|
||||
* parameter.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Buffer will be reallocated as necessary, with an amortized linear cost.
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1)
|
||||
/**
|
||||
* Use the exact size available in the AVBPrint structure itself.
|
||||
*
|
||||
* Thus ensuring no dynamic memory allocation. The internal buffer is large
|
||||
* enough to hold a reasonable paragraph of text, such as the current paragraph.
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_AUTOMATIC 1
|
||||
/**
|
||||
* Do not write anything to the buffer, only calculate the total length.
|
||||
*
|
||||
* The write operations can then possibly be repeated in a buffer with
|
||||
* exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`).
|
||||
*/
|
||||
#define AV_BPRINT_SIZE_COUNT_ONLY 0
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* Init a print buffer.
|
||||
@@ -101,12 +131,12 @@ FF_PAD_STRUCTURE(AVBPrint, 1024,
|
||||
* @param buf buffer to init
|
||||
* @param size_init initial size (including the final 0)
|
||||
* @param size_max maximum size;
|
||||
* 0 means do not write anything, just count the length;
|
||||
* 1 is replaced by the maximum value for automatic storage;
|
||||
* any large value means that the internal buffer will be
|
||||
* reallocated as needed up to that limit; -1 is converted to
|
||||
* UINT_MAX, the largest limit possible.
|
||||
* Check also AV_BPRINT_SIZE_* macros.
|
||||
* - `0` means do not write anything, just count the length
|
||||
* - `1` is replaced by the maximum value for automatic storage
|
||||
* any large value means that the internal buffer will be
|
||||
* reallocated as needed up to that limit
|
||||
* - `-1` is converted to `UINT_MAX`, the largest limit possible.
|
||||
* Check also `AV_BPRINT_SIZE_*` macros.
|
||||
*/
|
||||
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max);
|
||||
|
||||
@@ -216,4 +246,6 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str);
|
||||
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars,
|
||||
enum AVEscapeMode mode, int flags);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* AVUTIL_BPRINT_H */
|
||||
|
||||
2
3rdparty/ffmpeg/include/libavutil/bswap.h
vendored
2
3rdparty/ffmpeg/include/libavutil/bswap.h
vendored
@@ -40,6 +40,8 @@
|
||||
# include "arm/bswap.h"
|
||||
#elif ARCH_AVR32
|
||||
# include "avr32/bswap.h"
|
||||
#elif ARCH_RISCV
|
||||
# include "riscv/bswap.h"
|
||||
#elif ARCH_SH4
|
||||
# include "sh4/bswap.h"
|
||||
#elif ARCH_X86
|
||||
|
||||
37
3rdparty/ffmpeg/include/libavutil/buffer.h
vendored
37
3rdparty/ffmpeg/include/libavutil/buffer.h
vendored
@@ -28,8 +28,6 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_buffer AVBuffer
|
||||
* @ingroup lavu_data
|
||||
@@ -93,11 +91,7 @@ typedef struct AVBufferRef {
|
||||
/**
|
||||
* Size of data in bytes.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size;
|
||||
#else
|
||||
size_t size;
|
||||
#endif
|
||||
} AVBufferRef;
|
||||
|
||||
/**
|
||||
@@ -105,21 +99,13 @@ typedef struct AVBufferRef {
|
||||
*
|
||||
* @return an AVBufferRef of given size or NULL when out of memory
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
AVBufferRef *av_buffer_alloc(int size);
|
||||
#else
|
||||
AVBufferRef *av_buffer_alloc(size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Same as av_buffer_alloc(), except the returned buffer will be initialized
|
||||
* to zero.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
AVBufferRef *av_buffer_allocz(int size);
|
||||
#else
|
||||
AVBufferRef *av_buffer_allocz(size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Always treat the buffer as read-only, even when it has only one
|
||||
@@ -142,11 +128,7 @@ AVBufferRef *av_buffer_allocz(size_t size);
|
||||
*
|
||||
* @return an AVBufferRef referring to data on success, NULL on failure.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
AVBufferRef *av_buffer_create(uint8_t *data, int size,
|
||||
#else
|
||||
AVBufferRef *av_buffer_create(uint8_t *data, size_t size,
|
||||
#endif
|
||||
void (*free)(void *opaque, uint8_t *data),
|
||||
void *opaque, int flags);
|
||||
|
||||
@@ -163,7 +145,7 @@ void av_buffer_default_free(void *opaque, uint8_t *data);
|
||||
* @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
|
||||
* failure.
|
||||
*/
|
||||
AVBufferRef *av_buffer_ref(AVBufferRef *buf);
|
||||
AVBufferRef *av_buffer_ref(const AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* Free a given reference and automatically free the buffer if there are no more
|
||||
@@ -214,11 +196,7 @@ int av_buffer_make_writable(AVBufferRef **buf);
|
||||
* reference to it (i.e. the one passed to this function). In all other cases
|
||||
* a new buffer is allocated and the data is copied.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int av_buffer_realloc(AVBufferRef **buf, int size);
|
||||
#else
|
||||
int av_buffer_realloc(AVBufferRef **buf, size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Ensure dst refers to the same data as src.
|
||||
@@ -234,7 +212,7 @@ int av_buffer_realloc(AVBufferRef **buf, size_t size);
|
||||
* @return 0 on success
|
||||
* AVERROR(ENOMEM) on memory allocation failure.
|
||||
*/
|
||||
int av_buffer_replace(AVBufferRef **dst, AVBufferRef *src);
|
||||
int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src);
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -285,11 +263,7 @@ typedef struct AVBufferPool AVBufferPool;
|
||||
* (av_buffer_alloc()).
|
||||
* @return newly created buffer pool on success, NULL on error.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size));
|
||||
#else
|
||||
AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size));
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocate and initialize a buffer pool with a more complex allocator.
|
||||
@@ -306,13 +280,8 @@ AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size
|
||||
* data. May be NULL.
|
||||
* @return newly created buffer pool on success, NULL on error.
|
||||
*/
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
AVBufferPool *av_buffer_pool_init2(int size, void *opaque,
|
||||
AVBufferRef* (*alloc)(void *opaque, int size),
|
||||
#else
|
||||
AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
|
||||
AVBufferRef* (*alloc)(void *opaque, size_t size),
|
||||
#endif
|
||||
void (*pool_free)(void *opaque));
|
||||
|
||||
/**
|
||||
@@ -344,7 +313,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
|
||||
* therefore you have to use this function to access the original opaque
|
||||
* parameter of an allocated buffer.
|
||||
*/
|
||||
void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref);
|
||||
void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
2
3rdparty/ffmpeg/include/libavutil/camellia.h
vendored
2
3rdparty/ffmpeg/include/libavutil/camellia.h
vendored
@@ -59,7 +59,7 @@ int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
|
||||
* @param dst destination array, can be equal to src
|
||||
* @param src source array, can be equal to dst
|
||||
* @param count number of 16 byte blocks
|
||||
* @paran iv initialization vector for CBC mode, NULL for ECB mode
|
||||
* @param iv initialization vector for CBC mode, NULL for ECB mode
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
*/
|
||||
void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
|
||||
|
||||
615
3rdparty/ffmpeg/include/libavutil/channel_layout.h
vendored
615
3rdparty/ffmpeg/include/libavutil/channel_layout.h
vendored
@@ -23,17 +23,132 @@
|
||||
#define AVUTIL_CHANNEL_LAYOUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "version.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* audio channel layout utility functions
|
||||
* @ingroup lavu_audio_channels
|
||||
* Public libavutil channel layout APIs header.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio
|
||||
* @defgroup lavu_audio_channels Audio channels
|
||||
* @ingroup lavu_audio
|
||||
*
|
||||
* Audio channel layout utility functions
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVChannel {
|
||||
///< Invalid channel index
|
||||
AV_CHAN_NONE = -1,
|
||||
AV_CHAN_FRONT_LEFT,
|
||||
AV_CHAN_FRONT_RIGHT,
|
||||
AV_CHAN_FRONT_CENTER,
|
||||
AV_CHAN_LOW_FREQUENCY,
|
||||
AV_CHAN_BACK_LEFT,
|
||||
AV_CHAN_BACK_RIGHT,
|
||||
AV_CHAN_FRONT_LEFT_OF_CENTER,
|
||||
AV_CHAN_FRONT_RIGHT_OF_CENTER,
|
||||
AV_CHAN_BACK_CENTER,
|
||||
AV_CHAN_SIDE_LEFT,
|
||||
AV_CHAN_SIDE_RIGHT,
|
||||
AV_CHAN_TOP_CENTER,
|
||||
AV_CHAN_TOP_FRONT_LEFT,
|
||||
AV_CHAN_TOP_FRONT_CENTER,
|
||||
AV_CHAN_TOP_FRONT_RIGHT,
|
||||
AV_CHAN_TOP_BACK_LEFT,
|
||||
AV_CHAN_TOP_BACK_CENTER,
|
||||
AV_CHAN_TOP_BACK_RIGHT,
|
||||
/** Stereo downmix. */
|
||||
AV_CHAN_STEREO_LEFT = 29,
|
||||
/** See above. */
|
||||
AV_CHAN_STEREO_RIGHT,
|
||||
AV_CHAN_WIDE_LEFT,
|
||||
AV_CHAN_WIDE_RIGHT,
|
||||
AV_CHAN_SURROUND_DIRECT_LEFT,
|
||||
AV_CHAN_SURROUND_DIRECT_RIGHT,
|
||||
AV_CHAN_LOW_FREQUENCY_2,
|
||||
AV_CHAN_TOP_SIDE_LEFT,
|
||||
AV_CHAN_TOP_SIDE_RIGHT,
|
||||
AV_CHAN_BOTTOM_FRONT_CENTER,
|
||||
AV_CHAN_BOTTOM_FRONT_LEFT,
|
||||
AV_CHAN_BOTTOM_FRONT_RIGHT,
|
||||
|
||||
/** Channel is empty can be safely skipped. */
|
||||
AV_CHAN_UNUSED = 0x200,
|
||||
|
||||
/** Channel contains data, but its position is unknown. */
|
||||
AV_CHAN_UNKNOWN = 0x300,
|
||||
|
||||
/**
|
||||
* Range of channels between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system.
|
||||
*
|
||||
* Given a channel id `<i>` between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `<n>` is
|
||||
* `<n> = <i> - AV_CHAN_AMBISONIC_BASE`.
|
||||
*
|
||||
* @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel
|
||||
* orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels
|
||||
* implicitly by their position in the stream.
|
||||
*/
|
||||
AV_CHAN_AMBISONIC_BASE = 0x400,
|
||||
// leave space for 1024 ids, which correspond to maximum order-32 harmonics,
|
||||
// which should be enough for the foreseeable use cases
|
||||
AV_CHAN_AMBISONIC_END = 0x7ff,
|
||||
};
|
||||
|
||||
enum AVChannelOrder {
|
||||
/**
|
||||
* Only the channel count is specified, without any further information
|
||||
* about the channel order.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_UNSPEC,
|
||||
/**
|
||||
* The native channel order, i.e. the channels are in the same order in
|
||||
* which they are defined in the AVChannel enum. This supports up to 63
|
||||
* different channels.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_NATIVE,
|
||||
/**
|
||||
* The channel order does not correspond to any other predefined order and
|
||||
* is stored as an explicit map. For example, this could be used to support
|
||||
* layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE)
|
||||
* channels at arbitrary positions.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_CUSTOM,
|
||||
/**
|
||||
* The audio is represented as the decomposition of the sound field into
|
||||
* spherical harmonics. Each channel corresponds to a single expansion
|
||||
* component. Channels are ordered according to ACN (Ambisonic Channel
|
||||
* Number).
|
||||
*
|
||||
* The channel with the index n in the stream contains the spherical
|
||||
* harmonic of degree l and order m given by
|
||||
* @code{.unparsed}
|
||||
* l = floor(sqrt(n)),
|
||||
* m = n - l * (l + 1).
|
||||
* @endcode
|
||||
*
|
||||
* Conversely given a spherical harmonic of degree l and order m, the
|
||||
* corresponding channel index n is given by
|
||||
* @code{.unparsed}
|
||||
* n = l * (l + 1) + m.
|
||||
* @endcode
|
||||
*
|
||||
* Normalization is assumed to be SN3D (Schmidt Semi-Normalization)
|
||||
* as defined in AmbiX format $ 2.1.
|
||||
*/
|
||||
AV_CHANNEL_ORDER_AMBISONIC,
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks
|
||||
*
|
||||
@@ -46,41 +161,46 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define AV_CH_FRONT_LEFT 0x00000001
|
||||
#define AV_CH_FRONT_RIGHT 0x00000002
|
||||
#define AV_CH_FRONT_CENTER 0x00000004
|
||||
#define AV_CH_LOW_FREQUENCY 0x00000008
|
||||
#define AV_CH_BACK_LEFT 0x00000010
|
||||
#define AV_CH_BACK_RIGHT 0x00000020
|
||||
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define AV_CH_BACK_CENTER 0x00000100
|
||||
#define AV_CH_SIDE_LEFT 0x00000200
|
||||
#define AV_CH_SIDE_RIGHT 0x00000400
|
||||
#define AV_CH_TOP_CENTER 0x00000800
|
||||
#define AV_CH_TOP_FRONT_LEFT 0x00001000
|
||||
#define AV_CH_TOP_FRONT_CENTER 0x00002000
|
||||
#define AV_CH_TOP_FRONT_RIGHT 0x00004000
|
||||
#define AV_CH_TOP_BACK_LEFT 0x00008000
|
||||
#define AV_CH_TOP_BACK_CENTER 0x00010000
|
||||
#define AV_CH_TOP_BACK_RIGHT 0x00020000
|
||||
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
|
||||
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
|
||||
#define AV_CH_WIDE_LEFT 0x0000000080000000ULL
|
||||
#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL
|
||||
#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL
|
||||
#define AV_CH_TOP_SIDE_LEFT 0x0000001000000000ULL
|
||||
#define AV_CH_TOP_SIDE_RIGHT 0x0000002000000000ULL
|
||||
#define AV_CH_BOTTOM_FRONT_CENTER 0x0000004000000000ULL
|
||||
#define AV_CH_BOTTOM_FRONT_LEFT 0x0000008000000000ULL
|
||||
#define AV_CH_BOTTOM_FRONT_RIGHT 0x0000010000000000ULL
|
||||
#define AV_CH_FRONT_LEFT (1ULL << AV_CHAN_FRONT_LEFT )
|
||||
#define AV_CH_FRONT_RIGHT (1ULL << AV_CHAN_FRONT_RIGHT )
|
||||
#define AV_CH_FRONT_CENTER (1ULL << AV_CHAN_FRONT_CENTER )
|
||||
#define AV_CH_LOW_FREQUENCY (1ULL << AV_CHAN_LOW_FREQUENCY )
|
||||
#define AV_CH_BACK_LEFT (1ULL << AV_CHAN_BACK_LEFT )
|
||||
#define AV_CH_BACK_RIGHT (1ULL << AV_CHAN_BACK_RIGHT )
|
||||
#define AV_CH_FRONT_LEFT_OF_CENTER (1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER )
|
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER (1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_BACK_CENTER (1ULL << AV_CHAN_BACK_CENTER )
|
||||
#define AV_CH_SIDE_LEFT (1ULL << AV_CHAN_SIDE_LEFT )
|
||||
#define AV_CH_SIDE_RIGHT (1ULL << AV_CHAN_SIDE_RIGHT )
|
||||
#define AV_CH_TOP_CENTER (1ULL << AV_CHAN_TOP_CENTER )
|
||||
#define AV_CH_TOP_FRONT_LEFT (1ULL << AV_CHAN_TOP_FRONT_LEFT )
|
||||
#define AV_CH_TOP_FRONT_CENTER (1ULL << AV_CHAN_TOP_FRONT_CENTER )
|
||||
#define AV_CH_TOP_FRONT_RIGHT (1ULL << AV_CHAN_TOP_FRONT_RIGHT )
|
||||
#define AV_CH_TOP_BACK_LEFT (1ULL << AV_CHAN_TOP_BACK_LEFT )
|
||||
#define AV_CH_TOP_BACK_CENTER (1ULL << AV_CHAN_TOP_BACK_CENTER )
|
||||
#define AV_CH_TOP_BACK_RIGHT (1ULL << AV_CHAN_TOP_BACK_RIGHT )
|
||||
#define AV_CH_STEREO_LEFT (1ULL << AV_CHAN_STEREO_LEFT )
|
||||
#define AV_CH_STEREO_RIGHT (1ULL << AV_CHAN_STEREO_RIGHT )
|
||||
#define AV_CH_WIDE_LEFT (1ULL << AV_CHAN_WIDE_LEFT )
|
||||
#define AV_CH_WIDE_RIGHT (1ULL << AV_CHAN_WIDE_RIGHT )
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT (1ULL << AV_CHAN_SURROUND_DIRECT_LEFT )
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT (1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT)
|
||||
#define AV_CH_LOW_FREQUENCY_2 (1ULL << AV_CHAN_LOW_FREQUENCY_2 )
|
||||
#define AV_CH_TOP_SIDE_LEFT (1ULL << AV_CHAN_TOP_SIDE_LEFT )
|
||||
#define AV_CH_TOP_SIDE_RIGHT (1ULL << AV_CHAN_TOP_SIDE_RIGHT )
|
||||
#define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER )
|
||||
#define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT )
|
||||
#define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT )
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/** Channel mask value used for AVCodecContext.request_channel_layout
|
||||
to indicate that the user requests the channel order of the decoder output
|
||||
to be the native codec channel order. */
|
||||
to be the native codec channel order.
|
||||
@deprecated channel order is now indicated in a special field in
|
||||
AVChannelLayout
|
||||
*/
|
||||
#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -112,7 +232,9 @@
|
||||
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_TOP_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
|
||||
#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT)
|
||||
@@ -128,6 +250,164 @@ enum AVMatrixEncoding {
|
||||
AV_MATRIX_ENCODING_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* An AVChannelCustom defines a single channel within a custom order layout
|
||||
*
|
||||
* Unlike most structures in FFmpeg, sizeof(AVChannelCustom) is a part of the
|
||||
* public ABI.
|
||||
*
|
||||
* No new fields may be added to it without a major version bump.
|
||||
*/
|
||||
typedef struct AVChannelCustom {
|
||||
enum AVChannel id;
|
||||
char name[16];
|
||||
void *opaque;
|
||||
} AVChannelCustom;
|
||||
|
||||
/**
|
||||
* An AVChannelLayout holds information about the channel layout of audio data.
|
||||
*
|
||||
* A channel layout here is defined as a set of channels ordered in a specific
|
||||
* way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
|
||||
* AVChannelLayout carries only the channel count).
|
||||
* All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
|
||||
* ignoring everything but the channel count, as long as av_channel_layout_check()
|
||||
* considers they are valid.
|
||||
*
|
||||
* Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the
|
||||
* public ABI and may be used by the caller. E.g. it may be allocated on stack
|
||||
* or embedded in caller-defined structs.
|
||||
*
|
||||
* AVChannelLayout can be initialized as follows:
|
||||
* - default initialization with {0}, followed by setting all used fields
|
||||
* correctly;
|
||||
* - by assigning one of the predefined AV_CHANNEL_LAYOUT_* initializers;
|
||||
* - with a constructor function, such as av_channel_layout_default(),
|
||||
* av_channel_layout_from_mask() or av_channel_layout_from_string().
|
||||
*
|
||||
* The channel layout must be unitialized with av_channel_layout_uninit()
|
||||
*
|
||||
* Copying an AVChannelLayout via assigning is forbidden,
|
||||
* av_channel_layout_copy() must be used instead (and its return value should
|
||||
* be checked)
|
||||
*
|
||||
* No new fields may be added to it without a major version bump, except for
|
||||
* new elements of the union fitting in sizeof(uint64_t).
|
||||
*/
|
||||
typedef struct AVChannelLayout {
|
||||
/**
|
||||
* Channel order used in this layout.
|
||||
* This is a mandatory field.
|
||||
*/
|
||||
enum AVChannelOrder order;
|
||||
|
||||
/**
|
||||
* Number of channels in this layout. Mandatory field.
|
||||
*/
|
||||
int nb_channels;
|
||||
|
||||
/**
|
||||
* Details about which channels are present in this layout.
|
||||
* For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not be
|
||||
* used.
|
||||
*/
|
||||
union {
|
||||
/**
|
||||
* This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used
|
||||
* for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
|
||||
* It is a bitmask, where the position of each set bit means that the
|
||||
* AVChannel with the corresponding value is present.
|
||||
*
|
||||
* I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO
|
||||
* is present in the layout. Otherwise it is not present.
|
||||
*
|
||||
* @note when a channel layout using a bitmask is constructed or
|
||||
* modified manually (i.e. not using any of the av_channel_layout_*
|
||||
* functions), the code doing it must ensure that the number of set bits
|
||||
* is equal to nb_channels.
|
||||
*/
|
||||
uint64_t mask;
|
||||
/**
|
||||
* This member must be used when the channel order is
|
||||
* AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each
|
||||
* element signalling the presence of the AVChannel with the
|
||||
* corresponding value in map[i].id.
|
||||
*
|
||||
* I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the
|
||||
* i-th channel in the audio data.
|
||||
*
|
||||
* When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and
|
||||
* AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic
|
||||
* component with ACN index (as defined above)
|
||||
* n = map[i].id - AV_CHAN_AMBISONIC_BASE.
|
||||
*
|
||||
* map[i].name may be filled with a 0-terminated string, in which case
|
||||
* it will be used for the purpose of identifying the channel with the
|
||||
* convenience functions below. Otherise it must be zeroed.
|
||||
*/
|
||||
AVChannelCustom *map;
|
||||
} u;
|
||||
|
||||
/**
|
||||
* For some private data of the user.
|
||||
*/
|
||||
void *opaque;
|
||||
} AVChannelLayout;
|
||||
|
||||
#define AV_CHANNEL_LAYOUT_MASK(nb, m) \
|
||||
{ .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }}
|
||||
|
||||
/**
|
||||
* @name Common pre-defined channel layouts
|
||||
* @{
|
||||
*/
|
||||
#define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO)
|
||||
#define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO)
|
||||
#define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_2_1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2_1)
|
||||
#define AV_CHANNEL_LAYOUT_SURROUND AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_SURROUND)
|
||||
#define AV_CHANNEL_LAYOUT_3POINT1 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_3POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_4POINT0 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_4POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_4POINT1 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_4POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_2_2 AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_2_2)
|
||||
#define AV_CHANNEL_LAYOUT_QUAD AV_CHANNEL_LAYOUT_MASK(4, AV_CH_LAYOUT_QUAD)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT0 AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT0_BACK AV_CHANNEL_LAYOUT_MASK(5, AV_CH_LAYOUT_5POINT0_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_6POINT1_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT0 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_7POINT0_FRONT)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_TOP_BACK)
|
||||
#define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE)
|
||||
#define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL)
|
||||
#define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX)
|
||||
#define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2)
|
||||
#define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \
|
||||
{ .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }}
|
||||
/** @} */
|
||||
|
||||
struct AVBPrint;
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* @name Deprecated Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, or 0 if no match is found.
|
||||
*
|
||||
@@ -144,7 +424,10 @@ enum AVMatrixEncoding {
|
||||
* AV_CH_* macros).
|
||||
*
|
||||
* Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7"
|
||||
*
|
||||
* @deprecated use av_channel_layout_from_string()
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint64_t av_get_channel_layout(const char *name);
|
||||
|
||||
/**
|
||||
@@ -158,7 +441,9 @@ uint64_t av_get_channel_layout(const char *name);
|
||||
* @param[out] nb_channels number of channels
|
||||
*
|
||||
* @return 0 on success, AVERROR(EINVAL) if the parsing fails.
|
||||
* @deprecated use av_channel_layout_from_string()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels);
|
||||
|
||||
/**
|
||||
@@ -167,47 +452,66 @@ int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, i
|
||||
*
|
||||
* @param buf put here the string containing the channel layout
|
||||
* @param buf_size size in bytes of the buffer
|
||||
* @param nb_channels number of channels
|
||||
* @param channel_layout channel layout bitset
|
||||
* @deprecated use av_channel_layout_describe()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
struct AVBPrint;
|
||||
/**
|
||||
* Append a description of a channel layout to a bprint buffer.
|
||||
* @deprecated use av_channel_layout_describe()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return the number of channels in the channel layout.
|
||||
* @deprecated use AVChannelLayout.nb_channels
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_get_channel_layout_nb_channels(uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return default channel layout for a given number of channels.
|
||||
*
|
||||
* @deprecated use av_channel_layout_default()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t av_get_default_channel_layout(int nb_channels);
|
||||
|
||||
/**
|
||||
* Get the index of a channel in channel_layout.
|
||||
*
|
||||
* @param channel_layout channel layout bitset
|
||||
* @param channel a channel layout describing exactly one channel which must be
|
||||
* present in channel_layout.
|
||||
*
|
||||
* @return index of channel in channel_layout on success, a negative AVERROR
|
||||
* on error.
|
||||
*
|
||||
* @deprecated use av_channel_layout_index_from_channel()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
||||
uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the channel with the given index in channel_layout.
|
||||
* @deprecated use av_channel_layout_channel_from_index()
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
|
||||
|
||||
/**
|
||||
* Get the name of a given channel.
|
||||
*
|
||||
* @return channel name on success, NULL on error.
|
||||
*
|
||||
* @deprecated use av_channel_name()
|
||||
*/
|
||||
attribute_deprecated
|
||||
const char *av_get_channel_name(uint64_t channel);
|
||||
|
||||
/**
|
||||
@@ -215,7 +519,9 @@ const char *av_get_channel_name(uint64_t channel);
|
||||
*
|
||||
* @param channel a channel layout with a single channel
|
||||
* @return channel description on success, NULL on error
|
||||
* @deprecated use av_channel_description()
|
||||
*/
|
||||
attribute_deprecated
|
||||
const char *av_get_channel_description(uint64_t channel);
|
||||
|
||||
/**
|
||||
@@ -226,12 +532,251 @@ const char *av_get_channel_description(uint64_t channel);
|
||||
* @param[out] name name of the layout
|
||||
* @return 0 if the layout exists,
|
||||
* <0 if index is beyond the limits
|
||||
* @deprecated use av_channel_layout_standard()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
|
||||
const char **name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get a human readable string in an abbreviated form describing a given channel.
|
||||
* This is the inverse function of @ref av_channel_from_string().
|
||||
*
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @param channel the AVChannel whose name to get
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_name(char *buf, size_t buf_size, enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_name().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
*/
|
||||
void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
|
||||
|
||||
/**
|
||||
* Get a human readable string describing a given channel.
|
||||
*
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @param channel the AVChannel whose description to get
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_description(char *buf, size_t buf_size, enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_description().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
*/
|
||||
void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_id);
|
||||
|
||||
/**
|
||||
* This is the inverse function of @ref av_channel_name().
|
||||
*
|
||||
* @return the channel with the given name
|
||||
* AV_CHAN_NONE when name does not identify a known channel
|
||||
*/
|
||||
enum AVChannel av_channel_from_string(const char *name);
|
||||
|
||||
/**
|
||||
* Initialize a native channel layout from a bitmask indicating which channels
|
||||
* are present.
|
||||
*
|
||||
* @param channel_layout the layout structure to be initialized
|
||||
* @param mask bitmask describing the channel layout
|
||||
*
|
||||
* @return 0 on success
|
||||
* AVERROR(EINVAL) for invalid mask values
|
||||
*/
|
||||
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask);
|
||||
|
||||
/**
|
||||
* Initialize a channel layout from a given string description.
|
||||
* The input string can be represented by:
|
||||
* - the formal channel layout name (returned by av_channel_layout_describe())
|
||||
* - single or multiple channel names (returned by av_channel_name(), eg. "FL",
|
||||
* or concatenated with "+", each optionally containing a custom name after
|
||||
* a "@", eg. "FL@Left+FR@Right+LFE")
|
||||
* - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4")
|
||||
* - the number of channels with default layout (eg. "4c")
|
||||
* - the number of unordered channels (eg. "4C" or "4 channels")
|
||||
* - the ambisonic order followed by optional non-diegetic channels (eg.
|
||||
* "ambisonic 2+stereo")
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param str string describing the channel layout
|
||||
* @return 0 channel layout was detected, AVERROR_INVALIDATATA otherwise
|
||||
*/
|
||||
int av_channel_layout_from_string(AVChannelLayout *channel_layout,
|
||||
const char *str);
|
||||
|
||||
/**
|
||||
* Get the default channel layout for a given number of channels.
|
||||
*
|
||||
* @param ch_layout the layout structure to be initialized
|
||||
* @param nb_channels number of channels
|
||||
*/
|
||||
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels);
|
||||
|
||||
/**
|
||||
* Iterate over all standard channel layouts.
|
||||
*
|
||||
* @param opaque a pointer where libavutil will store the iteration state. Must
|
||||
* point to NULL to start the iteration.
|
||||
*
|
||||
* @return the standard channel layout or NULL when the iteration is
|
||||
* finished
|
||||
*/
|
||||
const AVChannelLayout *av_channel_layout_standard(void **opaque);
|
||||
|
||||
/**
|
||||
* Free any allocated data in the channel layout and reset the channel
|
||||
* count to 0.
|
||||
*
|
||||
* @param channel_layout the layout structure to be uninitialized
|
||||
*/
|
||||
void av_channel_layout_uninit(AVChannelLayout *channel_layout);
|
||||
|
||||
/**
|
||||
* Make a copy of a channel layout. This differs from just assigning src to dst
|
||||
* in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM.
|
||||
*
|
||||
* @note the destination channel_layout will be always uninitialized before copy.
|
||||
*
|
||||
* @param dst destination channel layout
|
||||
* @param src source channel layout
|
||||
* @return 0 on success, a negative AVERROR on error.
|
||||
*/
|
||||
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src);
|
||||
|
||||
/**
|
||||
* Get a human-readable string describing the channel layout properties.
|
||||
* The string will be in the same format that is accepted by
|
||||
* @ref av_channel_layout_from_string(), allowing to rebuild the same
|
||||
* channel layout, except for opaque pointers.
|
||||
*
|
||||
* @param channel_layout channel layout to be described
|
||||
* @param buf pre-allocated buffer where to put the generated string
|
||||
* @param buf_size size in bytes of the buffer.
|
||||
* @return amount of bytes needed to hold the output string, or a negative AVERROR
|
||||
* on failure. If the returned value is bigger than buf_size, then the
|
||||
* string was truncated.
|
||||
*/
|
||||
int av_channel_layout_describe(const AVChannelLayout *channel_layout,
|
||||
char *buf, size_t buf_size);
|
||||
|
||||
/**
|
||||
* bprint variant of av_channel_layout_describe().
|
||||
*
|
||||
* @note the string will be appended to the bprint buffer.
|
||||
* @return 0 on success, or a negative AVERROR value on failure.
|
||||
*/
|
||||
int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout,
|
||||
struct AVBPrint *bp);
|
||||
|
||||
/**
|
||||
* Get the channel with the given index in a channel layout.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param idx index of the channel
|
||||
* @return channel with the index idx in channel_layout on success or
|
||||
* AV_CHAN_NONE on failure (if idx is not valid or the channel order is
|
||||
* unspecified)
|
||||
*/
|
||||
enum AVChannel
|
||||
av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx);
|
||||
|
||||
/**
|
||||
* Get the index of a given channel in a channel layout. In case multiple
|
||||
* channels are found, only the first match will be returned.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param channel the channel whose index to obtain
|
||||
* @return index of channel in channel_layout on success or a negative number if
|
||||
* channel is not present in channel_layout.
|
||||
*/
|
||||
int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout,
|
||||
enum AVChannel channel);
|
||||
|
||||
/**
|
||||
* Get the index in a channel layout of a channel described by the given string.
|
||||
* In case multiple channels are found, only the first match will be returned.
|
||||
*
|
||||
* This function accepts channel names in the same format as
|
||||
* @ref av_channel_from_string().
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param name string describing the channel whose index to obtain
|
||||
* @return a channel index described by the given string, or a negative AVERROR
|
||||
* value.
|
||||
*/
|
||||
int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Get a channel described by the given string.
|
||||
*
|
||||
* This function accepts channel names in the same format as
|
||||
* @ref av_channel_from_string().
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param name string describing the channel to obtain
|
||||
* @return a channel described by the given string in channel_layout on success
|
||||
* or AV_CHAN_NONE on failure (if the string is not valid or the channel
|
||||
* order is unspecified)
|
||||
*/
|
||||
enum AVChannel
|
||||
av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout,
|
||||
const char *name);
|
||||
|
||||
/**
|
||||
* Find out what channels from a given set are present in a channel layout,
|
||||
* without regard for their positions.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @param mask a combination of AV_CH_* representing a set of channels
|
||||
* @return a bitfield representing all the channels from mask that are present
|
||||
* in channel_layout
|
||||
*/
|
||||
uint64_t av_channel_layout_subset(const AVChannelLayout *channel_layout,
|
||||
uint64_t mask);
|
||||
|
||||
/**
|
||||
* Check whether a channel layout is valid, i.e. can possibly describe audio
|
||||
* data.
|
||||
*
|
||||
* @param channel_layout input channel layout
|
||||
* @return 1 if channel_layout is valid, 0 otherwise.
|
||||
*/
|
||||
int av_channel_layout_check(const AVChannelLayout *channel_layout);
|
||||
|
||||
/**
|
||||
* Check whether two channel layouts are semantically the same, i.e. the same
|
||||
* channels are present on the same positions in both.
|
||||
*
|
||||
* If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the other is
|
||||
* not, they are considered to be unequal. If both are AV_CHANNEL_ORDER_UNSPEC,
|
||||
* they are considered equal iff the channel counts are the same in both.
|
||||
*
|
||||
* @param chl input channel layout
|
||||
* @param chl1 input channel layout
|
||||
* @return 0 if chl and chl1 are equal, 1 if they are not equal. A negative
|
||||
* AVERROR code if one or both are invalid.
|
||||
*/
|
||||
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
42
3rdparty/ffmpeg/include/libavutil/common.h
vendored
42
3rdparty/ffmpeg/include/libavutil/common.h
vendored
@@ -41,14 +41,6 @@
|
||||
|
||||
#include "attributes.h"
|
||||
#include "macros.h"
|
||||
#include "version.h"
|
||||
#include "libavutil/avconfig.h"
|
||||
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
# define AV_NE(be, le) (be)
|
||||
#else
|
||||
# define AV_NE(be, le) (le)
|
||||
#endif
|
||||
|
||||
//rounded division & shift
|
||||
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
|
||||
@@ -89,25 +81,6 @@
|
||||
#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
|
||||
#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))
|
||||
|
||||
/**
|
||||
* Comparator.
|
||||
* For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
|
||||
* if x == y. This is useful for instance in a qsort comparator callback.
|
||||
* Furthermore, compilers are able to optimize this to branchless code, and
|
||||
* there is no risk of overflow with signed types.
|
||||
* As with many macros, this evaluates its argument multiple times, it thus
|
||||
* must not have a side-effect.
|
||||
*/
|
||||
#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
|
||||
|
||||
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
|
||||
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
|
||||
#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
|
||||
|
||||
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
|
||||
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
/* misc math functions */
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
@@ -405,6 +378,8 @@ static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) {
|
||||
|
||||
/**
|
||||
* Clip a float value into the amin-amax range.
|
||||
* If a is nan or -inf amin will be returned.
|
||||
* If a is +inf amax will be returned.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
@@ -415,13 +390,13 @@ static av_always_inline av_const float av_clipf_c(float a, float amin, float ama
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
return FFMIN(FFMAX(a, amin), amax);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a double value into the amin-amax range.
|
||||
* If a is nan or -inf amin will be returned.
|
||||
* If a is +inf amax will be returned.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
@@ -432,9 +407,7 @@ static av_always_inline av_const double av_clipd_c(double a, double amin, double
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
return FFMIN(FFMAX(a, amin), amax);
|
||||
}
|
||||
|
||||
/** Compute ceil(log2(x)).
|
||||
@@ -475,9 +448,6 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
|
||||
return av_popcount(v) & 1;
|
||||
}
|
||||
|
||||
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
|
||||
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
|
||||
|
||||
/**
|
||||
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
|
||||
*
|
||||
|
||||
43
3rdparty/ffmpeg/include/libavutil/cpu.h
vendored
43
3rdparty/ffmpeg/include/libavutil/cpu.h
vendored
@@ -23,8 +23,6 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "attributes.h"
|
||||
|
||||
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
|
||||
|
||||
/* lower 16 bits - CPU features */
|
||||
@@ -56,6 +54,8 @@
|
||||
#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
|
||||
#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
|
||||
#define AV_CPU_FLAG_AVX512 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used
|
||||
#define AV_CPU_FLAG_AVX512ICL 0x200000 ///< F/CD/BW/DQ/VL/VNNI/IFMA/VBMI/VBMI2/VPOPCNTDQ/BITALG/GFNI/VAES/VPCLMULQDQ
|
||||
#define AV_CPU_FLAG_SLOW_GATHER 0x2000000 ///< CPU has slow gathers.
|
||||
|
||||
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
|
||||
#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
|
||||
@@ -74,6 +74,20 @@
|
||||
#define AV_CPU_FLAG_MMI (1 << 0)
|
||||
#define AV_CPU_FLAG_MSA (1 << 1)
|
||||
|
||||
//Loongarch SIMD extension.
|
||||
#define AV_CPU_FLAG_LSX (1 << 0)
|
||||
#define AV_CPU_FLAG_LASX (1 << 1)
|
||||
|
||||
// RISC-V extensions
|
||||
#define AV_CPU_FLAG_RVI (1 << 0) ///< I (full GPR bank)
|
||||
#define AV_CPU_FLAG_RVF (1 << 1) ///< F (single precision FP)
|
||||
#define AV_CPU_FLAG_RVD (1 << 2) ///< D (double precision FP)
|
||||
#define AV_CPU_FLAG_RVV_I32 (1 << 3) ///< Vectors of 8/16/32-bit int's */
|
||||
#define AV_CPU_FLAG_RVV_F32 (1 << 4) ///< Vectors of float's */
|
||||
#define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */
|
||||
#define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's
|
||||
#define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations
|
||||
|
||||
/**
|
||||
* Return the flags which specify extensions supported by the CPU.
|
||||
* The returned value is affected by av_force_cpu_flags() if that was used
|
||||
@@ -88,25 +102,6 @@ int av_get_cpu_flags(void);
|
||||
*/
|
||||
void av_force_cpu_flags(int flags);
|
||||
|
||||
/**
|
||||
* Set a mask on flags returned by av_get_cpu_flags().
|
||||
* This function is mainly useful for testing.
|
||||
* Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
|
||||
*/
|
||||
attribute_deprecated void av_set_cpu_flags_mask(int mask);
|
||||
|
||||
/**
|
||||
* Parse CPU flags from a string.
|
||||
*
|
||||
* The returned flags contain the specified flags as well as related unspecified flags.
|
||||
*
|
||||
* This function exists only for compatibility with libav.
|
||||
* Please use av_parse_cpu_caps() when possible.
|
||||
* @return a combination of AV_CPU_* flags, negative on error.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_parse_cpu_flags(const char *s);
|
||||
|
||||
/**
|
||||
* Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
|
||||
*
|
||||
@@ -119,6 +114,12 @@ int av_parse_cpu_caps(unsigned *flags, const char *s);
|
||||
*/
|
||||
int av_cpu_count(void);
|
||||
|
||||
/**
|
||||
* Overrides cpu count detection and forces the specified count.
|
||||
* Count < 1 disables forcing of specific count.
|
||||
*/
|
||||
void av_cpu_force_count(int count);
|
||||
|
||||
/**
|
||||
* Get the maximum data alignment that may be required by FFmpeg.
|
||||
*
|
||||
|
||||
4
3rdparty/ffmpeg/include/libavutil/crc.h
vendored
4
3rdparty/ffmpeg/include/libavutil/crc.h
vendored
@@ -30,7 +30,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_crc32 CRC
|
||||
@@ -85,7 +84,10 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id);
|
||||
|
||||
/**
|
||||
* Calculate the CRC of a block.
|
||||
* @param ctx initialized AVCRC array (see av_crc_init())
|
||||
* @param crc CRC of previous blocks if any or initial value for CRC
|
||||
* @param buffer buffer whose CRC to calculate
|
||||
* @param length length of the buffer
|
||||
* @return CRC updated with the data from the given block
|
||||
*
|
||||
* @see av_crc_init() "le" parameter
|
||||
|
||||
150
3rdparty/ffmpeg/include/libavutil/csp.h
vendored
Normal file
150
3rdparty/ffmpeg/include/libavutil/csp.h
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Kevin Wheatley <kevin.j.wheatley@gmail.com>
|
||||
* Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com>
|
||||
* Copyright (c) 2023 Leo Izen <leo.izen@gmail.com>
|
||||
*
|
||||
* 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 AVUTIL_CSP_H
|
||||
#define AVUTIL_CSP_H
|
||||
|
||||
#include "pixfmt.h"
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Colorspace value utility functions for libavutil.
|
||||
* @ingroup lavu_math_csp
|
||||
* @author Ronald S. Bultje <rsbultje@gmail.com>
|
||||
* @author Leo Izen <leo.izen@gmail.com>
|
||||
* @author Kevin Wheatley <kevin.j.wheatley@gmail.com>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavu_math_csp Colorspace Utility
|
||||
* @ingroup lavu_math
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Struct containing luma coefficients to be used for RGB to YUV/YCoCg, or similar
|
||||
* calculations.
|
||||
*/
|
||||
typedef struct AVLumaCoefficients {
|
||||
AVRational cr, cg, cb;
|
||||
} AVLumaCoefficients;
|
||||
|
||||
/**
|
||||
* Struct containing chromaticity x and y values for the standard CIE 1931
|
||||
* chromaticity definition.
|
||||
*/
|
||||
typedef struct AVCIExy {
|
||||
AVRational x, y;
|
||||
} AVCIExy;
|
||||
|
||||
/**
|
||||
* Struct defining the red, green, and blue primary locations in terms of CIE
|
||||
* 1931 chromaticity x and y.
|
||||
*/
|
||||
typedef struct AVPrimaryCoefficients {
|
||||
AVCIExy r, g, b;
|
||||
} AVPrimaryCoefficients;
|
||||
|
||||
/**
|
||||
* Struct defining white point location in terms of CIE 1931 chromaticity x
|
||||
* and y.
|
||||
*/
|
||||
typedef AVCIExy AVWhitepointCoefficients;
|
||||
|
||||
/**
|
||||
* Struct that contains both white point location and primaries location, providing
|
||||
* the complete description of a color gamut.
|
||||
*/
|
||||
typedef struct AVColorPrimariesDesc {
|
||||
AVWhitepointCoefficients wp;
|
||||
AVPrimaryCoefficients prim;
|
||||
} AVColorPrimariesDesc;
|
||||
|
||||
/**
|
||||
* Function pointer representing a double -> double transfer function that performs
|
||||
* an EOTF transfer inversion. This function outputs linear light.
|
||||
*/
|
||||
typedef double (*av_csp_trc_function)(double);
|
||||
|
||||
/**
|
||||
* Retrieves the Luma coefficients necessary to construct a conversion matrix
|
||||
* from an enum constant describing the colorspace.
|
||||
* @param csp An enum constant indicating YUV or similar colorspace.
|
||||
* @return The Luma coefficients associated with that colorspace, or NULL
|
||||
* if the constant is unknown to libavutil.
|
||||
*/
|
||||
const AVLumaCoefficients *av_csp_luma_coeffs_from_avcsp(enum AVColorSpace csp);
|
||||
|
||||
/**
|
||||
* Retrieves a complete gamut description from an enum constant describing the
|
||||
* color primaries.
|
||||
* @param prm An enum constant indicating primaries
|
||||
* @return A description of the colorspace gamut associated with that enum
|
||||
* constant, or NULL if the constant is unknown to libavutil.
|
||||
*/
|
||||
const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries prm);
|
||||
|
||||
/**
|
||||
* Detects which enum AVColorPrimaries constant corresponds to the given complete
|
||||
* gamut description.
|
||||
* @see enum AVColorPrimaries
|
||||
* @param prm A description of the colorspace gamut
|
||||
* @return The enum constant associated with this gamut, or
|
||||
* AVCOL_PRI_UNSPECIFIED if no clear match can be idenitified.
|
||||
*/
|
||||
enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm);
|
||||
|
||||
/**
|
||||
* Determine a suitable 'gamma' value to match the supplied
|
||||
* AVColorTransferCharacteristic.
|
||||
*
|
||||
* See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html)
|
||||
*
|
||||
* This function returns the gamma exponent for the OETF. For example, sRGB is approximated
|
||||
* by gamma 2.2, not by gamma 0.45455.
|
||||
*
|
||||
* @return Will return an approximation to the simple gamma function matching
|
||||
* the supplied Transfer Characteristic, Will return 0.0 for any
|
||||
* we cannot reasonably match against.
|
||||
*/
|
||||
double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc);
|
||||
|
||||
/**
|
||||
* Determine the function needed to apply the given
|
||||
* AVColorTransferCharacteristic to linear input.
|
||||
*
|
||||
* The function returned should expect a nominal domain and range of [0.0-1.0]
|
||||
* values outside of this range maybe valid depending on the chosen
|
||||
* characteristic function.
|
||||
*
|
||||
* @return Will return pointer to the function matching the
|
||||
* supplied Transfer Characteristic. If unspecified will
|
||||
* return NULL:
|
||||
*/
|
||||
av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_CSP_H */
|
||||
8
3rdparty/ffmpeg/include/libavutil/des.h
vendored
8
3rdparty/ffmpeg/include/libavutil/des.h
vendored
@@ -43,6 +43,8 @@ AVDES *av_des_alloc(void);
|
||||
/**
|
||||
* @brief Initializes an AVDES context.
|
||||
*
|
||||
* @param d pointer to a AVDES structure to initialize
|
||||
* @param key pointer to the key to use
|
||||
* @param key_bits must be 64 or 192
|
||||
* @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
|
||||
* @return zero on success, negative value otherwise
|
||||
@@ -52,9 +54,10 @@ int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
|
||||
/**
|
||||
* @brief Encrypts / decrypts using the DES algorithm.
|
||||
*
|
||||
* @param count number of 8 byte blocks
|
||||
* @param d pointer to the AVDES structure
|
||||
* @param dst destination array, can be equal to src, must be 8-byte aligned
|
||||
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
|
||||
* @param count number of 8 byte blocks
|
||||
* @param iv initialization vector for CBC mode, if NULL then ECB will be used,
|
||||
* must be 8-byte aligned
|
||||
* @param decrypt 0 for encryption, 1 for decryption
|
||||
@@ -64,9 +67,10 @@ void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count,
|
||||
/**
|
||||
* @brief Calculates CBC-MAC using the DES algorithm.
|
||||
*
|
||||
* @param count number of 8 byte blocks
|
||||
* @param d pointer to the AVDES structure
|
||||
* @param dst destination array, can be equal to src, must be 8-byte aligned
|
||||
* @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
|
||||
* @param count number of 8 byte blocks
|
||||
*/
|
||||
void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
|
||||
|
||||
|
||||
108
3rdparty/ffmpeg/include/libavutil/detection_bbox.h
vendored
Normal file
108
3rdparty/ffmpeg/include/libavutil/detection_bbox.h
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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 AVUTIL_DETECTION_BBOX_H
|
||||
#define AVUTIL_DETECTION_BBOX_H
|
||||
|
||||
#include "rational.h"
|
||||
#include "avassert.h"
|
||||
#include "frame.h"
|
||||
|
||||
typedef struct AVDetectionBBox {
|
||||
/**
|
||||
* Distance in pixels from the left/top edge of the frame,
|
||||
* together with width and height, defining the bounding box.
|
||||
*/
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
#define AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE 64
|
||||
|
||||
/**
|
||||
* Detect result with confidence
|
||||
*/
|
||||
char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
|
||||
AVRational detect_confidence;
|
||||
|
||||
/**
|
||||
* At most 4 classifications based on the detected bounding box.
|
||||
* For example, we can get max 4 different attributes with 4 different
|
||||
* DNN models on one bounding box.
|
||||
* classify_count is zero if no classification.
|
||||
*/
|
||||
#define AV_NUM_DETECTION_BBOX_CLASSIFY 4
|
||||
uint32_t classify_count;
|
||||
char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
|
||||
AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY];
|
||||
} AVDetectionBBox;
|
||||
|
||||
typedef struct AVDetectionBBoxHeader {
|
||||
/**
|
||||
* Information about how the bounding box is generated.
|
||||
* for example, the DNN model name.
|
||||
*/
|
||||
char source[256];
|
||||
|
||||
/**
|
||||
* Number of bounding boxes in the array.
|
||||
*/
|
||||
uint32_t nb_bboxes;
|
||||
|
||||
/**
|
||||
* Offset in bytes from the beginning of this structure at which
|
||||
* the array of bounding boxes starts.
|
||||
*/
|
||||
size_t bboxes_offset;
|
||||
|
||||
/**
|
||||
* Size of each bounding box in bytes.
|
||||
*/
|
||||
size_t bbox_size;
|
||||
} AVDetectionBBoxHeader;
|
||||
|
||||
/*
|
||||
* Get the bounding box at the specified {@code idx}. Must be between 0 and nb_bboxes.
|
||||
*/
|
||||
static av_always_inline AVDetectionBBox *
|
||||
av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
|
||||
{
|
||||
av_assert0(idx < header->nb_bboxes);
|
||||
return (AVDetectionBBox *)((uint8_t *)header + header->bboxes_offset +
|
||||
idx * header->bbox_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
|
||||
* AVDetectionBBox, and initializes the variables.
|
||||
* Can be freed with a normal av_free() call.
|
||||
*
|
||||
* @param nb_bboxes number of AVDetectionBBox structures to allocate
|
||||
* @param out_size if non-NULL, the size in bytes of the resulting data array is
|
||||
* written here.
|
||||
*/
|
||||
AVDetectionBBoxHeader *av_detection_bbox_alloc(uint32_t nb_bboxes, size_t *out_size);
|
||||
|
||||
/**
|
||||
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
|
||||
* AVDetectionBBox, in the given AVFrame {@code frame} as AVFrameSideData of type
|
||||
* AV_FRAME_DATA_DETECTION_BBOXES and initializes the variables.
|
||||
*/
|
||||
AVDetectionBBoxHeader *av_detection_bbox_create_side_data(AVFrame *frame, uint32_t nb_bboxes);
|
||||
#endif
|
||||
127
3rdparty/ffmpeg/include/libavutil/dict.h
vendored
127
3rdparty/ffmpeg/include/libavutil/dict.h
vendored
@@ -32,8 +32,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_dict AVDictionary
|
||||
* @ingroup lavu_data
|
||||
@@ -41,13 +39,15 @@
|
||||
* @brief Simple key:value store
|
||||
*
|
||||
* @{
|
||||
* Dictionaries are used for storing key:value pairs. To create
|
||||
* an AVDictionary, simply pass an address of a NULL pointer to
|
||||
* av_dict_set(). NULL can be used as an empty dictionary wherever
|
||||
* a pointer to an AVDictionary is required.
|
||||
* Use av_dict_get() to retrieve an entry or iterate over all
|
||||
* entries and finally av_dict_free() to free the dictionary
|
||||
* and all its contents.
|
||||
* Dictionaries are used for storing key-value pairs.
|
||||
*
|
||||
* - To **create an AVDictionary**, simply pass an address of a NULL
|
||||
* pointer to av_dict_set(). NULL can be used as an empty dictionary
|
||||
* wherever a pointer to an AVDictionary is required.
|
||||
* - To **insert an entry**, use av_dict_set().
|
||||
* - Use av_dict_get() to **retrieve an entry**.
|
||||
* - To **iterate over all entries**, use av_dict_iterate().
|
||||
* - In order to **free the dictionary and all its contents**, use av_dict_free().
|
||||
*
|
||||
@code
|
||||
AVDictionary *d = NULL; // "create" an empty dictionary
|
||||
@@ -59,13 +59,18 @@
|
||||
char *v = av_strdup("value"); // you can avoid copying them like this
|
||||
av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
|
||||
|
||||
while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
|
||||
<....> // iterate over all entries in d
|
||||
while ((t = av_dict_iterate(d, t))) {
|
||||
<....> // iterate over all entries in d
|
||||
}
|
||||
av_dict_free(&d);
|
||||
@endcode
|
||||
*/
|
||||
|
||||
/**
|
||||
* @name AVDictionary Flags
|
||||
* Flags that influence behavior of the matching of keys or insertion to the dictionary.
|
||||
* @{
|
||||
*/
|
||||
#define AV_DICT_MATCH_CASE 1 /**< Only get an entry with exact-case key match. Only relevant in av_dict_get(). */
|
||||
#define AV_DICT_IGNORE_SUFFIX 2 /**< Return first entry in a dictionary whose first part corresponds to the search key,
|
||||
ignoring the suffix of the found key string. Only relevant in av_dict_get(). */
|
||||
@@ -73,10 +78,13 @@
|
||||
allocated with av_malloc() or another memory allocation function. */
|
||||
#define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been
|
||||
allocated with av_malloc() or another memory allocation function. */
|
||||
#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
|
||||
#define AV_DICT_DONT_OVERWRITE 16 /**< Don't overwrite existing entries. */
|
||||
#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no
|
||||
delimiter is added, the strings are simply concatenated. */
|
||||
delimiter is added, the strings are simply concatenated. */
|
||||
#define AV_DICT_MULTIKEY 64 /**< Allow to store several equal keys in the dictionary */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
typedef struct AVDictionaryEntry {
|
||||
char *key;
|
||||
@@ -91,18 +99,44 @@ typedef struct AVDictionary AVDictionary;
|
||||
* The returned entry key or value must not be changed, or it will
|
||||
* cause undefined behavior.
|
||||
*
|
||||
* To iterate through all the dictionary entries, you can set the matching key
|
||||
* to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag.
|
||||
* @param prev Set to the previous matching element to find the next.
|
||||
* If set to NULL the first matching element is returned.
|
||||
* @param key Matching key
|
||||
* @param flags A collection of AV_DICT_* flags controlling how the
|
||||
* entry is retrieved
|
||||
*
|
||||
* @param prev Set to the previous matching element to find the next.
|
||||
* If set to NULL the first matching element is returned.
|
||||
* @param key matching key
|
||||
* @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved
|
||||
* @return found entry or NULL in case no matching entry was found in the dictionary
|
||||
* @return Found entry or NULL in case no matching entry was found in the dictionary
|
||||
*/
|
||||
AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,
|
||||
const AVDictionaryEntry *prev, int flags);
|
||||
|
||||
/**
|
||||
* Iterate over a dictionary
|
||||
*
|
||||
* Iterates through all entries in the dictionary.
|
||||
*
|
||||
* @warning The returned AVDictionaryEntry key/value must not be changed.
|
||||
*
|
||||
* @warning As av_dict_set() invalidates all previous entries returned
|
||||
* by this function, it must not be called while iterating over the dict.
|
||||
*
|
||||
* Typical usage:
|
||||
* @code
|
||||
* const AVDictionaryEntry *e = NULL;
|
||||
* while ((e = av_dict_iterate(m, e))) {
|
||||
* // ...
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @param m The dictionary to iterate over
|
||||
* @param prev Pointer to the previous AVDictionaryEntry, NULL initially
|
||||
*
|
||||
* @retval AVDictionaryEntry* The next element in the dictionary
|
||||
* @retval NULL No more elements in the dictionary
|
||||
*/
|
||||
const AVDictionaryEntry *av_dict_iterate(const AVDictionary *m,
|
||||
const AVDictionaryEntry *prev);
|
||||
|
||||
/**
|
||||
* Get number of entries in dictionary.
|
||||
*
|
||||
@@ -117,23 +151,24 @@ int av_dict_count(const AVDictionary *m);
|
||||
* Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set,
|
||||
* these arguments will be freed on error.
|
||||
*
|
||||
* Warning: Adding a new entry to a dictionary invalidates all existing entries
|
||||
* previously returned with av_dict_get.
|
||||
* @warning Adding a new entry to a dictionary invalidates all existing entries
|
||||
* previously returned with av_dict_get() or av_dict_iterate().
|
||||
*
|
||||
* @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
|
||||
* a dictionary struct is allocated and put in *pm.
|
||||
* @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags)
|
||||
* @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags).
|
||||
* Passing a NULL value will cause an existing entry to be deleted.
|
||||
* @return >= 0 on success otherwise an error code <0
|
||||
* @param pm Pointer to a pointer to a dictionary struct. If *pm is NULL
|
||||
* a dictionary struct is allocated and put in *pm.
|
||||
* @param key Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags)
|
||||
* @param value Entry value to add to *pm (will be av_strduped or added as a new key depending on flags).
|
||||
* Passing a NULL value will cause an existing entry to be deleted.
|
||||
*
|
||||
* @return >= 0 on success otherwise an error code <0
|
||||
*/
|
||||
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
|
||||
|
||||
/**
|
||||
* Convenience wrapper for av_dict_set that converts the value to a string
|
||||
* Convenience wrapper for av_dict_set() that converts the value to a string
|
||||
* and stores it.
|
||||
*
|
||||
* Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error.
|
||||
* Note: If ::AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error.
|
||||
*/
|
||||
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags);
|
||||
|
||||
@@ -143,14 +178,15 @@ int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags
|
||||
* In case of failure, all the successfully set entries are stored in
|
||||
* *pm. You may need to manually free the created dictionary.
|
||||
*
|
||||
* @param key_val_sep a 0-terminated list of characters used to separate
|
||||
* @param key_val_sep A 0-terminated list of characters used to separate
|
||||
* key from value
|
||||
* @param pairs_sep a 0-terminated list of characters used to separate
|
||||
* @param pairs_sep A 0-terminated list of characters used to separate
|
||||
* two pairs from each other
|
||||
* @param flags flags to use when adding to dictionary.
|
||||
* AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
|
||||
* @param flags Flags to use when adding to the dictionary.
|
||||
* ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL
|
||||
* are ignored since the key/value tokens will always
|
||||
* be duplicated.
|
||||
*
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
int av_dict_parse_string(AVDictionary **pm, const char *str,
|
||||
@@ -159,11 +195,14 @@ int av_dict_parse_string(AVDictionary **pm, const char *str,
|
||||
|
||||
/**
|
||||
* Copy entries from one AVDictionary struct into another.
|
||||
* @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
|
||||
* this function will allocate a struct for you and put it in *dst
|
||||
* @param src pointer to source AVDictionary struct
|
||||
* @param flags flags to use when setting entries in *dst
|
||||
* @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
|
||||
*
|
||||
* @note Metadata is read using the ::AV_DICT_IGNORE_SUFFIX flag
|
||||
*
|
||||
* @param dst Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL,
|
||||
* this function will allocate a struct for you and put it in *dst
|
||||
* @param src Pointer to the source AVDictionary struct to copy items from.
|
||||
* @param flags Flags to use when setting entries in *dst
|
||||
*
|
||||
* @return 0 on success, negative AVERROR code on failure. If dst was allocated
|
||||
* by this function, callers should free the associated memory.
|
||||
*/
|
||||
@@ -182,13 +221,15 @@ void av_dict_free(AVDictionary **m);
|
||||
* Such string may be passed back to av_dict_parse_string().
|
||||
* @note String is escaped with backslashes ('\').
|
||||
*
|
||||
* @param[in] m dictionary
|
||||
* @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same.
|
||||
*
|
||||
* @param[in] m The dictionary
|
||||
* @param[out] buffer Pointer to buffer that will be allocated with string containg entries.
|
||||
* Buffer must be freed by the caller when is no longer needed.
|
||||
* @param[in] key_val_sep character used to separate key from value
|
||||
* @param[in] pairs_sep character used to separate two pairs from each other
|
||||
* @param[in] key_val_sep Character used to separate key from value
|
||||
* @param[in] pairs_sep Character used to separate two pairs from each other
|
||||
*
|
||||
* @return >= 0 on success, negative on error
|
||||
* @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same.
|
||||
*/
|
||||
int av_dict_get_string(const AVDictionary *m, char **buffer,
|
||||
const char key_val_sep, const char pairs_sep);
|
||||
|
||||
23
3rdparty/ffmpeg/include/libavutil/display.h
vendored
23
3rdparty/ffmpeg/include/libavutil/display.h
vendored
@@ -20,6 +20,7 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavu_video_display
|
||||
* Display matrix
|
||||
*/
|
||||
|
||||
@@ -27,18 +28,11 @@
|
||||
#define AVUTIL_DISPLAY_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_video
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_video_display Display transformation matrix functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_video_display
|
||||
* @ingroup lavu_video
|
||||
*
|
||||
* The display transformation matrix specifies an affine transformation that
|
||||
* should be applied to video frames for correct presentation. It is compatible
|
||||
* with the matrices stored in the ISO/IEC 14496-12 container format.
|
||||
@@ -72,6 +66,8 @@
|
||||
* q' = (b * p + d * q + y) / z;
|
||||
* z = u * p + v * q + w
|
||||
* @endcode
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -88,11 +84,11 @@
|
||||
double av_display_rotation_get(const int32_t matrix[9]);
|
||||
|
||||
/**
|
||||
* Initialize a transformation matrix describing a pure counterclockwise
|
||||
* Initialize a transformation matrix describing a pure clockwise
|
||||
* rotation by the specified angle (in degrees).
|
||||
*
|
||||
* @param matrix an allocated transformation matrix (will be fully overwritten
|
||||
* by this function)
|
||||
* @param[out] matrix a transformation matrix (will be fully overwritten
|
||||
* by this function)
|
||||
* @param angle rotation angle in degrees.
|
||||
*/
|
||||
void av_display_rotation_set(int32_t matrix[9], double angle);
|
||||
@@ -100,14 +96,13 @@ void av_display_rotation_set(int32_t matrix[9], double angle);
|
||||
/**
|
||||
* Flip the input matrix horizontally and/or vertically.
|
||||
*
|
||||
* @param matrix an allocated transformation matrix
|
||||
* @param[in,out] matrix a transformation matrix
|
||||
* @param hflip whether the matrix should be flipped horizontally
|
||||
* @param vflip whether the matrix should be flipped vertically
|
||||
*/
|
||||
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
166
3rdparty/ffmpeg/include/libavutil/dovi_meta.h
vendored
166
3rdparty/ffmpeg/include/libavutil/dovi_meta.h
vendored
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "rational.h"
|
||||
|
||||
/*
|
||||
* DOVI configuration
|
||||
@@ -67,4 +68,169 @@ typedef struct AVDOVIDecoderConfigurationRecord {
|
||||
*/
|
||||
AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* Dolby Vision RPU data header.
|
||||
*
|
||||
* @note sizeof(AVDOVIRpuDataHeader) is not part of the public ABI.
|
||||
*/
|
||||
typedef struct AVDOVIRpuDataHeader {
|
||||
uint8_t rpu_type;
|
||||
uint16_t rpu_format;
|
||||
uint8_t vdr_rpu_profile;
|
||||
uint8_t vdr_rpu_level;
|
||||
uint8_t chroma_resampling_explicit_filter_flag;
|
||||
uint8_t coef_data_type; /* informative, lavc always converts to fixed */
|
||||
uint8_t coef_log2_denom;
|
||||
uint8_t vdr_rpu_normalized_idc;
|
||||
uint8_t bl_video_full_range_flag;
|
||||
uint8_t bl_bit_depth; /* [8, 16] */
|
||||
uint8_t el_bit_depth; /* [8, 16] */
|
||||
uint8_t vdr_bit_depth; /* [8, 16] */
|
||||
uint8_t spatial_resampling_filter_flag;
|
||||
uint8_t el_spatial_resampling_filter_flag;
|
||||
uint8_t disable_residual_flag;
|
||||
} AVDOVIRpuDataHeader;
|
||||
|
||||
enum AVDOVIMappingMethod {
|
||||
AV_DOVI_MAPPING_POLYNOMIAL = 0,
|
||||
AV_DOVI_MAPPING_MMR = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* Coefficients of a piece-wise function. The pieces of the function span the
|
||||
* value ranges between two adjacent pivot values.
|
||||
*/
|
||||
#define AV_DOVI_MAX_PIECES 8
|
||||
typedef struct AVDOVIReshapingCurve {
|
||||
uint8_t num_pivots; /* [2, 9] */
|
||||
uint16_t pivots[AV_DOVI_MAX_PIECES + 1]; /* sorted ascending */
|
||||
enum AVDOVIMappingMethod mapping_idc[AV_DOVI_MAX_PIECES];
|
||||
/* AV_DOVI_MAPPING_POLYNOMIAL */
|
||||
uint8_t poly_order[AV_DOVI_MAX_PIECES]; /* [1, 2] */
|
||||
int64_t poly_coef[AV_DOVI_MAX_PIECES][3]; /* x^0, x^1, x^2 */
|
||||
/* AV_DOVI_MAPPING_MMR */
|
||||
uint8_t mmr_order[AV_DOVI_MAX_PIECES]; /* [1, 3] */
|
||||
int64_t mmr_constant[AV_DOVI_MAX_PIECES];
|
||||
int64_t mmr_coef[AV_DOVI_MAX_PIECES][3/* order - 1 */][7];
|
||||
} AVDOVIReshapingCurve;
|
||||
|
||||
enum AVDOVINLQMethod {
|
||||
AV_DOVI_NLQ_NONE = -1,
|
||||
AV_DOVI_NLQ_LINEAR_DZ = 0,
|
||||
};
|
||||
|
||||
/**
|
||||
* Coefficients of the non-linear inverse quantization. For the interpretation
|
||||
* of these, see ETSI GS CCM 001.
|
||||
*/
|
||||
typedef struct AVDOVINLQParams {
|
||||
uint16_t nlq_offset;
|
||||
uint64_t vdr_in_max;
|
||||
/* AV_DOVI_NLQ_LINEAR_DZ */
|
||||
uint64_t linear_deadzone_slope;
|
||||
uint64_t linear_deadzone_threshold;
|
||||
} AVDOVINLQParams;
|
||||
|
||||
/**
|
||||
* Dolby Vision RPU data mapping parameters.
|
||||
*
|
||||
* @note sizeof(AVDOVIDataMapping) is not part of the public ABI.
|
||||
*/
|
||||
typedef struct AVDOVIDataMapping {
|
||||
uint8_t vdr_rpu_id;
|
||||
uint8_t mapping_color_space;
|
||||
uint8_t mapping_chroma_format_idc;
|
||||
AVDOVIReshapingCurve curves[3]; /* per component */
|
||||
|
||||
/* Non-linear inverse quantization */
|
||||
enum AVDOVINLQMethod nlq_method_idc;
|
||||
uint32_t num_x_partitions;
|
||||
uint32_t num_y_partitions;
|
||||
AVDOVINLQParams nlq[3]; /* per component */
|
||||
} AVDOVIDataMapping;
|
||||
|
||||
/**
|
||||
* Dolby Vision RPU colorspace metadata parameters.
|
||||
*
|
||||
* @note sizeof(AVDOVIColorMetadata) is not part of the public ABI.
|
||||
*/
|
||||
typedef struct AVDOVIColorMetadata {
|
||||
uint8_t dm_metadata_id;
|
||||
uint8_t scene_refresh_flag;
|
||||
|
||||
/**
|
||||
* Coefficients of the custom Dolby Vision IPT-PQ matrices. These are to be
|
||||
* used instead of the matrices indicated by the frame's colorspace tags.
|
||||
* The output of rgb_to_lms_matrix is to be fed into a BT.2020 LMS->RGB
|
||||
* matrix based on a Hunt-Pointer-Estevez transform, but without any
|
||||
* crosstalk. (See the definition of the ICtCp colorspace for more
|
||||
* information.)
|
||||
*/
|
||||
AVRational ycc_to_rgb_matrix[9]; /* before PQ linearization */
|
||||
AVRational ycc_to_rgb_offset[3]; /* input offset of neutral value */
|
||||
AVRational rgb_to_lms_matrix[9]; /* after PQ linearization */
|
||||
|
||||
/**
|
||||
* Extra signal metadata (see Dolby patents for more info).
|
||||
*/
|
||||
uint16_t signal_eotf;
|
||||
uint16_t signal_eotf_param0;
|
||||
uint16_t signal_eotf_param1;
|
||||
uint32_t signal_eotf_param2;
|
||||
uint8_t signal_bit_depth;
|
||||
uint8_t signal_color_space;
|
||||
uint8_t signal_chroma_format;
|
||||
uint8_t signal_full_range_flag; /* [0, 3] */
|
||||
uint16_t source_min_pq;
|
||||
uint16_t source_max_pq;
|
||||
uint16_t source_diagonal;
|
||||
} AVDOVIColorMetadata;
|
||||
|
||||
/**
|
||||
* Combined struct representing a combination of header, mapping and color
|
||||
* metadata, for attaching to frames as side data.
|
||||
*
|
||||
* @note The struct must be allocated with av_dovi_metadata_alloc() and
|
||||
* its size is not a part of the public ABI.
|
||||
*/
|
||||
|
||||
typedef struct AVDOVIMetadata {
|
||||
/**
|
||||
* Offset in bytes from the beginning of this structure at which the
|
||||
* respective structs start.
|
||||
*/
|
||||
size_t header_offset; /* AVDOVIRpuDataHeader */
|
||||
size_t mapping_offset; /* AVDOVIDataMapping */
|
||||
size_t color_offset; /* AVDOVIColorMetadata */
|
||||
} AVDOVIMetadata;
|
||||
|
||||
static av_always_inline AVDOVIRpuDataHeader *
|
||||
av_dovi_get_header(const AVDOVIMetadata *data)
|
||||
{
|
||||
return (AVDOVIRpuDataHeader *)((uint8_t *) data + data->header_offset);
|
||||
}
|
||||
|
||||
static av_always_inline AVDOVIDataMapping *
|
||||
av_dovi_get_mapping(const AVDOVIMetadata *data)
|
||||
{
|
||||
return (AVDOVIDataMapping *)((uint8_t *) data + data->mapping_offset);
|
||||
}
|
||||
|
||||
static av_always_inline AVDOVIColorMetadata *
|
||||
av_dovi_get_color(const AVDOVIMetadata *data)
|
||||
{
|
||||
return (AVDOVIColorMetadata *)((uint8_t *) data + data->color_offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate an AVDOVIMetadata structure and initialize its
|
||||
* fields to default values.
|
||||
*
|
||||
* @param size If this parameter is non-NULL, the size in bytes of the
|
||||
* allocated struct will be written here on success
|
||||
*
|
||||
* @return the newly allocated struct or NULL on failure
|
||||
*/
|
||||
AVDOVIMetadata *av_dovi_metadata_alloc(size_t *size);
|
||||
|
||||
#endif /* AVUTIL_DOVI_META_H */
|
||||
|
||||
2
3rdparty/ffmpeg/include/libavutil/error.h
vendored
2
3rdparty/ffmpeg/include/libavutil/error.h
vendored
@@ -27,6 +27,8 @@
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "macros.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_error
|
||||
*
|
||||
|
||||
7
3rdparty/ffmpeg/include/libavutil/eval.h
vendored
7
3rdparty/ffmpeg/include/libavutil/eval.h
vendored
@@ -26,8 +26,6 @@
|
||||
#ifndef AVUTIL_EVAL_H
|
||||
#define AVUTIL_EVAL_H
|
||||
|
||||
#include "avutil.h"
|
||||
|
||||
typedef struct AVExpr AVExpr;
|
||||
|
||||
/**
|
||||
@@ -44,6 +42,7 @@ typedef struct AVExpr AVExpr;
|
||||
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
|
||||
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
|
||||
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
|
||||
* @param log_offset log level offset, can be used to silence error messages
|
||||
* @param log_ctx parent logging context
|
||||
* @return >= 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code otherwise
|
||||
@@ -67,6 +66,7 @@ int av_expr_parse_and_eval(double *res, const char *s,
|
||||
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
|
||||
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
|
||||
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
|
||||
* @param log_offset log level offset, can be used to silence error messages
|
||||
* @param log_ctx parent logging context
|
||||
* @return >= 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code otherwise
|
||||
@@ -80,6 +80,7 @@ int av_expr_parse(AVExpr **expr, const char *s,
|
||||
/**
|
||||
* Evaluate a previously parsed expression.
|
||||
*
|
||||
* @param e the AVExpr to evaluate
|
||||
* @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
|
||||
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
|
||||
* @return the value of the expression
|
||||
@@ -89,6 +90,7 @@ double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
|
||||
/**
|
||||
* Track the presence of variables and their number of occurrences in a parsed expression
|
||||
*
|
||||
* @param e the AVExpr to track variables in
|
||||
* @param counter a zero-initialized array where the count of each variable will be stored
|
||||
* @param size size of array
|
||||
* @return 0 on success, a negative value indicates that no expression or array was passed
|
||||
@@ -100,6 +102,7 @@ int av_expr_count_vars(AVExpr *e, unsigned *counter, int size);
|
||||
* Track the presence of user provided functions and their number of occurrences
|
||||
* in a parsed expression.
|
||||
*
|
||||
* @param e the AVExpr to track user provided functions in
|
||||
* @param counter a zero-initialized array where the count of each function will be stored
|
||||
* if you passed 5 functions with 2 arguments to av_expr_parse()
|
||||
* then for arg=2 this will use upto 5 entries.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated by version.sh, do not manually edit! */
|
||||
#ifndef AVUTIL_FFVERSION_H
|
||||
#define AVUTIL_FFVERSION_H
|
||||
#define FFMPEG_VERSION "4.4.3"
|
||||
#define FFMPEG_VERSION "6.0"
|
||||
#endif /* AVUTIL_FFVERSION_H */
|
||||
|
||||
277
3rdparty/ffmpeg/include/libavutil/fifo.h
vendored
277
3rdparty/ffmpeg/include/libavutil/fifo.h
vendored
@@ -18,16 +18,229 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* a very simple circular buffer FIFO implementation
|
||||
* @ingroup lavu_fifo
|
||||
* A generic FIFO API
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_FIFO_H
|
||||
#define AVUTIL_FIFO_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "avutil.h"
|
||||
#include "attributes.h"
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_fifo AVFifo
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* @{
|
||||
* A generic FIFO API
|
||||
*/
|
||||
|
||||
typedef struct AVFifo AVFifo;
|
||||
|
||||
/**
|
||||
* Callback for writing or reading from a FIFO, passed to (and invoked from) the
|
||||
* av_fifo_*_cb() functions. It may be invoked multiple times from a single
|
||||
* av_fifo_*_cb() call and may process less data than the maximum size indicated
|
||||
* by nb_elems.
|
||||
*
|
||||
* @param opaque the opaque pointer provided to the av_fifo_*_cb() function
|
||||
* @param buf the buffer for reading or writing the data, depending on which
|
||||
* av_fifo_*_cb function is called
|
||||
* @param nb_elems On entry contains the maximum number of elements that can be
|
||||
* read from / written into buf. On success, the callback should
|
||||
* update it to contain the number of elements actually written.
|
||||
*
|
||||
* @return 0 on success, a negative error code on failure (will be returned from
|
||||
* the invoking av_fifo_*_cb() function)
|
||||
*/
|
||||
typedef int AVFifoCB(void *opaque, void *buf, size_t *nb_elems);
|
||||
|
||||
/**
|
||||
* Automatically resize the FIFO on writes, so that the data fits. This
|
||||
* automatic resizing happens up to a limit that can be modified with
|
||||
* av_fifo_auto_grow_limit().
|
||||
*/
|
||||
#define AV_FIFO_FLAG_AUTO_GROW (1 << 0)
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVFifo with a given element size.
|
||||
*
|
||||
* @param elems initial number of elements that can be stored in the FIFO
|
||||
* @param elem_size Size in bytes of a single element. Further operations on
|
||||
* the returned FIFO will implicitly use this element size.
|
||||
* @param flags a combination of AV_FIFO_FLAG_*
|
||||
*
|
||||
* @return newly-allocated AVFifo on success, a negative error code on failure
|
||||
*/
|
||||
AVFifo *av_fifo_alloc2(size_t elems, size_t elem_size,
|
||||
unsigned int flags);
|
||||
|
||||
/**
|
||||
* @return Element size for FIFO operations. This element size is set at
|
||||
* FIFO allocation and remains constant during its lifetime
|
||||
*/
|
||||
size_t av_fifo_elem_size(const AVFifo *f);
|
||||
|
||||
/**
|
||||
* Set the maximum size (in elements) to which the FIFO can be resized
|
||||
* automatically. Has no effect unless AV_FIFO_FLAG_AUTO_GROW is used.
|
||||
*/
|
||||
void av_fifo_auto_grow_limit(AVFifo *f, size_t max_elems);
|
||||
|
||||
/**
|
||||
* @return number of elements available for reading from the given FIFO.
|
||||
*/
|
||||
size_t av_fifo_can_read(const AVFifo *f);
|
||||
|
||||
/**
|
||||
* @return Number of elements that can be written into the given FIFO without
|
||||
* growing it.
|
||||
*
|
||||
* In other words, this number of elements or less is guaranteed to fit
|
||||
* into the FIFO. More data may be written when the
|
||||
* AV_FIFO_FLAG_AUTO_GROW flag was specified at FIFO creation, but this
|
||||
* may involve memory allocation, which can fail.
|
||||
*/
|
||||
size_t av_fifo_can_write(const AVFifo *f);
|
||||
|
||||
/**
|
||||
* Enlarge an AVFifo.
|
||||
*
|
||||
* On success, the FIFO will be large enough to hold exactly
|
||||
* inc + av_fifo_can_read() + av_fifo_can_write()
|
||||
* elements. In case of failure, the old FIFO is kept unchanged.
|
||||
*
|
||||
* @param f AVFifo to resize
|
||||
* @param inc number of elements to allocate for, in addition to the current
|
||||
* allocated size
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_grow2(AVFifo *f, size_t inc);
|
||||
|
||||
/**
|
||||
* Write data into a FIFO.
|
||||
*
|
||||
* In case nb_elems > av_fifo_can_write(f) and the AV_FIFO_FLAG_AUTO_GROW flag
|
||||
* was not specified at FIFO creation, nothing is written and an error
|
||||
* is returned.
|
||||
*
|
||||
* Calling function is guaranteed to succeed if nb_elems <= av_fifo_can_write(f).
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param buf Data to be written. nb_elems * av_fifo_elem_size(f) bytes will be
|
||||
* read from buf on success.
|
||||
* @param nb_elems number of elements to write into FIFO
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_write(AVFifo *f, const void *buf, size_t nb_elems);
|
||||
|
||||
/**
|
||||
* Write data from a user-provided callback into a FIFO.
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param read_cb Callback supplying the data to the FIFO. May be called
|
||||
* multiple times.
|
||||
* @param opaque opaque user data to be provided to read_cb
|
||||
* @param nb_elems Should point to the maximum number of elements that can be
|
||||
* written. Will be updated to contain the number of elements
|
||||
* actually written.
|
||||
*
|
||||
* @return non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_write_from_cb(AVFifo *f, AVFifoCB read_cb,
|
||||
void *opaque, size_t *nb_elems);
|
||||
|
||||
/**
|
||||
* Read data from a FIFO.
|
||||
*
|
||||
* In case nb_elems > av_fifo_can_read(f), nothing is read and an error
|
||||
* is returned.
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param buf Buffer to store the data. nb_elems * av_fifo_elem_size(f) bytes
|
||||
* will be written into buf on success.
|
||||
* @param nb_elems number of elements to read from FIFO
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_read(AVFifo *f, void *buf, size_t nb_elems);
|
||||
|
||||
/**
|
||||
* Feed data from a FIFO into a user-provided callback.
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param write_cb Callback the data will be supplied to. May be called
|
||||
* multiple times.
|
||||
* @param opaque opaque user data to be provided to write_cb
|
||||
* @param nb_elems Should point to the maximum number of elements that can be
|
||||
* read. Will be updated to contain the total number of elements
|
||||
* actually sent to the callback.
|
||||
*
|
||||
* @return non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb,
|
||||
void *opaque, size_t *nb_elems);
|
||||
|
||||
/**
|
||||
* Read data from a FIFO without modifying FIFO state.
|
||||
*
|
||||
* Returns an error if an attempt is made to peek to nonexistent elements
|
||||
* (i.e. if offset + nb_elems is larger than av_fifo_can_read(f)).
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param buf Buffer to store the data. nb_elems * av_fifo_elem_size(f) bytes
|
||||
* will be written into buf.
|
||||
* @param nb_elems number of elements to read from FIFO
|
||||
* @param offset number of initial elements to skip.
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset);
|
||||
|
||||
/**
|
||||
* Feed data from a FIFO into a user-provided callback.
|
||||
*
|
||||
* @param f the FIFO buffer
|
||||
* @param write_cb Callback the data will be supplied to. May be called
|
||||
* multiple times.
|
||||
* @param opaque opaque user data to be provided to write_cb
|
||||
* @param nb_elems Should point to the maximum number of elements that can be
|
||||
* read. Will be updated to contain the total number of elements
|
||||
* actually sent to the callback.
|
||||
* @param offset number of initial elements to skip; offset + *nb_elems must not
|
||||
* be larger than av_fifo_can_read(f).
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*/
|
||||
int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque,
|
||||
size_t *nb_elems, size_t offset);
|
||||
|
||||
/**
|
||||
* Discard the specified amount of data from an AVFifo.
|
||||
* @param size number of elements to discard, MUST NOT be larger than
|
||||
* av_fifo_can_read(f)
|
||||
*/
|
||||
void av_fifo_drain2(AVFifo *f, size_t size);
|
||||
|
||||
/*
|
||||
* Empty the AVFifo.
|
||||
* @param f AVFifo to reset
|
||||
*/
|
||||
void av_fifo_reset2(AVFifo *f);
|
||||
|
||||
/**
|
||||
* Free an AVFifo and reset pointer to NULL.
|
||||
* @param f Pointer to an AVFifo to free. *f == NULL is allowed.
|
||||
*/
|
||||
void av_fifo_freep2(AVFifo **f);
|
||||
|
||||
|
||||
#if FF_API_FIFO_OLD_API
|
||||
typedef struct AVFifoBuffer {
|
||||
uint8_t *buffer;
|
||||
uint8_t *rptr, *wptr, *end;
|
||||
@@ -38,7 +251,9 @@ typedef struct AVFifoBuffer {
|
||||
* Initialize an AVFifoBuffer.
|
||||
* @param size of FIFO
|
||||
* @return AVFifoBuffer or NULL in case of memory allocation failure
|
||||
* @deprecated use av_fifo_alloc2()
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVFifoBuffer *av_fifo_alloc(unsigned int size);
|
||||
|
||||
/**
|
||||
@@ -46,25 +261,33 @@ AVFifoBuffer *av_fifo_alloc(unsigned int size);
|
||||
* @param nmemb number of elements
|
||||
* @param size size of the single element
|
||||
* @return AVFifoBuffer or NULL in case of memory allocation failure
|
||||
* @deprecated use av_fifo_alloc2()
|
||||
*/
|
||||
attribute_deprecated
|
||||
AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size);
|
||||
|
||||
/**
|
||||
* Free an AVFifoBuffer.
|
||||
* @param f AVFifoBuffer to free
|
||||
* @deprecated use the AVFifo API with av_fifo_freep2()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_fifo_free(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Free an AVFifoBuffer and reset pointer to NULL.
|
||||
* @param f AVFifoBuffer to free
|
||||
* @deprecated use the AVFifo API with av_fifo_freep2()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_fifo_freep(AVFifoBuffer **f);
|
||||
|
||||
/**
|
||||
* Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
|
||||
* @param f AVFifoBuffer to reset
|
||||
* @deprecated use av_fifo_reset2() with the new AVFifo-API
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_fifo_reset(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
@@ -72,7 +295,9 @@ void av_fifo_reset(AVFifoBuffer *f);
|
||||
* amount of data you can read from it.
|
||||
* @param f AVFifoBuffer to read from
|
||||
* @return size
|
||||
* @deprecated use av_fifo_can_read() with the new AVFifo-API
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_size(const AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
@@ -80,7 +305,9 @@ int av_fifo_size(const AVFifoBuffer *f);
|
||||
* amount of data you can write into it.
|
||||
* @param f AVFifoBuffer to write into
|
||||
* @return size
|
||||
* @deprecated use av_fifo_can_write() with the new AVFifo-API
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_space(const AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
@@ -91,7 +318,13 @@ int av_fifo_space(const AVFifoBuffer *f);
|
||||
* @param buf_size number of bytes to read
|
||||
* @param func generic read function
|
||||
* @param dest data destination
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL,
|
||||
* av_fifo_peek_to_cb() otherwise
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
@@ -101,7 +334,13 @@ int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_siz
|
||||
* @param buf_size number of bytes to read
|
||||
* @param func generic read function
|
||||
* @param dest data destination
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL,
|
||||
* av_fifo_peek_to_cb() otherwise
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
@@ -110,7 +349,13 @@ int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)
|
||||
* @param buf_size number of bytes to read
|
||||
* @param func generic read function
|
||||
* @param dest data destination
|
||||
*
|
||||
* @return a non-negative number on success, a negative error code on failure
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_read() when func == NULL,
|
||||
* av_fifo_read_to_cb() otherwise
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
@@ -124,8 +369,12 @@ int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)
|
||||
* func must return the number of bytes written to dest_buf, or <= 0 to
|
||||
* indicate no more data available to write.
|
||||
* If func is NULL, src is interpreted as a simple byte array for source data.
|
||||
* @return the number of bytes written to the FIFO
|
||||
* @return the number of bytes written to the FIFO or a negative error code on failure
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_write() when func == NULL,
|
||||
* av_fifo_write_from_cb() otherwise
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
@@ -135,7 +384,11 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
|
||||
* @param f AVFifoBuffer to resize
|
||||
* @param size new AVFifoBuffer size in bytes
|
||||
* @return <0 for failure, >=0 otherwise
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_grow2() to increase FIFO size,
|
||||
* decreasing FIFO size is not supported
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
|
||||
|
||||
/**
|
||||
@@ -146,16 +399,24 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
|
||||
* @param f AVFifoBuffer to resize
|
||||
* @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size()
|
||||
* @return <0 for failure, >=0 otherwise
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_grow2(); note that unlike
|
||||
* this function it adds to the allocated size, rather than to the used size
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space);
|
||||
|
||||
/**
|
||||
* Read and discard the specified amount of data from an AVFifoBuffer.
|
||||
* @param f AVFifoBuffer to read from
|
||||
* @param size amount of data to read in bytes
|
||||
*
|
||||
* @deprecated use the new AVFifo-API with av_fifo_drain2()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_fifo_drain(AVFifoBuffer *f, int size);
|
||||
|
||||
#if FF_API_FIFO_PEEK2
|
||||
/**
|
||||
* Return a pointer to the data stored in a FIFO buffer at a certain offset.
|
||||
* The FIFO buffer is not modified.
|
||||
@@ -165,7 +426,9 @@ void av_fifo_drain(AVFifoBuffer *f, int size);
|
||||
* than the used buffer size or the returned pointer will
|
||||
* point outside to the buffer data.
|
||||
* The used buffer size can be checked with av_fifo_size().
|
||||
* @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb()
|
||||
*/
|
||||
attribute_deprecated
|
||||
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
|
||||
{
|
||||
uint8_t *ptr = f->rptr + offs;
|
||||
@@ -175,5 +438,11 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
|
||||
ptr = f->end - (f->buffer - ptr);
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_FIFO_H */
|
||||
|
||||
11
3rdparty/ffmpeg/include/libavutil/file.h
vendored
11
3rdparty/ffmpeg/include/libavutil/file.h
vendored
@@ -19,9 +19,11 @@
|
||||
#ifndef AVUTIL_FILE_H
|
||||
#define AVUTIL_FILE_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "avutil.h"
|
||||
#include "version.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -37,6 +39,9 @@
|
||||
* case *bufptr will be set to NULL and *size will be set to 0.
|
||||
* The returned buffer must be released with av_file_unmap().
|
||||
*
|
||||
* @param filename path to the file
|
||||
* @param[out] bufptr pointee is set to the mapped or allocated buffer
|
||||
* @param[out] size pointee is set to the size in bytes of the buffer
|
||||
* @param log_offset loglevel offset used for logging
|
||||
* @param log_ctx context used for logging
|
||||
* @return a non negative number in case of success, a negative value
|
||||
@@ -49,11 +54,13 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
|
||||
/**
|
||||
* Unmap or free the buffer bufptr created by av_file_map().
|
||||
*
|
||||
* @param bufptr the buffer previously created with av_file_map()
|
||||
* @param size size in bytes of bufptr, must be the same as returned
|
||||
* by av_file_map()
|
||||
*/
|
||||
void av_file_unmap(uint8_t *bufptr, size_t size);
|
||||
|
||||
#if FF_API_AV_FOPEN_UTF8
|
||||
/**
|
||||
* Wrapper to work around the lack of mkstemp() on mingw.
|
||||
* Also, tries to create file in /tmp first, if possible.
|
||||
@@ -66,6 +73,8 @@ void av_file_unmap(uint8_t *bufptr, size_t size);
|
||||
* libraries and could interfere with the calling application.
|
||||
* @deprecated as fd numbers cannot be passed saftely between libs on some platforms
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_FILE_H */
|
||||
|
||||
@@ -28,6 +28,11 @@ enum AVFilmGrainParamsType {
|
||||
* The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
|
||||
*/
|
||||
AV_FILM_GRAIN_PARAMS_AV1,
|
||||
|
||||
/**
|
||||
* The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
|
||||
*/
|
||||
AV_FILM_GRAIN_PARAMS_H274,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -117,6 +122,89 @@ typedef struct AVFilmGrainAOMParams {
|
||||
int limit_output_range;
|
||||
} AVFilmGrainAOMParams;
|
||||
|
||||
/**
|
||||
* This structure describes how to handle film grain synthesis for codecs using
|
||||
* the ITU-T H.274 Versatile suplemental enhancement information message.
|
||||
*
|
||||
* @note The struct must be allocated as part of AVFilmGrainParams using
|
||||
* av_film_grain_params_alloc(). Its size is not a part of the public ABI.
|
||||
*/
|
||||
typedef struct AVFilmGrainH274Params {
|
||||
/**
|
||||
* Specifies the film grain simulation mode.
|
||||
* 0 = Frequency filtering, 1 = Auto-regression
|
||||
*/
|
||||
int model_id;
|
||||
|
||||
/**
|
||||
* Specifies the bit depth used for the luma component.
|
||||
*/
|
||||
int bit_depth_luma;
|
||||
|
||||
/**
|
||||
* Specifies the bit depth used for the chroma components.
|
||||
*/
|
||||
int bit_depth_chroma;
|
||||
|
||||
enum AVColorRange color_range;
|
||||
enum AVColorPrimaries color_primaries;
|
||||
enum AVColorTransferCharacteristic color_trc;
|
||||
enum AVColorSpace color_space;
|
||||
|
||||
/**
|
||||
* Specifies the blending mode used to blend the simulated film grain
|
||||
* with the decoded images.
|
||||
*
|
||||
* 0 = Additive, 1 = Multiplicative
|
||||
*/
|
||||
int blending_mode_id;
|
||||
|
||||
/**
|
||||
* Specifies a scale factor used in the film grain characterization equations.
|
||||
*/
|
||||
int log2_scale_factor;
|
||||
|
||||
/**
|
||||
* Indicates if the modelling of film grain for a given component is present.
|
||||
*/
|
||||
int component_model_present[3 /* y, cb, cr */];
|
||||
|
||||
/**
|
||||
* Specifies the number of intensity intervals for which a specific set of
|
||||
* model values has been estimated, with a range of [1, 256].
|
||||
*/
|
||||
uint16_t num_intensity_intervals[3 /* y, cb, cr */];
|
||||
|
||||
/**
|
||||
* Specifies the number of model values present for each intensity interval
|
||||
* in which the film grain has been modelled, with a range of [1, 6].
|
||||
*/
|
||||
uint8_t num_model_values[3 /* y, cb, cr */];
|
||||
|
||||
/**
|
||||
* Specifies the lower ounds of each intensity interval for whichthe set of
|
||||
* model values applies for the component.
|
||||
*/
|
||||
uint8_t intensity_interval_lower_bound[3 /* y, cb, cr */][256 /* intensity interval */];
|
||||
|
||||
/**
|
||||
* Specifies the upper bound of each intensity interval for which the set of
|
||||
* model values applies for the component.
|
||||
*/
|
||||
uint8_t intensity_interval_upper_bound[3 /* y, cb, cr */][256 /* intensity interval */];
|
||||
|
||||
/**
|
||||
* Specifies the model values for the component for each intensity interval.
|
||||
* - When model_id == 0, the following applies:
|
||||
* For comp_model_value[y], the range of values is [0, 2^bit_depth_luma - 1]
|
||||
* For comp_model_value[cb..cr], the range of values is [0, 2^bit_depth_chroma - 1]
|
||||
* - Otherwise, the following applies:
|
||||
* For comp_model_value[y], the range of values is [-2^(bit_depth_luma - 1), 2^(bit_depth_luma - 1) - 1]
|
||||
* For comp_model_value[cb..cr], the range of values is [-2^(bit_depth_chroma - 1), 2^(bit_depth_chroma - 1) - 1]
|
||||
*/
|
||||
int16_t comp_model_value[3 /* y, cb, cr */][256 /* intensity interval */][6 /* model value */];
|
||||
} AVFilmGrainH274Params;
|
||||
|
||||
/**
|
||||
* This structure describes how to handle film grain synthesis in video
|
||||
* for specific codecs. Must be present on every frame where film grain is
|
||||
@@ -133,6 +221,9 @@ typedef struct AVFilmGrainParams {
|
||||
|
||||
/**
|
||||
* Seed to use for the synthesis process, if the codec allows for it.
|
||||
*
|
||||
* @note For H.264, this refers to `pic_offset` as defined in
|
||||
* SMPTE RDD 5-2006.
|
||||
*/
|
||||
uint64_t seed;
|
||||
|
||||
@@ -143,6 +234,7 @@ typedef struct AVFilmGrainParams {
|
||||
*/
|
||||
union {
|
||||
AVFilmGrainAOMParams aom;
|
||||
AVFilmGrainH274Params h274;
|
||||
} codec;
|
||||
} AVFilmGrainParams;
|
||||
|
||||
|
||||
233
3rdparty/ffmpeg/include/libavutil/frame.h
vendored
233
3rdparty/ffmpeg/include/libavutil/frame.h
vendored
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "avutil.h"
|
||||
#include "buffer.h"
|
||||
#include "channel_layout.h"
|
||||
#include "dict.h"
|
||||
#include "rational.h"
|
||||
#include "samplefmt.h"
|
||||
@@ -142,23 +143,6 @@ enum AVFrameSideDataType {
|
||||
*/
|
||||
AV_FRAME_DATA_ICC_PROFILE,
|
||||
|
||||
#if FF_API_FRAME_QP
|
||||
/**
|
||||
* Implementation-specific description of the format of AV_FRAME_QP_TABLE_DATA.
|
||||
* The contents of this side data are undocumented and internal; use
|
||||
* av_frame_set_qp_table() and av_frame_get_qp_table() to access this in a
|
||||
* meaningful way instead.
|
||||
*/
|
||||
AV_FRAME_DATA_QP_TABLE_PROPERTIES,
|
||||
|
||||
/**
|
||||
* Raw QP table data. Its format is described by
|
||||
* AV_FRAME_DATA_QP_TABLE_PROPERTIES. Use av_frame_set_qp_table() and
|
||||
* av_frame_get_qp_table() to access this instead.
|
||||
*/
|
||||
AV_FRAME_DATA_QP_TABLE_DATA,
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
|
||||
* where the first uint32_t describes how many (1-3) of the other timecodes are used.
|
||||
@@ -198,6 +182,38 @@ enum AVFrameSideDataType {
|
||||
* Must be present for every frame which should have film grain applied.
|
||||
*/
|
||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS,
|
||||
|
||||
/**
|
||||
* Bounding boxes for object detection and classification,
|
||||
* as described by AVDetectionBBoxHeader.
|
||||
*/
|
||||
AV_FRAME_DATA_DETECTION_BBOXES,
|
||||
|
||||
/**
|
||||
* Dolby Vision RPU raw data, suitable for passing to x265
|
||||
* or other libraries. Array of uint8_t, with NAL emulation
|
||||
* bytes intact.
|
||||
*/
|
||||
AV_FRAME_DATA_DOVI_RPU_BUFFER,
|
||||
|
||||
/**
|
||||
* Parsed Dolby Vision metadata, suitable for passing to a software
|
||||
* implementation. The payload is the AVDOVIMetadata struct defined in
|
||||
* libavutil/dovi_meta.h.
|
||||
*/
|
||||
AV_FRAME_DATA_DOVI_METADATA,
|
||||
|
||||
/**
|
||||
* HDR Vivid dynamic metadata associated with a video frame. The payload is
|
||||
* an AVDynamicHDRVivid type and contains information for color
|
||||
* volume transform - CUVA 005.1-2021.
|
||||
*/
|
||||
AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
|
||||
|
||||
/**
|
||||
* Ambient viewing environment metadata, as defined by H.274.
|
||||
*/
|
||||
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT,
|
||||
};
|
||||
|
||||
enum AVActiveFormatDescription {
|
||||
@@ -220,11 +236,7 @@ enum AVActiveFormatDescription {
|
||||
typedef struct AVFrameSideData {
|
||||
enum AVFrameSideDataType type;
|
||||
uint8_t *data;
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size;
|
||||
#else
|
||||
size_t size;
|
||||
#endif
|
||||
AVDictionary *metadata;
|
||||
AVBufferRef *buf;
|
||||
} AVFrameSideData;
|
||||
@@ -319,21 +331,32 @@ typedef struct AVFrame {
|
||||
#define AV_NUM_DATA_POINTERS 8
|
||||
/**
|
||||
* pointer to the picture/channel planes.
|
||||
* This might be different from the first allocated byte
|
||||
* This might be different from the first allocated byte. For video,
|
||||
* it could even point to the end of the image data.
|
||||
*
|
||||
* All pointers in data and extended_data must point into one of the
|
||||
* AVBufferRef in buf or extended_buf.
|
||||
*
|
||||
* Some decoders access areas outside 0,0 - width,height, please
|
||||
* see avcodec_align_dimensions2(). Some filters and swscale can read
|
||||
* up to 16 bytes beyond the planes, if these filters are to be used,
|
||||
* then 16 extra bytes must be allocated.
|
||||
*
|
||||
* NOTE: Except for hwaccel formats, pointers not needed by the format
|
||||
* MUST be set to NULL.
|
||||
* NOTE: Pointers not needed by the format MUST be set to NULL.
|
||||
*
|
||||
* @attention In case of video, the data[] pointers can point to the
|
||||
* end of image data in order to reverse line order, when used in
|
||||
* combination with negative values in the linesize[] array.
|
||||
*/
|
||||
uint8_t *data[AV_NUM_DATA_POINTERS];
|
||||
|
||||
/**
|
||||
* For video, size in bytes of each picture line.
|
||||
* For audio, size in bytes of each plane.
|
||||
* For video, a positive or negative value, which is typically indicating
|
||||
* the size in bytes of each picture line, but it can also be:
|
||||
* - the negative byte size of lines for vertical flipping
|
||||
* (with data[n] pointing to the end of the data
|
||||
* - a positive or negative multiple of the byte size as for accessing
|
||||
* even and odd fields of a frame (possibly flipped)
|
||||
*
|
||||
* For audio, only linesize[0] may be set. For planar audio, each channel
|
||||
* plane must be the same size.
|
||||
@@ -345,6 +368,9 @@ typedef struct AVFrame {
|
||||
*
|
||||
* @note The linesize may be larger than the size of usable data -- there
|
||||
* may be extra padding present for performance reasons.
|
||||
*
|
||||
* @attention In case of video, line size values can be negative to achieve
|
||||
* a vertically inverted iteration over image lines.
|
||||
*/
|
||||
int linesize[AV_NUM_DATA_POINTERS];
|
||||
|
||||
@@ -410,15 +436,6 @@ typedef struct AVFrame {
|
||||
*/
|
||||
int64_t pts;
|
||||
|
||||
#if FF_API_PKT_PTS
|
||||
/**
|
||||
* PTS copied from the AVPacket that was decoded to produce this frame.
|
||||
* @deprecated use the pts field instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t pkt_pts;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
|
||||
* This is also the Presentation time of this AVFrame calculated from
|
||||
@@ -426,14 +443,26 @@ typedef struct AVFrame {
|
||||
*/
|
||||
int64_t pkt_dts;
|
||||
|
||||
/**
|
||||
* Time base for the timestamps in this frame.
|
||||
* In the future, this field may be set on frames output by decoders or
|
||||
* filters, but its value will be by default ignored on input to encoders
|
||||
* or filters.
|
||||
*/
|
||||
AVRational time_base;
|
||||
|
||||
#if FF_API_FRAME_PICTURE_NUMBER
|
||||
/**
|
||||
* picture number in bitstream order
|
||||
*/
|
||||
attribute_deprecated
|
||||
int coded_picture_number;
|
||||
/**
|
||||
* picture number in display order
|
||||
*/
|
||||
attribute_deprecated
|
||||
int display_picture_number;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* quality (between 1 (good) and FF_LAMBDA_MAX (bad))
|
||||
@@ -445,14 +474,6 @@ typedef struct AVFrame {
|
||||
*/
|
||||
void *opaque;
|
||||
|
||||
#if FF_API_ERROR_FRAME
|
||||
/**
|
||||
* @deprecated unused
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint64_t error[AV_NUM_DATA_POINTERS];
|
||||
#endif
|
||||
|
||||
/**
|
||||
* When decoding, this signals how much the picture must be delayed.
|
||||
* extra_delay = repeat_pict / (2*fps)
|
||||
@@ -474,6 +495,7 @@ typedef struct AVFrame {
|
||||
*/
|
||||
int palette_has_changed;
|
||||
|
||||
#if FF_API_REORDERED_OPAQUE
|
||||
/**
|
||||
* reordered opaque 64 bits (generally an integer or a double precision float
|
||||
* PTS but can be anything).
|
||||
@@ -481,24 +503,32 @@ typedef struct AVFrame {
|
||||
* that time,
|
||||
* the decoder reorders values as needed and sets AVFrame.reordered_opaque
|
||||
* to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
|
||||
*
|
||||
* @deprecated Use AV_CODEC_FLAG_COPY_OPAQUE instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t reordered_opaque;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Sample rate of the audio data.
|
||||
*/
|
||||
int sample_rate;
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* Channel layout of the audio data.
|
||||
* @deprecated use ch_layout instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
uint64_t channel_layout;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* AVBuffer references backing the data for this frame. If all elements of
|
||||
* this array are NULL, then this frame is not reference counted. This array
|
||||
* must be filled contiguously -- if buf[i] is non-NULL then buf[j] must
|
||||
* also be non-NULL for all j < i.
|
||||
* AVBuffer references backing the data for this frame. All the pointers in
|
||||
* data and extended_data must point inside one of the buffers in buf or
|
||||
* extended_buf. This array must be filled contiguously -- if buf[i] is
|
||||
* non-NULL then buf[j] must also be non-NULL for all j < i.
|
||||
*
|
||||
* There may be at most one AVBuffer per data plane, so for video this array
|
||||
* always contains all the references. For planar audio with more than
|
||||
@@ -588,13 +618,18 @@ typedef struct AVFrame {
|
||||
*/
|
||||
int64_t pkt_pos;
|
||||
|
||||
#if FF_API_PKT_DURATION
|
||||
/**
|
||||
* duration of the corresponding packet, expressed in
|
||||
* AVStream->time_base units, 0 if unknown.
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
*
|
||||
* @deprecated use duration instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t pkt_duration;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* metadata.
|
||||
@@ -616,12 +651,16 @@ typedef struct AVFrame {
|
||||
#define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
|
||||
#define FF_DECODE_ERROR_DECODE_SLICES 8
|
||||
|
||||
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||
/**
|
||||
* number of audio channels, only used for audio.
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
* @deprecated use ch_layout instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int channels;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* size of the corresponding packet containing the compressed
|
||||
@@ -632,24 +671,6 @@ typedef struct AVFrame {
|
||||
*/
|
||||
int pkt_size;
|
||||
|
||||
#if FF_API_FRAME_QP
|
||||
/**
|
||||
* QP table
|
||||
*/
|
||||
attribute_deprecated
|
||||
int8_t *qscale_table;
|
||||
/**
|
||||
* QP store stride
|
||||
*/
|
||||
attribute_deprecated
|
||||
int qstride;
|
||||
|
||||
attribute_deprecated
|
||||
int qscale_type;
|
||||
|
||||
attribute_deprecated
|
||||
AVBufferRef *qp_table_buf;
|
||||
#endif
|
||||
/**
|
||||
* For hwaccel-format frames, this should be a reference to the
|
||||
* AVHWFramesContext describing the frame.
|
||||
@@ -695,70 +716,18 @@ typedef struct AVFrame {
|
||||
* for the target frame's private_ref field.
|
||||
*/
|
||||
AVBufferRef *private_ref;
|
||||
|
||||
/**
|
||||
* Channel layout of the audio data.
|
||||
*/
|
||||
AVChannelLayout ch_layout;
|
||||
|
||||
/**
|
||||
* Duration of the frame, in the same units as pts. 0 if unknown.
|
||||
*/
|
||||
int64_t duration;
|
||||
} AVFrame;
|
||||
|
||||
#if FF_API_FRAME_GET_SET
|
||||
/**
|
||||
* Accessors for some AVFrame fields. These used to be provided for ABI
|
||||
* compatibility, and do not need to be used anymore.
|
||||
*/
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_pkt_duration (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_duration (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_pkt_pos (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int64_t av_frame_get_channel_layout (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_channels (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_channels (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_sample_rate (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_sample_rate (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
AVDictionary *av_frame_get_metadata (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_decode_error_flags (const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_decode_error_flags (AVFrame *frame, int val);
|
||||
attribute_deprecated
|
||||
int av_frame_get_pkt_size(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_pkt_size(AVFrame *frame, int val);
|
||||
#if FF_API_FRAME_QP
|
||||
attribute_deprecated
|
||||
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
|
||||
attribute_deprecated
|
||||
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
|
||||
#endif
|
||||
attribute_deprecated
|
||||
enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
|
||||
attribute_deprecated
|
||||
enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
|
||||
attribute_deprecated
|
||||
void av_frame_set_color_range(AVFrame *frame, enum AVColorRange val);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the name of a colorspace.
|
||||
* @return a static string identifying the colorspace; can be NULL.
|
||||
*/
|
||||
const char *av_get_colorspace_name(enum AVColorSpace val);
|
||||
|
||||
/**
|
||||
* Allocate an AVFrame and set its fields to default values. The resulting
|
||||
@@ -827,7 +796,7 @@ void av_frame_move_ref(AVFrame *dst, AVFrame *src);
|
||||
* The following fields must be set on frame before calling this function:
|
||||
* - format (pixel format for video, sample format for audio)
|
||||
* - width and height for video
|
||||
* - nb_samples and channel_layout for audio
|
||||
* - nb_samples and ch_layout for audio
|
||||
*
|
||||
* This function will fill AVFrame.data and AVFrame.buf arrays and, if
|
||||
* necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
|
||||
@@ -864,7 +833,8 @@ int av_frame_is_writable(AVFrame *frame);
|
||||
* Ensure that the frame data is writable, avoiding data copy if possible.
|
||||
*
|
||||
* Do nothing if the frame is writable, allocate new buffers and copy the data
|
||||
* if it is not.
|
||||
* if it is not. Non-refcounted frames behave as non-writable, i.e. a copy
|
||||
* is always made.
|
||||
*
|
||||
* @return 0 on success, a negative AVERROR on error.
|
||||
*
|
||||
@@ -899,6 +869,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
|
||||
/**
|
||||
* Get the buffer reference a given data plane is stored in.
|
||||
*
|
||||
* @param frame the frame to get the plane's buffer from
|
||||
* @param plane index of the data plane of interest in frame->extended_data.
|
||||
*
|
||||
* @return the buffer reference that contains the plane or NULL if the input
|
||||
@@ -917,11 +888,7 @@ AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
|
||||
*/
|
||||
AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
|
||||
enum AVFrameSideDataType type,
|
||||
#if FF_API_BUFFER_SIZE_T
|
||||
int size);
|
||||
#else
|
||||
size_t size);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add a new side data to a frame from an existing AVBufferRef
|
||||
|
||||
6
3rdparty/ffmpeg/include/libavutil/hash.h
vendored
6
3rdparty/ffmpeg/include/libavutil/hash.h
vendored
@@ -30,8 +30,6 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_hash Hash Functions
|
||||
* @ingroup lavu_crypto
|
||||
@@ -182,11 +180,7 @@ void av_hash_init(struct AVHashContext *ctx);
|
||||
* @param[in] src Data to be added to the hash context
|
||||
* @param[in] len Size of the additional data
|
||||
*/
|
||||
#if FF_API_CRYPTO_SIZE_T
|
||||
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
|
||||
#else
|
||||
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Finalize a hash context and compute the actual hash value.
|
||||
|
||||
285
3rdparty/ffmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h
vendored
Normal file
285
3rdparty/ffmpeg/include/libavutil/hdr_dynamic_vivid_metadata.h
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Limin Wang <lance.lmwang at gmail.com>
|
||||
*
|
||||
* 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 AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H
|
||||
#define AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H
|
||||
|
||||
#include "frame.h"
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
* Color tone mapping parameters at a processing window in a dynamic metadata for
|
||||
* CUVA 005.1:2021.
|
||||
*/
|
||||
typedef struct AVHDRVividColorToneMappingParams {
|
||||
/**
|
||||
* The nominal maximum display luminance of the targeted system display,
|
||||
* in multiples of 1.0/4095 candelas per square metre. The value shall be in
|
||||
* the range of 0.0 to 1.0, inclusive.
|
||||
*/
|
||||
AVRational targeted_system_display_maximum_luminance;
|
||||
|
||||
/**
|
||||
* This flag indicates that transfer the base paramter(for value of 1)
|
||||
*/
|
||||
int base_enable_flag;
|
||||
|
||||
/**
|
||||
* base_param_m_p in the base parameter,
|
||||
* in multiples of 1.0/16383. The value shall be in
|
||||
* the range of 0.0 to 1.0, inclusive.
|
||||
*/
|
||||
AVRational base_param_m_p;
|
||||
|
||||
/**
|
||||
* base_param_m_m in the base parameter,
|
||||
* in multiples of 1.0/10. The value shall be in
|
||||
* the range of 0.0 to 6.3, inclusive.
|
||||
*/
|
||||
AVRational base_param_m_m;
|
||||
|
||||
/**
|
||||
* base_param_m_a in the base parameter,
|
||||
* in multiples of 1.0/1023. The value shall be in
|
||||
* the range of 0.0 to 1.0 inclusive.
|
||||
*/
|
||||
AVRational base_param_m_a;
|
||||
|
||||
/**
|
||||
* base_param_m_b in the base parameter,
|
||||
* in multiples of 1/1023. The value shall be in
|
||||
* the range of 0.0 to 1.0, inclusive.
|
||||
*/
|
||||
AVRational base_param_m_b;
|
||||
|
||||
/**
|
||||
* base_param_m_n in the base parameter,
|
||||
* in multiples of 1.0/10. The value shall be in
|
||||
* the range of 0.0 to 6.3, inclusive.
|
||||
*/
|
||||
AVRational base_param_m_n;
|
||||
|
||||
/**
|
||||
* indicates k1_0 in the base parameter,
|
||||
* base_param_k1 <= 1: k1_0 = base_param_k1
|
||||
* base_param_k1 > 1: reserved
|
||||
*/
|
||||
int base_param_k1;
|
||||
|
||||
/**
|
||||
* indicates k2_0 in the base parameter,
|
||||
* base_param_k2 <= 1: k2_0 = base_param_k2
|
||||
* base_param_k2 > 1: reserved
|
||||
*/
|
||||
int base_param_k2;
|
||||
|
||||
/**
|
||||
* indicates k3_0 in the base parameter,
|
||||
* base_param_k3 == 1: k3_0 = base_param_k3
|
||||
* base_param_k3 == 2: k3_0 = maximum_maxrgb
|
||||
* base_param_k3 > 2: reserved
|
||||
*/
|
||||
int base_param_k3;
|
||||
|
||||
/**
|
||||
* This flag indicates that delta mode of base paramter(for value of 1)
|
||||
*/
|
||||
int base_param_Delta_enable_mode;
|
||||
|
||||
/**
|
||||
* base_param_Delta in the base parameter,
|
||||
* in multiples of 1.0/127. The value shall be in
|
||||
* the range of 0.0 to 1.0, inclusive.
|
||||
*/
|
||||
AVRational base_param_Delta;
|
||||
|
||||
/**
|
||||
* indicates 3Spline_enable_flag in the base parameter,
|
||||
* This flag indicates that transfer three Spline of base paramter(for value of 1)
|
||||
*/
|
||||
int three_Spline_enable_flag;
|
||||
|
||||
/**
|
||||
* The number of three Spline. The value shall be in the range
|
||||
* of 1 to 2, inclusive.
|
||||
*/
|
||||
int three_Spline_num;
|
||||
|
||||
/**
|
||||
* The mode of three Spline. the value shall be in the range
|
||||
* of 0 to 3, inclusive.
|
||||
*/
|
||||
int three_Spline_TH_mode;
|
||||
|
||||
/**
|
||||
* three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive
|
||||
* and in multiples of 1.0/255.
|
||||
*
|
||||
*/
|
||||
AVRational three_Spline_TH_enable_MB;
|
||||
|
||||
/**
|
||||
* 3Spline_TH_enable of three Spline.
|
||||
* The value shall be in the range of 0.0 to 1.0, inclusive.
|
||||
* and in multiples of 1.0/4095.
|
||||
*/
|
||||
AVRational three_Spline_TH_enable;
|
||||
|
||||
/**
|
||||
* 3Spline_TH_Delta1 of three Spline.
|
||||
* The value shall be in the range of 0.0 to 0.25, inclusive,
|
||||
* and in multiples of 0.25/1023.
|
||||
*/
|
||||
AVRational three_Spline_TH_Delta1;
|
||||
|
||||
/**
|
||||
* 3Spline_TH_Delta2 of three Spline.
|
||||
* The value shall be in the range of 0.0 to 0.25, inclusive,
|
||||
* and in multiples of 0.25/1023.
|
||||
*/
|
||||
AVRational three_Spline_TH_Delta2;
|
||||
|
||||
/**
|
||||
* 3Spline_enable_Strength of three Spline.
|
||||
* The value shall be in the range of 0.0 to 1.0, inclusive,
|
||||
* and in multiples of 1.0/255.
|
||||
*/
|
||||
AVRational three_Spline_enable_Strength;
|
||||
} AVHDRVividColorToneMappingParams;
|
||||
|
||||
|
||||
/**
|
||||
* Color transform parameters at a processing window in a dynamic metadata for
|
||||
* CUVA 005.1:2021.
|
||||
*/
|
||||
typedef struct AVHDRVividColorTransformParams {
|
||||
/**
|
||||
* Indicates the minimum brightness of the displayed content.
|
||||
* The values should be in the range of 0.0 to 1.0,
|
||||
* inclusive and in multiples of 1/4095.
|
||||
*/
|
||||
AVRational minimum_maxrgb;
|
||||
|
||||
/**
|
||||
* Indicates the average brightness of the displayed content.
|
||||
* The values should be in the range of 0.0 to 1.0,
|
||||
* inclusive and in multiples of 1/4095.
|
||||
*/
|
||||
AVRational average_maxrgb;
|
||||
|
||||
/**
|
||||
* Indicates the variance brightness of the displayed content.
|
||||
* The values should be in the range of 0.0 to 1.0,
|
||||
* inclusive and in multiples of 1/4095.
|
||||
*/
|
||||
AVRational variance_maxrgb;
|
||||
|
||||
/**
|
||||
* Indicates the maximum brightness of the displayed content.
|
||||
* The values should be in the range of 0.0 to 1.0, inclusive
|
||||
* and in multiples of 1/4095.
|
||||
*/
|
||||
AVRational maximum_maxrgb;
|
||||
|
||||
/**
|
||||
* This flag indicates that the metadata for the tone mapping function in
|
||||
* the processing window is present (for value of 1).
|
||||
*/
|
||||
int tone_mapping_mode_flag;
|
||||
|
||||
/**
|
||||
* The number of tone mapping param. The value shall be in the range
|
||||
* of 1 to 2, inclusive.
|
||||
*/
|
||||
int tone_mapping_param_num;
|
||||
|
||||
/**
|
||||
* The color tone mapping parameters.
|
||||
*/
|
||||
AVHDRVividColorToneMappingParams tm_params[2];
|
||||
|
||||
/**
|
||||
* This flag indicates that the metadata for the color saturation mapping in
|
||||
* the processing window is present (for value of 1).
|
||||
*/
|
||||
int color_saturation_mapping_flag;
|
||||
|
||||
/**
|
||||
* The number of color saturation param. The value shall be in the range
|
||||
* of 0 to 7, inclusive.
|
||||
*/
|
||||
int color_saturation_num;
|
||||
|
||||
/**
|
||||
* Indicates the color correction strength parameter.
|
||||
* The values should be in the range of 0.0 to 2.0, inclusive
|
||||
* and in multiples of 1/128.
|
||||
*/
|
||||
AVRational color_saturation_gain[8];
|
||||
} AVHDRVividColorTransformParams;
|
||||
|
||||
/**
|
||||
* This struct represents dynamic metadata for color volume transform -
|
||||
* CUVA 005.1:2021 standard
|
||||
*
|
||||
* To be used as payload of a AVFrameSideData or AVPacketSideData with the
|
||||
* appropriate type.
|
||||
*
|
||||
* @note The struct should be allocated with
|
||||
* av_dynamic_hdr_vivid_alloc() and its size is not a part of
|
||||
* the public ABI.
|
||||
*/
|
||||
typedef struct AVDynamicHDRVivid {
|
||||
/**
|
||||
* The system start code. The value shall be set to 0x01.
|
||||
*/
|
||||
uint8_t system_start_code;
|
||||
|
||||
/**
|
||||
* The number of processing windows. The value shall be set to 0x01
|
||||
* if the system_start_code is 0x01.
|
||||
*/
|
||||
uint8_t num_windows;
|
||||
|
||||
/**
|
||||
* The color transform parameters for every processing window.
|
||||
*/
|
||||
AVHDRVividColorTransformParams params[3];
|
||||
} AVDynamicHDRVivid;
|
||||
|
||||
/**
|
||||
* Allocate an AVDynamicHDRVivid structure and set its fields to
|
||||
* default values. The resulting struct can be freed using av_freep().
|
||||
*
|
||||
* @return An AVDynamicHDRVivid filled with default values or NULL
|
||||
* on failure.
|
||||
*/
|
||||
AVDynamicHDRVivid *av_dynamic_hdr_vivid_alloc(size_t *size);
|
||||
|
||||
/**
|
||||
* Allocate a complete AVDynamicHDRVivid and add it to the frame.
|
||||
* @param frame The frame which side data is added to.
|
||||
*
|
||||
* @return The AVDynamicHDRVivid structure to be filled by caller or NULL
|
||||
* on failure.
|
||||
*/
|
||||
AVDynamicHDRVivid *av_dynamic_hdr_vivid_create_side_data(AVFrame *frame);
|
||||
|
||||
#endif /* AVUTIL_HDR_DYNAMIC_VIVID_METADATA_H */
|
||||
1
3rdparty/ffmpeg/include/libavutil/hmac.h
vendored
1
3rdparty/ffmpeg/include/libavutil/hmac.h
vendored
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "version.h"
|
||||
/**
|
||||
* @defgroup lavu_hmac HMAC
|
||||
* @ingroup lavu_crypto
|
||||
|
||||
@@ -249,7 +249,7 @@ const char *av_hwdevice_get_type_name(enum AVHWDeviceType type);
|
||||
/**
|
||||
* Iterate over supported device types.
|
||||
*
|
||||
* @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type
|
||||
* @param prev AV_HWDEVICE_TYPE_NONE initially, then the previous type
|
||||
* returned by this function in subsequent iterations.
|
||||
* @return The next usable device type from enum AVHWDeviceType, or
|
||||
* AV_HWDEVICE_TYPE_NONE if there are no more.
|
||||
@@ -571,6 +571,10 @@ enum {
|
||||
* possible with the given arguments and hwframe setup, while other return
|
||||
* values indicate that it failed somehow.
|
||||
*
|
||||
* On failure, the destination frame will be left blank, except for the
|
||||
* hw_frames_ctx/format fields thay may have been set by the caller - those will
|
||||
* be preserved as they were.
|
||||
*
|
||||
* @param dst Destination frame, to contain the mapping.
|
||||
* @param src Source frame, to be mapped.
|
||||
* @param flags Some combination of AV_HWFRAME_MAP_* flags.
|
||||
@@ -587,6 +591,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
|
||||
*
|
||||
* @param derived_frame_ctx On success, a reference to the newly created
|
||||
* AVHWFramesContext.
|
||||
* @param format The AVPixelFormat for the derived context.
|
||||
* @param derived_device_ctx A reference to the device to create the new
|
||||
* AVHWFramesContext on.
|
||||
* @param source_frame_ctx A reference to an existing AVHWFramesContext
|
||||
|
||||
@@ -164,6 +164,15 @@ typedef struct AVD3D11VAFramesContext {
|
||||
* This field is ignored/invalid if a user-allocated texture is provided.
|
||||
*/
|
||||
UINT MiscFlags;
|
||||
|
||||
/**
|
||||
* In case if texture structure member above is not NULL contains the same texture
|
||||
* pointer for all elements and different indexes into the array texture.
|
||||
* In case if texture structure member above is NULL, all elements contains
|
||||
* pointers to separate non-array textures and 0 indexes.
|
||||
* This field is ignored/invalid if a user-allocated texture is provided.
|
||||
*/
|
||||
AVD3D11FrameDescriptor *texture_infos;
|
||||
} AVD3D11VAFramesContext;
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_D3D11VA_H */
|
||||
|
||||
@@ -31,6 +31,31 @@ typedef struct AVMediaCodecDeviceContext {
|
||||
* This is the default surface used by decoders on this device.
|
||||
*/
|
||||
void *surface;
|
||||
|
||||
/**
|
||||
* Pointer to ANativeWindow.
|
||||
*
|
||||
* It both surface and native_window is NULL, try to create it
|
||||
* automatically if create_window is true and OS support
|
||||
* createPersistentInputSurface.
|
||||
*
|
||||
* It can be used as output surface for decoder and input surface for
|
||||
* encoder.
|
||||
*/
|
||||
void *native_window;
|
||||
|
||||
/**
|
||||
* Enable createPersistentInputSurface automatically.
|
||||
*
|
||||
* Disabled by default.
|
||||
*
|
||||
* It can be enabled by setting this flag directly, or by setting
|
||||
* AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key.
|
||||
* The second method is useful for ffmpeg cmdline, e.g., we can enable it
|
||||
* via:
|
||||
* -init_hw_device mediacodec=mediacodec,create_window=1
|
||||
*/
|
||||
int create_window;
|
||||
} AVMediaCodecDeviceContext;
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef AVUTIL_HWCONTEXT_QSV_H
|
||||
#define AVUTIL_HWCONTEXT_QSV_H
|
||||
|
||||
#include <mfx/mfxvideo.h>
|
||||
#include <mfxvideo.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
@@ -34,6 +34,17 @@
|
||||
*/
|
||||
typedef struct AVQSVDeviceContext {
|
||||
mfxSession session;
|
||||
/**
|
||||
* The mfxLoader handle used for mfxSession creation
|
||||
*
|
||||
* This field is only available for oneVPL user. For non-oneVPL user, this
|
||||
* field must be set to NULL.
|
||||
*
|
||||
* Filled by the user before calling av_hwdevice_ctx_init() and should be
|
||||
* cast to mfxLoader handle. Deallocating the AVHWDeviceContext will always
|
||||
* release this interface.
|
||||
*/
|
||||
void *loader;
|
||||
} AVQSVDeviceContext;
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,17 +23,21 @@
|
||||
|
||||
#include <VideoToolbox/VideoToolbox.h>
|
||||
|
||||
#include "frame.h"
|
||||
#include "pixfmt.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
* An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
|
||||
*
|
||||
* This API currently does not support frame allocation, as the raw VideoToolbox
|
||||
* API does allocation, and FFmpeg itself never has the need to allocate frames.
|
||||
* This API supports frame allocation using a native CVPixelBufferPool
|
||||
* instead of an AVBufferPool.
|
||||
*
|
||||
* If the API user sets a custom pool, AVHWFramesContext.pool must return
|
||||
* AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef.
|
||||
* Note that the underlying CVPixelBuffer could be retained by OS frameworks
|
||||
* depending on application usage, so it is preferable to let CoreVideo manage
|
||||
* the pool using the default implementation.
|
||||
*
|
||||
* Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always
|
||||
* NULL.
|
||||
@@ -57,4 +61,36 @@ uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt);
|
||||
*/
|
||||
uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, bool full_range);
|
||||
|
||||
/**
|
||||
* Convert an AVChromaLocation to a VideoToolbox/CoreVideo chroma location string.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
CFStringRef av_map_videotoolbox_chroma_loc_from_av(enum AVChromaLocation loc);
|
||||
|
||||
/**
|
||||
* Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
CFStringRef av_map_videotoolbox_color_matrix_from_av(enum AVColorSpace space);
|
||||
|
||||
/**
|
||||
* Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries string.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pri);
|
||||
|
||||
/**
|
||||
* Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color transfer
|
||||
* function string.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc);
|
||||
|
||||
/**
|
||||
* Update a CVPixelBufferRef's metadata to based on an AVFrame.
|
||||
* Returns 0 if no known equivalent was found.
|
||||
*/
|
||||
int av_vt_pixbuf_set_attachments(void *log_ctx,
|
||||
CVPixelBufferRef pixbuf, const struct AVFrame *src);
|
||||
|
||||
#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */
|
||||
|
||||
151
3rdparty/ffmpeg/include/libavutil/hwcontext_vulkan.h
vendored
151
3rdparty/ffmpeg/include/libavutil/hwcontext_vulkan.h
vendored
@@ -19,6 +19,9 @@
|
||||
#ifndef AVUTIL_HWCONTEXT_VULKAN_H
|
||||
#define AVUTIL_HWCONTEXT_VULKAN_H
|
||||
|
||||
#if defined(_WIN32) && !defined(VK_USE_PLATFORM_WIN32_KHR)
|
||||
#define VK_USE_PLATFORM_WIN32_KHR
|
||||
#endif
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "pixfmt.h"
|
||||
@@ -41,43 +44,37 @@ typedef struct AVVulkanDeviceContext {
|
||||
* Custom memory allocator, else NULL
|
||||
*/
|
||||
const VkAllocationCallbacks *alloc;
|
||||
|
||||
/**
|
||||
* Vulkan instance. Must be at least version 1.1.
|
||||
* Pointer to the instance-provided vkGetInstanceProcAddr loading function.
|
||||
* If NULL, will pick either libvulkan or libvolk, depending on libavutil's
|
||||
* compilation settings, and set this field.
|
||||
*/
|
||||
PFN_vkGetInstanceProcAddr get_proc_addr;
|
||||
|
||||
/**
|
||||
* Vulkan instance. Must be at least version 1.2.
|
||||
*/
|
||||
VkInstance inst;
|
||||
|
||||
/**
|
||||
* Physical device
|
||||
*/
|
||||
VkPhysicalDevice phys_dev;
|
||||
|
||||
/**
|
||||
* Active device
|
||||
*/
|
||||
VkDevice act_dev;
|
||||
|
||||
/**
|
||||
* Queue family index for graphics
|
||||
* @note av_hwdevice_create() will set all 3 queue indices if unset
|
||||
* If there is no dedicated queue for compute or transfer operations,
|
||||
* they will be set to the graphics queue index which can handle both.
|
||||
* nb_graphics_queues indicates how many queues were enabled for the
|
||||
* graphics queue (must be at least 1)
|
||||
* This structure should be set to the set of features that present and enabled
|
||||
* during device creation. When a device is created by FFmpeg, it will default to
|
||||
* enabling all that are present of the shaderImageGatherExtended,
|
||||
* fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
|
||||
*/
|
||||
int queue_family_index;
|
||||
int nb_graphics_queues;
|
||||
/**
|
||||
* Queue family index to use for transfer operations, and the amount of queues
|
||||
* enabled. In case there is no dedicated transfer queue, nb_tx_queues
|
||||
* must be 0 and queue_family_tx_index must be the same as either the graphics
|
||||
* queue or the compute queue, if available.
|
||||
*/
|
||||
int queue_family_tx_index;
|
||||
int nb_tx_queues;
|
||||
/**
|
||||
* Queue family index for compute ops, and the amount of queues enabled.
|
||||
* In case there are no dedicated compute queues, nb_comp_queues must be
|
||||
* 0 and its queue family index must be set to the graphics queue.
|
||||
*/
|
||||
int queue_family_comp_index;
|
||||
int nb_comp_queues;
|
||||
VkPhysicalDeviceFeatures2 device_features;
|
||||
|
||||
/**
|
||||
* Enabled instance extensions.
|
||||
* If supplying your own device context, set this to an array of strings, with
|
||||
@@ -87,6 +84,7 @@ typedef struct AVVulkanDeviceContext {
|
||||
*/
|
||||
const char * const *enabled_inst_extensions;
|
||||
int nb_enabled_inst_extensions;
|
||||
|
||||
/**
|
||||
* Enabled device extensions. By default, VK_KHR_external_memory_fd,
|
||||
* VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier,
|
||||
@@ -97,32 +95,91 @@ typedef struct AVVulkanDeviceContext {
|
||||
*/
|
||||
const char * const *enabled_dev_extensions;
|
||||
int nb_enabled_dev_extensions;
|
||||
|
||||
/**
|
||||
* This structure should be set to the set of features that present and enabled
|
||||
* during device creation. When a device is created by FFmpeg, it will default to
|
||||
* enabling all that are present of the shaderImageGatherExtended,
|
||||
* fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
|
||||
* Queue family index for graphics operations, and the number of queues
|
||||
* enabled for it. If unavaiable, will be set to -1. Not required.
|
||||
* av_hwdevice_create() will attempt to find a dedicated queue for each
|
||||
* queue family, or pick the one with the least unrelated flags set.
|
||||
* Queue indices here may overlap if a queue has to share capabilities.
|
||||
*/
|
||||
VkPhysicalDeviceFeatures2 device_features;
|
||||
int queue_family_index;
|
||||
int nb_graphics_queues;
|
||||
|
||||
/**
|
||||
* Queue family index for transfer operations and the number of queues
|
||||
* enabled. Required.
|
||||
*/
|
||||
int queue_family_tx_index;
|
||||
int nb_tx_queues;
|
||||
|
||||
/**
|
||||
* Queue family index for compute operations and the number of queues
|
||||
* enabled. Required.
|
||||
*/
|
||||
int queue_family_comp_index;
|
||||
int nb_comp_queues;
|
||||
|
||||
/**
|
||||
* Queue family index for video encode ops, and the amount of queues enabled.
|
||||
* If the device doesn't support such, queue_family_encode_index will be -1.
|
||||
* Not required.
|
||||
*/
|
||||
int queue_family_encode_index;
|
||||
int nb_encode_queues;
|
||||
|
||||
/**
|
||||
* Queue family index for video decode ops, and the amount of queues enabled.
|
||||
* If the device doesn't support such, queue_family_decode_index will be -1.
|
||||
* Not required.
|
||||
*/
|
||||
int queue_family_decode_index;
|
||||
int nb_decode_queues;
|
||||
} AVVulkanDeviceContext;
|
||||
|
||||
/**
|
||||
* Defines the behaviour of frame allocation.
|
||||
*/
|
||||
typedef enum AVVkFrameFlags {
|
||||
/* Unless this flag is set, autodetected flags will be OR'd based on the
|
||||
* device and tiling during av_hwframe_ctx_init(). */
|
||||
AV_VK_FRAME_FLAG_NONE = (1ULL << 0),
|
||||
|
||||
/* Image planes will be allocated in a single VkDeviceMemory, rather
|
||||
* than as per-plane VkDeviceMemory allocations. Required for exporting
|
||||
* to VAAPI on Intel devices. */
|
||||
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1),
|
||||
} AVVkFrameFlags;
|
||||
|
||||
/**
|
||||
* Allocated as AVHWFramesContext.hwctx, used to set pool-specific options
|
||||
*/
|
||||
typedef struct AVVulkanFramesContext {
|
||||
/**
|
||||
* Controls the tiling of allocated frames.
|
||||
* Controls the tiling of allocated frames. If left as optimal tiling,
|
||||
* then during av_hwframe_ctx_init() will decide based on whether the device
|
||||
* supports DRM modifiers, or if the linear_images flag is set, otherwise
|
||||
* will allocate optimally-tiled images.
|
||||
*/
|
||||
VkImageTiling tiling;
|
||||
|
||||
/**
|
||||
* Defines extra usage of output frames. If left as 0, the following bits
|
||||
* are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE.
|
||||
*/
|
||||
VkImageUsageFlagBits usage;
|
||||
|
||||
/**
|
||||
* Extension data for image creation.
|
||||
* If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain,
|
||||
* and the device supports DRM modifiers, then images will be allocated
|
||||
* with the specific requested DRM modifiers.
|
||||
* Additional structures may be added at av_hwframe_ctx_init() time,
|
||||
* which will be freed automatically on uninit(), so users need only free
|
||||
* any structures they've allocated themselves.
|
||||
*/
|
||||
void *create_pnext;
|
||||
|
||||
/**
|
||||
* Extension data for memory allocation. Must have as many entries as
|
||||
* the number of planes of the sw_format.
|
||||
@@ -131,6 +188,13 @@ typedef struct AVVulkanFramesContext {
|
||||
* extensions are present in enabled_dev_extensions.
|
||||
*/
|
||||
void *alloc_pnext[AV_NUM_DATA_POINTERS];
|
||||
|
||||
/**
|
||||
* A combination of AVVkFrameFlags. Unless AV_VK_FRAME_FLAG_NONE is set,
|
||||
* autodetected flags will be OR'd based on the device and tiling during
|
||||
* av_hwframe_ctx_init().
|
||||
*/
|
||||
AVVkFrameFlags flags;
|
||||
} AVVulkanFramesContext;
|
||||
|
||||
/*
|
||||
@@ -139,7 +203,7 @@ typedef struct AVVulkanFramesContext {
|
||||
* All frames, imported or allocated, will be created with the
|
||||
* VK_IMAGE_CREATE_ALIAS_BIT flag set, so the memory may be aliased if needed.
|
||||
*
|
||||
* If all three queue family indices in the device context are the same,
|
||||
* If all queue family indices in the device context are the same,
|
||||
* images will be created with the EXCLUSIVE sharing mode. Otherwise, all images
|
||||
* will be created using the CONCURRENT sharing mode.
|
||||
*
|
||||
@@ -158,8 +222,9 @@ typedef struct AVVkFrame {
|
||||
VkImageTiling tiling;
|
||||
|
||||
/**
|
||||
* Memory backing the images. Could be less than the amount of images
|
||||
* if importing from a DRM or VAAPI frame.
|
||||
* Memory backing the images. Could be less than the amount of planes,
|
||||
* in which case the offset value will indicate the binding offset of
|
||||
* each plane in the memory.
|
||||
*/
|
||||
VkDeviceMemory mem[AV_NUM_DATA_POINTERS];
|
||||
size_t size[AV_NUM_DATA_POINTERS];
|
||||
@@ -176,17 +241,29 @@ typedef struct AVVkFrame {
|
||||
VkImageLayout layout[AV_NUM_DATA_POINTERS];
|
||||
|
||||
/**
|
||||
* Synchronization semaphores. Must not be freed manually. Must be waited on
|
||||
* and signalled at every queue submission.
|
||||
* Could be less than the amount of images: either one per VkDeviceMemory
|
||||
* or one for the entire frame. All others will be set to VK_NULL_HANDLE.
|
||||
* Synchronization timeline semaphores, one for each sw_format plane.
|
||||
* Must not be freed manually. Must be waited on at every submission using
|
||||
* the value in sem_value, and must be signalled at every submission,
|
||||
* using an incremented value.
|
||||
*/
|
||||
VkSemaphore sem[AV_NUM_DATA_POINTERS];
|
||||
|
||||
/**
|
||||
* Up to date semaphore value at which each image becomes accessible.
|
||||
* Clients must wait on this value when submitting a command queue,
|
||||
* and increment it when signalling.
|
||||
*/
|
||||
uint64_t sem_value[AV_NUM_DATA_POINTERS];
|
||||
|
||||
/**
|
||||
* Internal data.
|
||||
*/
|
||||
struct AVVkFrameInternal *internal;
|
||||
|
||||
/**
|
||||
* Describes the binding offset of each plane to the VkDeviceMemory.
|
||||
*/
|
||||
ptrdiff_t offset[AV_NUM_DATA_POINTERS];
|
||||
} AVVkFrame;
|
||||
|
||||
/**
|
||||
|
||||
42
3rdparty/ffmpeg/include/libavutil/imgutils.h
vendored
42
3rdparty/ffmpeg/include/libavutil/imgutils.h
vendored
@@ -27,8 +27,10 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "avutil.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "pixdesc.h"
|
||||
#include "pixfmt.h"
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
@@ -46,6 +48,7 @@
|
||||
* component in the plane with the max pixel step.
|
||||
* @param max_pixstep_comps an array which is filled with the component
|
||||
* for each plane which has the max pixel step. May be NULL.
|
||||
* @param pixdesc the AVPixFmtDescriptor for the image, describing its format
|
||||
*/
|
||||
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
|
||||
const AVPixFmtDescriptor *pixdesc);
|
||||
@@ -63,6 +66,8 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
|
||||
* width width.
|
||||
*
|
||||
* @param linesizes array to be filled with the linesize for each plane
|
||||
* @param pix_fmt the AVPixelFormat of the image
|
||||
* @param width width of the image in pixels
|
||||
* @return >= 0 in case of success, a negative error code otherwise
|
||||
*/
|
||||
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
|
||||
@@ -71,6 +76,8 @@ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int wi
|
||||
* Fill plane sizes for an image with pixel format pix_fmt and height height.
|
||||
*
|
||||
* @param size the array to be filled with the size of each image plane
|
||||
* @param pix_fmt the AVPixelFormat of the image
|
||||
* @param height height of the image in pixels
|
||||
* @param linesizes the array containing the linesize for each
|
||||
* plane, should be filled by av_image_fill_linesizes()
|
||||
* @return >= 0 in case of success, a negative error code otherwise
|
||||
@@ -86,6 +93,8 @@ int av_image_fill_plane_sizes(size_t size[4], enum AVPixelFormat pix_fmt,
|
||||
* height height.
|
||||
*
|
||||
* @param data pointers array to be filled with the pointer for each image plane
|
||||
* @param pix_fmt the AVPixelFormat of the image
|
||||
* @param height height of the image in pixels
|
||||
* @param ptr the pointer to a buffer which will contain the image
|
||||
* @param linesizes the array containing the linesize for each
|
||||
* plane, should be filled by av_image_fill_linesizes()
|
||||
@@ -101,6 +110,11 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
|
||||
* The allocated image buffer has to be freed by using
|
||||
* av_freep(&pointers[0]).
|
||||
*
|
||||
* @param pointers array to be filled with the pointer for each image plane
|
||||
* @param linesizes the array filled with the linesize for each plane
|
||||
* @param w width of the image in pixels
|
||||
* @param h height of the image in pixels
|
||||
* @param pix_fmt the AVPixelFormat of the image
|
||||
* @param align the value to use for buffer size alignment
|
||||
* @return the size in bytes required for the image buffer, a negative
|
||||
* error code in case of failure
|
||||
@@ -117,18 +131,44 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
|
||||
* bytewidth must be contained by both absolute values of dst_linesize
|
||||
* and src_linesize, otherwise the function behavior is undefined.
|
||||
*
|
||||
* @param dst destination plane to copy to
|
||||
* @param dst_linesize linesize for the image plane in dst
|
||||
* @param src source plane to copy from
|
||||
* @param src_linesize linesize for the image plane in src
|
||||
* @param height height (number of lines) of the plane
|
||||
*/
|
||||
void av_image_copy_plane(uint8_t *dst, int dst_linesize,
|
||||
const uint8_t *src, int src_linesize,
|
||||
int bytewidth, int height);
|
||||
|
||||
/**
|
||||
* Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
|
||||
* available, this function will use special functionality for reading from such
|
||||
* memory, which may result in greatly improved performance compared to plain
|
||||
* av_image_copy_plane().
|
||||
*
|
||||
* bytewidth must be contained by both absolute values of dst_linesize
|
||||
* and src_linesize, otherwise the function behavior is undefined.
|
||||
*
|
||||
* @note The linesize parameters have the type ptrdiff_t here, while they are
|
||||
* int for av_image_copy_plane().
|
||||
* @note On x86, the linesizes currently need to be aligned to the cacheline
|
||||
* size (i.e. 64) to get improved performance.
|
||||
*/
|
||||
void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize,
|
||||
const uint8_t *src, ptrdiff_t src_linesize,
|
||||
ptrdiff_t bytewidth, int height);
|
||||
|
||||
/**
|
||||
* Copy image in src_data to dst_data.
|
||||
*
|
||||
* @param dst_data destination image data buffer to copy to
|
||||
* @param dst_linesizes linesizes for the image in dst_data
|
||||
* @param src_data source image data buffer to copy from
|
||||
* @param src_linesizes linesizes for the image in src_data
|
||||
* @param pix_fmt the AVPixelFormat of the image
|
||||
* @param width width of the image in pixels
|
||||
* @param height height of the image in pixels
|
||||
*/
|
||||
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
|
||||
const uint8_t *src_data[4], const int src_linesizes[4],
|
||||
|
||||
5
3rdparty/ffmpeg/include/libavutil/lfg.h
vendored
5
3rdparty/ffmpeg/include/libavutil/lfg.h
vendored
@@ -27,7 +27,7 @@
|
||||
/**
|
||||
* Context structure for the Lagged Fibonacci PRNG.
|
||||
* The exact layout, types and content of this struct may change and should
|
||||
* not be accessed directly. Only its sizeof() is guranteed to stay the same
|
||||
* not be accessed directly. Only its `sizeof()` is guaranteed to stay the same
|
||||
* to allow easy instanciation.
|
||||
*/
|
||||
typedef struct AVLFG {
|
||||
@@ -40,7 +40,7 @@ void av_lfg_init(AVLFG *c, unsigned int seed);
|
||||
/**
|
||||
* Seed the state of the ALFG using binary data.
|
||||
*
|
||||
* Return value: 0 on success, negative value (AVERROR) on failure.
|
||||
* @return 0 on success, negative value (AVERROR) on failure.
|
||||
*/
|
||||
int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length);
|
||||
|
||||
@@ -73,6 +73,7 @@ static inline unsigned int av_mlfg_get(AVLFG *c){
|
||||
* Get the next two numbers generated by a Box-Muller Gaussian
|
||||
* generator using the random numbers issued by lfg.
|
||||
*
|
||||
* @param lfg pointer to the contex structure
|
||||
* @param out array where the two generated numbers are placed
|
||||
*/
|
||||
void av_bmg_get(AVLFG *lfg, double out[2]);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user