You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Use when auditing or updating hand-written FFmpeg constants, macro aliases, and version-gated feature flags in Rust bindings. Trigger for tasks like comparing `pixfmt.h` / `channel_layout.h` / `error.h` against `src/avutil/*.rs`, checking whether FFmpeg 8.1 added constants, determining the first FFmpeg release that introduced a symbol, or adding `ffmpegX_Y` feature gates in `Cargo.toml`.
4
+
---
5
+
6
+
# FFmpeg Constant Sync
7
+
8
+
Audit upstream FFmpeg header macros against this repository's hand-written Rust constants, then gate each symbol by the earliest release tag that actually contains it.
9
+
10
+
Prefer release tags such as `n7.1`, `n8.0`, `n8.1` when answering questions about `.0` or `.1` releases. Only use release branches to inspect current maintenance-line state; branch heads may contain later backports.
11
+
12
+
## Use This Skill For
13
+
14
+
- Checking whether a specific FFmpeg release added any new constants.
15
+
- Syncing `src/avutil/pixfmt.rs`, `src/avutil/channel_layout.rs`, or `src/avutil/error.rs`.
16
+
- Deciding whether a symbol belongs behind `ffmpeg6`, `ffmpeg6_1`, `ffmpeg7_1`, `ffmpeg8`, `ffmpeg8_1`, etc.
17
+
- Adding missing feature boundaries in `Cargo.toml`.
18
+
- Verifying that Rust-exported constants match upstream macro names.
19
+
20
+
## Files To Audit
21
+
22
+
-`Cargo.toml`
23
+
-`src/avutil/pixfmt.rs`
24
+
-`src/avutil/channel_layout.rs`
25
+
-`src/avutil/error.rs`
26
+
- Sometimes `src/lib.rs` and `src/avutil/mod.rs` if a whole module is feature-gated
27
+
28
+
Primary upstream headers:
29
+
30
+
-`libavutil/pixfmt.h`
31
+
-`libavutil/channel_layout.h`
32
+
-`libavutil/error.h`
33
+
34
+
## Workflow
35
+
36
+
1. Identify the local hand-written constants and their current `#[cfg(feature = ...)]` gates.
37
+
2. Compare upstream header macros to local Rust exports.
38
+
3. For every disputed symbol, find the earliest FFmpeg release tag that contains it.
39
+
4. Update `Cargo.toml` feature boundaries if an intermediate version boundary is missing.
40
+
5. Gate symbols by the earliest release that contains them.
41
+
6. Verify with `DOCS_RS=1 cargo check` across the relevant feature chain.
42
+
43
+
## Rules
44
+
45
+
- Use release tags for release questions:
46
+
- Good: `n7.1`, `n8.0`, `n8.1`
47
+
- Less reliable for `.0` / `.1` questions: `release/8.0`, `release/8.1`
48
+
- Gate by first availability, not by the first version this repository happened to support.
49
+
- If a later feature inherits an earlier one, prefer the narrowest correct gate:
50
+
- Example: if a symbol exists since FFmpeg 6.0, use `ffmpeg6`, not `any(feature = "ffmpeg6", feature = "ffmpeg7")`
51
+
- When checking whether `8.1` added constants, diff `n8.0` vs `n8.1` directly.
52
+
- Distinguish:
53
+
- Missing symbol entirely
54
+
- Symbol present but feature gate too new
55
+
- Symbol present but feature gate too broad or imprecise
56
+
- Symbol already provided by generated `binding.rs`, so do not duplicate it in hand-written code
57
+
58
+
## Version Mapping
59
+
60
+
Current repository feature boundaries should follow this pattern when needed:
61
+
62
+
-`ffmpeg5`
63
+
-`ffmpeg6`
64
+
-`ffmpeg6_1`
65
+
-`ffmpeg7`
66
+
-`ffmpeg7_1`
67
+
-`ffmpeg8`
68
+
-`ffmpeg8_1`
69
+
70
+
If the repo is missing a needed boundary, add it to `Cargo.toml` before moving symbol gates.
71
+
72
+
## Verification
73
+
74
+
- Run `DOCS_RS=1 cargo check --features <feature>` for each affected boundary.
75
+
- At minimum, check the earliest feature that should expose a symbol and the previous feature that should not.
76
+
- If you need exact command patterns, read `references/tag-audit-commands.md`.
77
+
78
+
## Output Expectations
79
+
80
+
When reporting results:
81
+
82
+
- State whether the release added new constants or not.
83
+
- Name the exact tag pair used for the comparison.
84
+
- Call out symbols whose gates moved.
85
+
- Separate “missing constant” from “wrong version gate”.
0 commit comments