Skip to content

Commit 6317eac

Browse files
committed
feat(pkg): add compat.ffmpeg 8.1.2 — full source build, config-snapshot form (no external build system)
- new descriptor shape: configure products frozen as generated_files (15 files, ~240KB) + exact make -n source list (2281 TUs incl. 157 NASM .asm); mcpp compiles everything directly — zero configure/make at build time - full internal-component hermetic LGPL-2.1+ profile (--disable-autodetect --disable-programs --disable-doc), linux-x86_64 only for now (compat.x11 precedent); macOS/Windows follow with their own snapshots - CN mirror: gitcode mcpp-res/ffmpeg release 8.1.2 (byte-identical, verified) - example: tests/examples/ffmpeg (cfg(linux)-gated dep, no-op off-Linux, gui-stack pattern); asserts versions + h264/hevc/av1/aac + demuxer count - MCPP_VERSION 0.0.94 → 0.0.95: the descriptor's per-glob flags key is 0.0.95 grammar (#223) — floor-first rollout as designed - descriptor is generated by ffmpeg-m tools/gen_descriptor.py (do not edit) Verified locally with mcpp 0.0.95: example test passes (ffmpeg 60.26, 358 demuxers, 157 .asm.o, 3260 SIMD symbols in binary); all five lint checks pass incl. mcpp xpkg parse.
1 parent 2208efc commit 6317eac

7 files changed

Lines changed: 10584 additions & 1 deletion

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# 收录 compat.ffmpeg 8.1.2 — 全源码直编形态(新形态首例)
2+
3+
> 日期: 2026-07-18
4+
> 来源: mcpplibs/ffmpeg-m 项目派生(该仓调研+POC 文档为完整背景:
5+
> `ffmpeg-m/.agents/docs/2026-07-18-ffmpeg-m-{research-and-plan,implementation}.md`)
6+
7+
## 形态判定:第五种形态——"全源码直编"(config 快照 + 源列表)
8+
9+
FFmpeg 属第三方上游 (a),但不落入既有四形态:它**不用 install() 跑外部构建系统**
10+
(openblas/opencv 形态),而是把上游 `./configure` 的产物一次性冻结进描述符,由
11+
mcpp 直接编译全部源码:
12+
13+
- `generated_files`:15 个 configure 产物(config.h、config_components.{h,asm}、
14+
config.asm、avconfig.h、ffversion.h、9 个 `*_list.c`)≈ 240KB 内联 —— 对冻结的
15+
(target, profile) 是确定性纯文本;
16+
- `sources`:2281 条精确清单(2124 `.c` + **157 NASM `.asm`**),`make -n` 推导
17+
(ground truth,含 `_select` 闭包);
18+
- `flags`(mcpp 0.0.95 per-glob):每库 `BUILDING_<lib>` define + `.asm` 的
19+
`-Pconfig.asm`;NASM 的 `-I` 由 mcpp 自动从 include_dirs 馈送;
20+
- 消费者构建期**零 configure/make/cmake**;nasm 按 PATH → sandbox → xlings 惰性
21+
解析(xim 已收录)。
22+
23+
描述符由 `ffmpeg-m/tools/gen_descriptor.py` 自动生成(329KB,勿手改);升级
24+
FFmpeg = 重跑生成器 + review diff。
25+
26+
## 配置档位
27+
28+
`--disable-autodetect --disable-programs --disable-doc`,其余全默认:全部内部组件
29+
(600+ decoders / 272 encoders / 358 demuxers / muxers / filters / 7 库全build),
30+
**LGPL-2.1+**(无 gpl/version3/nonfree),零宿主库探测(hermetic)。
31+
32+
## 平台
33+
34+
**linux(x86_64)only**(先例:compat.x11)。config 快照与源列表是 target 相关的
35+
(x86 编 NASM,aarch64 编 GAS `.S`);macOS/Windows 待各自快照生成后追加
36+
(ffmpeg-m 的 macOS CI job 已在产 gen/macos-aarch64 artifact)。
37+
38+
## 镜像
39+
40+
- GLOBAL: `https://ffmpeg.org/releases/ffmpeg-8.1.2.tar.gz`(官方发行物,
41+
sha256 `32faba5e…8bf22`,两次计算一致)
42+
- CN: `https://gitcode.com/mcpp-res/ffmpeg/releases/download/8.1.2/ffmpeg-8.1.2.tar.gz`
43+
(gtc 建仓+发布,已验证 200 + 字节一致)
44+
45+
## feature 评估
46+
47+
v1 无 feature。组件裁剪(slim 档)需要**成套**的 config 快照 + 源列表(features
48+
仅门控 sources,无法切换 generated_files),属"档位=独立版本/包"问题,与
49+
compat.opencv 的结论一致;待需求出现再议。
50+
51+
## 验证(mcpp 0.0.95,与本 PR bump 后的 CI pin 一致)
52+
53+
- `tests/examples/ffmpeg` 构建 16.3s(32 核),运行输出
54+
`ffmpeg 60.26: decoders+demuxers(358) ok`;
55+
- 断言:三库 major 版本(60/62/62)、h264/hevc/av1/aac 解码器存在、demuxer>300;
56+
- .asm 验证:157 个 `.asm.o` 全部产出,最终二进制含 3260 个 ssse3/avx2 符号;
57+
- 本地 lint 五项全过(语法/必填/无前导v/镜像表/`mcpp xpkg parse`)。
58+
59+
## 注意事项
60+
61+
- **本 PR 将 `MCPP_VERSION` 0.0.94 → 0.0.95**:描述符的 per-glob `flags` 键是
62+
0.0.95(#223)语法,0.0.94 的 resolver grammar lint 会拒绝(这正是"floor first,
63+
new grammar after"规则的预期行为)。
64+
- 上游源列表与 git tag n8.1.2 逐字节一致(已比对);ffversion.h 冻结为 "8.1.2"。
65+
- 相关 mcpp issue(ffmpeg-m 项目产出):#226(-iquote 相对路径)、#227(flags
66+
数组表)、#228(glob 花括号)、#229(依赖包 cfg 条件 sources——macOS 支持前置)。

‎.github/workflows/validate.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
# member, which links against spdlog's feature-compiled src/*.cpp. Also
1717
# carries standard = "c++fly" in the resolver grammar (0.0.91), so c++fly
1818
# descriptors get the lint WARN below, not a hard grammar-parse rejection.
19-
MCPP_VERSION: "0.0.94"
19+
MCPP_VERSION: "0.0.95"
2020

2121
jobs:
2222
lint:

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ mcpp self config --mirror CN # 切换至国内镜像,默认使用 GLOBAL 上
3636
| C 源码 compat(含 `features`) | [`compat.cjson`](pkgs/c/compat.cjson.lua) · [`compat.zlib`](pkgs/c/compat.zlib.lua) |
3737
| header-only(含 `features`) | [`compat.eigen`](pkgs/c/compat.eigen.lua) |
3838
| 外部构建系统(`install()` 从源码构建) | [`compat.openblas`](pkgs/c/compat.openblas.lua)(Make) · [`compat.opencv`](pkgs/c/compat.opencv.lua)(CMake) |
39+
| 全源码直编(config 快照 + 源列表,零外部构建系统) | [`compat.ffmpeg`](pkgs/c/compat.ffmpeg.lua)(2281 TU 含 NASM 汇编) |
3940
| C++23 module wrapper | [`nlohmann.json`](pkgs/n/nlohmann.json.lua) · [`marzer.tomlplusplus`](pkgs/m/marzer.tomlplusplus.lua) |
4041

4142
### 新增一个包

‎mcpp.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ members = [
1414
"tests/examples/cjson",
1515
"tests/examples/core",
1616
"tests/examples/eigen",
17+
"tests/examples/ffmpeg",
1718
"tests/examples/fmtlib.fmt",
1819
"tests/examples/gui-stack",
1920
"tests/examples/imgui",

0 commit comments

Comments
 (0)