|
1 | | -= Ffmpeg Ffi — EXPLAINME |
| 1 | +// SPDX-License-Identifier: PMPL-1.0-or-later |
| 2 | += ffmpeg-ffi -- EXPLAINME |
2 | 3 | :toc: preamble |
3 | 4 |
|
4 | | -This document backs up the claims made in README with evidence and rationale. |
| 5 | +== "Zig FFI Bindings for FFmpeg with Formally Verified ABI Definitions in Idris2" |
5 | 6 |
|
6 | | -== What Is This? |
| 7 | +[quote, README.adoc] |
| 8 | +____ |
| 9 | +Zig FFI bindings for FFmpeg multimedia libraries (libavformat, libavcodec, libavutil, |
| 10 | +swresample, swscale), with formally verified ABI definitions in Idris2. |
| 11 | +____ |
7 | 12 |
|
8 | | -Ffmpeg Ffi is a hyperpolymath project. See README.adoc for usage. |
| 13 | +The repo follows the hyperpolymath ABI/FFI Universal Standard: Idris2 defines the ABI |
| 14 | +with dependent-type proofs for memory layout and alignment, Zig provides the C-compatible |
| 15 | +FFI, and a thin Rust shim handles FFmpeg opaque struct field access. See |
| 16 | +link:src/abi/Layout.idr[] for the memory layout proofs. |
9 | 17 |
|
10 | | -== Why These Choices? |
| 18 | +=== Evidence |
11 | 19 |
|
12 | | -=== Language |
| 20 | +[cols="2,3"] |
| 21 | +|=== |
| 22 | +| Path | Proves |
13 | 23 |
|
14 | | -The language(s) used in this project were chosen per the hyperpolymath |
15 | | -language policy (see CLAUDE.md for the full list of allowed/banned languages). |
| 24 | +| `src/abi/Types.idr` |
| 25 | +| Idris2 ABI type definitions exist |
16 | 26 |
|
17 | | -=== Architecture |
| 27 | +| `src/abi/Layout.idr` |
| 28 | +| Memory layout proofs are present |
18 | 29 |
|
19 | | -Architecture decisions are documented in `.machine_readable/` checkpoint files. |
| 30 | +| `src/abi/Foreign.idr` |
| 31 | +| FFI function declarations are formally specified |
20 | 32 |
|
21 | | -== Alternatives Considered |
| 33 | +| `src/main.zig` |
| 34 | +| Core Zig FFmpeg bindings with C FFI exports |
22 | 35 |
|
23 | | -(To be filled in as the project matures.) |
| 36 | +| `ffi/zig/` |
| 37 | +| Generic Zig FFI template implementation |
24 | 38 |
|
25 | | -== Proof of Claims |
26 | | - |
27 | | -(Link formal verification results from the `proven` repo where applicable.) |
| 39 | +| `shim/src/lib.rs` |
| 40 | +| Rust shim for opaque struct field access |
| 41 | +|=== |
0 commit comments