Skip to content

Commit 50b7678

Browse files
mkschulzeclaude
andcommitted
chore(ffmpeg): vendor windows-x86_64 prebuilt tree + strip from-source CI
Captured from CI run 26067455150 build-windows job (commit f31bb80 — the one-shot upload-artifact step). Together with the already-bundled macos-arm64 + macos-x86_64 trees, all three macOS+Windows ffmpeg trees are now in the repo. Linux remains the only platform building from source on CI (next iteration after the JUCE_LINUX camera-code conditional lands). Bundled tree contents (140 files, 7.3 MB): - include/{libavcodec,libavformat,libavutil,libswscale,wels}/ — headers - lib/ — ffmpeg 7.1.2 + openh264 2.1.1 Windows DLLs alongside the MSVC .lib import libraries that scripts/build_ffmpeg_lgpl.sh's post-process generates via gendef + dlltool. Consumers (cmake/ffmpeg.cmake WIN32 path) link against .lib at build time and find the .dll at runtime via JamWide.exe-adjacent path (the workflow's Stage artifacts step copies the DLLs next to the executable). .gitignore: vendored .lib files were excluded by the existing `*.lib` general rule at line 41 (originally meant for build-output static libraries that shouldn't be committed). Added a `!libs/ffmpeg/**/*.lib` exception AFTER the general rule (gitignore later-rule-wins semantics) to whitelist the vendored MSVC import libraries. CI workflow (Windows job) simplification: - Stripped the "Vendor LGPL ffmpeg" step (15-25 min from-source ffmpeg + openh264 build via MSYS2 + autotools + gendef + dlltool). Now a no-op git checkout. - Stripped the "Upload vendored windows-x86_64 ffmpeg tree" one-shot capture step — served its purpose, tree now bundled. - Minimized MSYS2 install from `base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nasm mingw-w64-x86_64-binutils mingw-w64-x86_64-tools-git autoconf automake make git` (full build toolchain) down to `base-devel` (just bash + strings for the LGPL discipline gate). - KEPT the Verify LGPL discipline step — iterates the bundled tree to assert no libx264 contamination on every push. Net Windows CI time: ~25-30 min → ~6-8 min per run (saves ~20 min, matching the mac speedup from the earlier from-source removal). And the entire MSYS2 toolchain-rot surface (which took 3 separate fix commits — gendef PATH, .lib generation, pkgconfig) goes away. Net repo size: +7.3 MB. Negligible compared to JUCE/clap/wdl submodules. scripts/build_ffmpeg_lgpl.sh stays in the repo unchanged — useful for bumping ffmpeg or openh264 version (re-run, commit refreshed tree) or reproducibility verification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f31bb80 commit 50b7678

147 files changed

Lines changed: 34135 additions & 36 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/juce-build.yml

Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -184,52 +184,36 @@ jobs:
184184
- name: Setup CMake
185185
uses: lukka/get-cmake@latest
186186

187-
- name: Setup MSYS2 (for ffmpeg ./configure + make)
188-
# Phase 14.3-01: ffmpeg's autotools build needs a unix-like environment
189-
# on Windows. JamWide itself still builds via MSVC; only the vendored
190-
# ffmpeg+openh264 step uses MinGW64-gcc to produce DLLs (DLL ABI is
191-
# interop-stable with MSVC consumers).
187+
- name: Setup MSYS2 (for LGPL verify only)
188+
# The full from-source ffmpeg build packages (gcc, nasm, binutils,
189+
# tools-git, autoconf, automake, make) were dropped once
190+
# libs/ffmpeg/windows-x86_64/ landed bundled in the repo. The verify
191+
# step still wants bash + strings — base-devel covers both.
192+
# If you need to regenerate the vendored Windows tree (ffmpeg or
193+
# openh264 version bump), restore the full install list and re-add
194+
# the Vendor LGPL ffmpeg step temporarily.
192195
uses: msys2/setup-msys2@v2
193196
with:
194197
msystem: MINGW64
195198
update: true
196199
install: >-
197200
base-devel
198-
mingw-w64-x86_64-gcc
199-
mingw-w64-x86_64-pkg-config
200-
mingw-w64-x86_64-nasm
201-
mingw-w64-x86_64-binutils
202-
mingw-w64-x86_64-tools-git
203-
autoconf
204-
automake
205-
make
206-
git
207201
208-
- name: Vendor LGPL ffmpeg
209-
# Phase 14.3-01: produce libs/ffmpeg/windows-x86_64/ on the CI runner.
210-
# Invoked under MSYS2 bash so uname returns MINGW64_NT-* and the script
211-
# picks the windows-x86_64 leg (Cisco openh264 win64 prebuilt + ffmpeg
212-
# LGPL from source). All inputs are static; no untrusted github event
213-
# data flows into shell.
214-
shell: msys2 {0}
215-
run: bash scripts/build_ffmpeg_lgpl.sh
216-
217-
- name: Verify LGPL discipline
202+
- name: Verify LGPL discipline (vendored trees in libs/ffmpeg/)
203+
# Iterates every populated libs/ffmpeg/<platform>/ tree (Windows
204+
# vendored as of this commit) and asserts no libx264 strings + clean
205+
# PE-import dependency check. Same gate that the mac CI runs against
206+
# the bundled trees.
207+
# The "Vendor LGPL ffmpeg" rebuild-from-source step that used to run
208+
# here was removed once libs/ffmpeg/windows-x86_64/ landed bundled
209+
# in the repo — saves 15-25 min/CI run and eliminates the gendef/
210+
# dlltool/lib generation toolchain-rot surface that took multiple
211+
# iterations to get green. Run scripts/build_ffmpeg_lgpl.sh manually
212+
# under MSYS2 when bumping ffmpeg or openh264 version, then commit
213+
# the refreshed tree.
218214
shell: msys2 {0}
219215
run: bash scripts/verify_ffmpeg_lgpl.sh
220216

221-
- name: Upload vendored windows-x86_64 ffmpeg tree (one-shot for bundling)
222-
# Mirror of the mac-arm64 one-shot capture. Once libs/ffmpeg/windows-x86_64/
223-
# lands in the repo, the MSYS2 setup + Vendor LGPL ffmpeg + Verify
224-
# steps can be deleted from the Windows job entirely (saves 15-25 min
225-
# per CI run and eliminates the gendef/dlltool/lib generation
226-
# toolchain-rot surface that took multiple iterations to get green).
227-
uses: actions/upload-artifact@v4
228-
with:
229-
name: libs-ffmpeg-windows-x86_64
230-
path: libs/ffmpeg/windows-x86_64/
231-
retention-days: 7
232-
233217
- name: Configure CMake
234218
run: |
235219
cmake -B build `

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
!libs/ffmpeg/**/*.dylib
2929
!libs/ffmpeg/**/*.so
3030
!libs/ffmpeg/**/*.dll
31+
# .lib exception lives further down — after the `*.lib` general exclude
32+
# at line ~41 (otherwise the later general rule overrides this one).
3133

3234
# Fortran module files
3335
*.mod
@@ -38,6 +40,10 @@
3840
*.la
3941
*.a
4042
*.lib
43+
# EXCEPTION: vendored Windows ffmpeg MSVC import libraries — generated by
44+
# scripts/build_ffmpeg_lgpl.sh post-process and bundled at libs/ffmpeg/
45+
# windows-x86_64/lib/. Must come AFTER the *.lib rule above to override it.
46+
!libs/ffmpeg/**/*.lib
4147

4248
# Executables
4349
*.exe
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* AC-3 parser prototypes
3+
* Copyright (c) 2003 Fabrice Bellard
4+
* Copyright (c) 2003 Michael Niedermayer
5+
*
6+
* This file is part of FFmpeg.
7+
*
8+
* FFmpeg is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; either
11+
* version 2.1 of the License, or (at your option) any later version.
12+
*
13+
* FFmpeg is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
* Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public
19+
* License along with FFmpeg; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
*/
22+
23+
#ifndef AVCODEC_AC3_PARSER_H
24+
#define AVCODEC_AC3_PARSER_H
25+
26+
#include <stddef.h>
27+
#include <stdint.h>
28+
29+
/**
30+
* Extract the bitstream ID and the frame size from AC-3 data.
31+
*/
32+
int av_ac3_parse_header(const uint8_t *buf, size_t size,
33+
uint8_t *bitstream_id, uint16_t *frame_size);
34+
35+
36+
#endif /* AVCODEC_AC3_PARSER_H */
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of FFmpeg.
3+
*
4+
* FFmpeg is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* FFmpeg is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with FFmpeg; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef AVCODEC_ADTS_PARSER_H
20+
#define AVCODEC_ADTS_PARSER_H
21+
22+
#include <stddef.h>
23+
#include <stdint.h>
24+
25+
#define AV_AAC_ADTS_HEADER_SIZE 7
26+
27+
/**
28+
* Extract the number of samples and frames from AAC data.
29+
* @param[in] buf pointer to AAC data buffer
30+
* @param[out] samples Pointer to where number of samples is written
31+
* @param[out] frames Pointer to where number of frames is written
32+
* @return Returns 0 on success, error code on failure.
33+
*/
34+
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
35+
uint8_t *frames);
36+
37+
#endif /* AVCODEC_ADTS_PARSER_H */

0 commit comments

Comments
 (0)