nandi/frqpublic Fork 0
eab184b
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Build libmoq_ffi ourselves, for the codecs the release leaves out

moq-ffi has `audio` and `video` features, on by default, and every Linux and
Android artifact its release publishes is built without them. They are what
carry Opus and H.264 -- so the object we were fetching could move a frame but
could not make one, and a call needs an encoder. The choice was to build this
once or to bind libopus and openh264 separately and reimplement what moq-video
already does; this builds it once.

That is the 440-crate compile that fetching avoided, so it makes a substituter
matter more rather than less. What it is not is a per-build cost: the pin moves
when someone moves it.

bindgenHook is not optional here. moq-video reaches VAAPI through libva-sys,
whose build script runs bindgen, and without LIBCLANG_PATH the build dies deep
inside a build script with "Unable to find libclang". libva and libdrm are in
for their headers only -- VAAPI is dlopened, so the object carries no
DT_NEEDED for it and a machine with no driver still loads this, falling back to
the openh264 that moq-video vendors and links statically.

Three surfaces wear this one version number, which is the whole argument for
generating bindings from the object rather than from a header:

    the published Linux/Android .so   206 functions, no codecs
    the published C header (Apple)    230 functions
    what the flake builds now         230 functions, codecs in

445 entry points bound, up from 403.

And the MoqError table is generated now, because hand-writing it was a trap
this build sprang. The variants are INSERTED into, not appended to: audio and
video add Audio and Video at 5 and 6 and shift every later variant down two.
A stale table does not report an unknown variant -- it reports a confident
wrong name for a real one, with the correct message still beside it, so
nothing looks broken. The smoke test said :reject for a connect timeout and
was believed for exactly as long as it took to read the message next to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-10T00:43:55-07:00 Browse files
eab184b parent: 7751d4f
modified deps.edn +9 -11
@@ -33,18 +33,16 @@
3333 {:name "joltmoq"
3434 :darwin ["libjoltmoq.dylib"]
3535 :linux ["libjoltmoq.so"]}
36- ;; moq-ffi's own object, fetched from its release rather than
37- ;; built — see the flake. It is not a second media plane: it is
38- ;; the transport half alone, behind UniFFI's C ABI, and it is
39- ;; here so `frq.moq.*` has something to load while the port off
40- ;; libjoltmoq happens. Both are declared for now, and the day
41- ;; frq.av stops calling joltmoq_* is the day that entry goes.
36+ ;; moq-ffi's own object, built by the flake. It is not a
37+ ;; second media plane: it is the transport half plus the
38+ ;; codecs, behind UniFFI's C ABI, and it is here so `frq.moq.*`
39+ ;; has something to load while the port off libjoltmoq
40+ ;; happens. Both are declared for now, and the day frq.av
41+ ;; stops calling joltmoq_* is the day that entry goes.
4242 ;;
43- ;; No :darwin — the release's Mac artifact is a DIFFERENT BUILD
44- ;; (moq-ffi's audio/video features are on there and off here),
45- ;; so naming a .dylib would load an object with 24 entry points
46- ;; the generated bindings do not describe. Linux and Android
47- ;; only, until they are built the same way.
43+ ;; No :darwin because :systems is not: the flake builds for
44+ ;; x86_64-linux and aarch64-linux, and a .dylib named here
45+ ;; would name a file nothing produces.
4846 {:name "moq_ffi"
4947 :linux ["libmoq_ffi.so"]}]
5048
@@ -33,18 +33,16 @@
33 {:name "joltmoq"33 {:name "joltmoq"
34 :darwin ["libjoltmoq.dylib"]34 :darwin ["libjoltmoq.dylib"]
35 :linux ["libjoltmoq.so"]}35 :linux ["libjoltmoq.so"]}
36- ;; moq-ffi's own object, fetched from its release rather than36+ ;; moq-ffi's own object, built by the flake. It is not a
37- ;; built — see the flake. It is not a second media plane: it is37+ ;; second media plane: it is the transport half plus the
38- ;; the transport half alone, behind UniFFI's C ABI, and it is38+ ;; codecs, behind UniFFI's C ABI, and it is here so `frq.moq.*`
39- ;; here so `frq.moq.*` has something to load while the port off39+ ;; has something to load while the port off libjoltmoq
40- ;; libjoltmoq happens. Both are declared for now, and the day40+ ;; happens. Both are declared for now, and the day frq.av
41- ;; frq.av stops calling joltmoq_* is the day that entry goes.41+ ;; stops calling joltmoq_* is the day that entry goes.
42 ;;42 ;;
43- ;; No :darwin — the release's Mac artifact is a DIFFERENT BUILD43+ ;; No :darwin because :systems is not: the flake builds for
44- ;; (moq-ffi's audio/video features are on there and off here),44+ ;; x86_64-linux and aarch64-linux, and a .dylib named here
45- ;; so naming a .dylib would load an object with 24 entry points45+ ;; would name a file nothing produces.
46- ;; the generated bindings do not describe. Linux and Android
47- ;; only, until they are built the same way.
48 {:name "moq_ffi"46 {:name "moq_ffi"
49 :linux ["libmoq_ffi.so"]}]47 :linux ["libmoq_ffi.so"]}]
50 48
modified flake.lock +18 -0
@@ -245,6 +245,23 @@
245245 "type": "github"
246246 }
247247 },
248+ "moq-src": {
249+ "flake": false,
250+ "locked": {
251+ "lastModified": 1788920358,
252+ "narHash": "sha256-vgZ0qWPkz8YdlqZoQQC45txXEFUO1xKNj+rv++tgMWo=",
253+ "owner": "kixelated",
254+ "repo": "moq",
255+ "rev": "535d6e434be08edbb143bf93708ac5296e077ebb",
256+ "type": "github"
257+ },
258+ "original": {
259+ "owner": "kixelated",
260+ "ref": "moq-ffi-v0.3.17",
261+ "repo": "moq",
262+ "type": "github"
263+ }
264+ },
248265 "nix-appimage": {
249266 "inputs": {
250267 "flake-compat": "flake-compat",
@@ -312,6 +329,7 @@
312329 "jolt-native": "jolt-native",
313330 "jolt-native-android": "jolt-native-android",
314331 "jolt-src": "jolt-src",
332+ "moq-src": "moq-src",
315333 "nix-appimage": "nix-appimage",
316334 "nixgl": "nixgl",
317335 "nixpkgs": "nixpkgs"
@@ -245,6 +245,23 @@
245 "type": "github"245 "type": "github"
246 }246 }
247 },247 },
248+ "moq-src": {
249+ "flake": false,
250+ "locked": {
251+ "lastModified": 1788920358,
252+ "narHash": "sha256-vgZ0qWPkz8YdlqZoQQC45txXEFUO1xKNj+rv++tgMWo=",
253+ "owner": "kixelated",
254+ "repo": "moq",
255+ "rev": "535d6e434be08edbb143bf93708ac5296e077ebb",
256+ "type": "github"
257+ },
258+ "original": {
259+ "owner": "kixelated",
260+ "ref": "moq-ffi-v0.3.17",
261+ "repo": "moq",
262+ "type": "github"
263+ }
264+ },
248 "nix-appimage": {265 "nix-appimage": {
249 "inputs": {266 "inputs": {
250 "flake-compat": "flake-compat",267 "flake-compat": "flake-compat",
@@ -312,6 +329,7 @@
312 "jolt-native": "jolt-native",329 "jolt-native": "jolt-native",
313 "jolt-native-android": "jolt-native-android",330 "jolt-native-android": "jolt-native-android",
314 "jolt-src": "jolt-src",331 "jolt-src": "jolt-src",
332+ "moq-src": "moq-src",
315 "nix-appimage": "nix-appimage",333 "nix-appimage": "nix-appimage",
316 "nixgl": "nixgl",334 "nixgl": "nixgl",
317 "nixpkgs": "nixpkgs"335 "nixpkgs": "nixpkgs"
modified flake.nix +65 -51
@@ -60,6 +60,25 @@
6060 inputs.nixpkgs.follows = "nixpkgs";
6161 };
6262
63+ # moq-ffi's source, for the object frq.moq.* binds.
64+ #
65+ # Built here rather than taken from the release, and the reason is a
66+ # feature flag: `audio` and `video` are moq-ffi's defaults and are OFF in
67+ # the Linux and Android artifacts upstream publishes. Those two carry the
68+ # codecs — Opus through moq-audio, H.264 through moq-video's vendored
69+ # openh264 — so the published object can move a frame but cannot make one.
70+ # A call needs an encoder, so the choice is to build this once or to bind
71+ # libopus and openh264 separately and reimplement what moq-video already
72+ # does. Once, here.
73+ #
74+ # It is not free: this is the 440-crate build that fetching avoided, which
75+ # makes a substituter matter more now rather than less. What it is not is
76+ # a per-build cost — the pin below moves when someone moves it.
77+ moq-src = {
78+ url = "github:kixelated/moq/moq-ffi-v0.3.17";
79+ flake = false;
80+ };
81+
6382 # The Android objects, prebuilt by jolt-native's CI rather than compiled
6483 # here: an APK needs libvidya and libjoltmoq for arm64, and building them
6584 # locally means an NDK, a Rust cross toolchain and the whole crane graph
@@ -117,7 +136,7 @@
117136 };
118137 };
119138
120- outputs = { self, nixpkgs, jolt-src, jolt-native, jolt-native-android, glimmer, chez-src, jolt-android-src, nixgl, nix-appimage }:
139+ outputs = { self, nixpkgs, jolt-src, jolt-native, jolt-native-android, moq-src, glimmer, chez-src, jolt-android-src, nixgl, nix-appimage }:
121140 let
122141 systems = [ "x86_64-linux" "aarch64-linux" ];
123142 forEachSystem = f:
@@ -182,58 +201,53 @@
182201 # PipeWire's rather than raw ALSA PCMs.
183202 native = jolt-native.packages.${pkgs.stdenv.hostPlatform.system}.default;
184203
185- # libmoq_ffi — MoQ over QUIC behind UniFFI's C ABI, FETCHED rather
186- # than built. This is the object `frq.moq.raw` is generated from.
187- #
188- # Fetched because building it is the thing this whole exercise is
189- # about: moq-ffi pulls moq-native, iroh, quinn, rustls and aws-lc-sys
190- # behind it, which is 440 crates that nothing else in this tree
191- # needs. Upstream already publishes the object for both Linux
192- # architectures, so we take those bytes.
204+ # libmoq_ffi — MoQ over QUIC behind UniFFI's C ABI, with the codecs
205+ # in it. This is the object `frq.moq.raw` is generated from.
193206 #
194- # Pinned to a release and to a hash, and the hashes below are
195- # upstream's own published .sha256 files rather than ones observed
196- # here — a `nix-prefetch` of whatever the URL serves today would
197- # record that it downloaded something, not that it downloaded the
198- # right thing.
207+ # Default features, which is the entire reason this is a build and
208+ # not a fetchurl: `audio` and `video` are on by default upstream and
209+ # off in every Linux and Android artifact the release publishes, and
210+ # they are what carry Opus and H.264. 230 entry points here against
211+ # the release object's 206 — see the moq-src input.
199212 #
200- # WHAT THIS BUILD IS NOT: moq-ffi's `audio` and `video` features are
201- # on by default upstream and are OFF in these artifacts, so there is
202- # no publish_audio/publish_video and no moqaudio*/moqvideo* here —
203- # 206 functions where the Apple artifact has 230. That is why the
204- # bindings are generated from the object (`just gen-moq`) and not
205- # from the C header the release ships, which describes the Apple one.
206- moqFfi =
207- let
208- version = "0.3.17";
209- target = {
210- "x86_64-linux" = "x86_64-unknown-linux-gnu";
211- "aarch64-linux" = "aarch64-unknown-linux-gnu";
212- }.${pkgs.stdenv.hostPlatform.system};
213- hash = {
214- "x86_64-linux" = "sha256-dzQXpV4JgdtD+g33WX51FFAQdfCUXkNsx1xPbobPfUI=";
215- "aarch64-linux" = "sha256-PdzRwbJFqOZWRgI0HHX2XUH+Ljh4V3jvQ9asfvCuIPA=";
216- }.${pkgs.stdenv.hostPlatform.system};
217- in
218- pkgs.stdenv.mkDerivation {
219- pname = "libmoq-ffi";
220- inherit version;
221- src = pkgs.fetchurl {
222- url = "https://github.com/kixelated/moq/releases/download/moq-ffi-v${version}/moq-ffi-${version}-${target}-libmoq_ffi.so";
223- inherit hash;
224- };
225- dontUnpack = true;
226- # It carries no RUNPATH and needs libgcc_s, libm and libc — the
227- # host's on an ordinary distro, and nothing at all on NixOS
228- # unless they are bound here.
229- nativeBuildInputs = [ pkgs.autoPatchelfHook ];
230- buildInputs = [ pkgs.stdenv.cc.cc.lib ];
231- installPhase = ''
232- mkdir -p $out/lib
233- cp $src $out/lib/libmoq_ffi.so
234- chmod +w $out/lib/libmoq_ffi.so
235- '';
236- };
213+ # No cargoHash and no outputHashes: the workspace has no git
214+ # dependencies, so its own Cargo.lock is the whole of the pin.
215+ moqFfi = pkgs.rustPlatform.buildRustPackage {
216+ pname = "libmoq-ffi";
217+ version = "0.3.17";
218+ src = moq-src;
219+ cargoLock.lockFile = "${moq-src}/Cargo.lock";
220+
221+ # One crate out of a workspace of thirty. Default features are
222+ # deliberate — see above — so there is no --no-default-features
223+ # here and there should not be.
224+ cargoBuildFlags = [ "-p" "moq-ffi" ];
225+
226+ # The workspace's tests want a network and a relay.
227+ doCheck = false;
228+
229+ # bindgenHook is not optional: moq-video reaches VAAPI through
230+ # libva-sys, whose build script runs bindgen, which needs
231+ # LIBCLANG_PATH set. Without it the build fails deep inside a
232+ # build script with "Unable to find libclang".
233+ nativeBuildInputs = with pkgs; [
234+ cmake nasm pkg-config perl rustPlatform.bindgenHook
235+ ];
236+
237+ # libva and libdrm are here for their HEADERS. VAAPI itself is
238+ # dlopened at runtime, so the object carries no DT_NEEDED for it
239+ # and a machine with no VAAPI driver still loads this — openh264
240+ # is the fallback, and it is vendored and static.
241+ buildInputs = with pkgs; [ openssl libva libdrm ];
242+
243+ installPhase = ''
244+ runHook preInstall
245+ mkdir -p $out/lib
246+ find target -name 'libmoq_ffi.so' -print -exec cp {} $out/lib/ \;
247+ test -f $out/lib/libmoq_ffi.so
248+ runHook postInstall
249+ '';
250+ };
237251
238252 # One directory for the loader to look in. jolt resolves every
239253 # :jolt/native name against JOLT_NATIVE_LIB, and the objects now come
@@ -60,6 +60,25 @@
60 inputs.nixpkgs.follows = "nixpkgs";60 inputs.nixpkgs.follows = "nixpkgs";
61 };61 };
62 62
63+ # moq-ffi's source, for the object frq.moq.* binds.
64+ #
65+ # Built here rather than taken from the release, and the reason is a
66+ # feature flag: `audio` and `video` are moq-ffi's defaults and are OFF in
67+ # the Linux and Android artifacts upstream publishes. Those two carry the
68+ # codecs — Opus through moq-audio, H.264 through moq-video's vendored
69+ # openh264 — so the published object can move a frame but cannot make one.
70+ # A call needs an encoder, so the choice is to build this once or to bind
71+ # libopus and openh264 separately and reimplement what moq-video already
72+ # does. Once, here.
73+ #
74+ # It is not free: this is the 440-crate build that fetching avoided, which
75+ # makes a substituter matter more now rather than less. What it is not is
76+ # a per-build cost — the pin below moves when someone moves it.
77+ moq-src = {
78+ url = "github:kixelated/moq/moq-ffi-v0.3.17";
79+ flake = false;
80+ };
81+
63 # The Android objects, prebuilt by jolt-native's CI rather than compiled82 # The Android objects, prebuilt by jolt-native's CI rather than compiled
64 # here: an APK needs libvidya and libjoltmoq for arm64, and building them83 # here: an APK needs libvidya and libjoltmoq for arm64, and building them
65 # locally means an NDK, a Rust cross toolchain and the whole crane graph84 # locally means an NDK, a Rust cross toolchain and the whole crane graph
@@ -117,7 +136,7 @@
117 };136 };
118 };137 };
119 138
120- outputs = { self, nixpkgs, jolt-src, jolt-native, jolt-native-android, glimmer, chez-src, jolt-android-src, nixgl, nix-appimage }:139+ outputs = { self, nixpkgs, jolt-src, jolt-native, jolt-native-android, moq-src, glimmer, chez-src, jolt-android-src, nixgl, nix-appimage }:
121 let140 let
122 systems = [ "x86_64-linux" "aarch64-linux" ];141 systems = [ "x86_64-linux" "aarch64-linux" ];
123 forEachSystem = f:142 forEachSystem = f:
@@ -182,58 +201,53 @@
182 # PipeWire's rather than raw ALSA PCMs.201 # PipeWire's rather than raw ALSA PCMs.
183 native = jolt-native.packages.${pkgs.stdenv.hostPlatform.system}.default;202 native = jolt-native.packages.${pkgs.stdenv.hostPlatform.system}.default;
184 203
185- # libmoq_ffi — MoQ over QUIC behind UniFFI's C ABI, FETCHED rather204+ # libmoq_ffi — MoQ over QUIC behind UniFFI's C ABI, with the codecs
186- # than built. This is the object `frq.moq.raw` is generated from.205+ # in it. This is the object `frq.moq.raw` is generated from.
187- #
188- # Fetched because building it is the thing this whole exercise is
189- # about: moq-ffi pulls moq-native, iroh, quinn, rustls and aws-lc-sys
190- # behind it, which is 440 crates that nothing else in this tree
191- # needs. Upstream already publishes the object for both Linux
192- # architectures, so we take those bytes.
193 #206 #
194- # Pinned to a release and to a hash, and the hashes below are207+ # Default features, which is the entire reason this is a build and
195- # upstream's own published .sha256 files rather than ones observed208+ # not a fetchurl: `audio` and `video` are on by default upstream and
196- # here — a `nix-prefetch` of whatever the URL serves today would209+ # off in every Linux and Android artifact the release publishes, and
197- # record that it downloaded something, not that it downloaded the210+ # they are what carry Opus and H.264. 230 entry points here against
198- # right thing.211+ # the release object's 206 — see the moq-src input.
199 #212 #
200- # WHAT THIS BUILD IS NOT: moq-ffi's `audio` and `video` features are213+ # No cargoHash and no outputHashes: the workspace has no git
201- # on by default upstream and are OFF in these artifacts, so there is214+ # dependencies, so its own Cargo.lock is the whole of the pin.
202- # no publish_audio/publish_video and no moqaudio*/moqvideo* here —215+ moqFfi = pkgs.rustPlatform.buildRustPackage {
203- # 206 functions where the Apple artifact has 230. That is why the216+ pname = "libmoq-ffi";
204- # bindings are generated from the object (`just gen-moq`) and not217+ version = "0.3.17";
205- # from the C header the release ships, which describes the Apple one.218+ src = moq-src;
206- moqFfi =219+ cargoLock.lockFile = "${moq-src}/Cargo.lock";
207- let220+
208- version = "0.3.17";221+ # One crate out of a workspace of thirty. Default features are
209- target = {222+ # deliberate — see above — so there is no --no-default-features
210- "x86_64-linux" = "x86_64-unknown-linux-gnu";223+ # here and there should not be.
211- "aarch64-linux" = "aarch64-unknown-linux-gnu";224+ cargoBuildFlags = [ "-p" "moq-ffi" ];
212- }.${pkgs.stdenv.hostPlatform.system};225+
213- hash = {226+ # The workspace's tests want a network and a relay.
214- "x86_64-linux" = "sha256-dzQXpV4JgdtD+g33WX51FFAQdfCUXkNsx1xPbobPfUI=";227+ doCheck = false;
215- "aarch64-linux" = "sha256-PdzRwbJFqOZWRgI0HHX2XUH+Ljh4V3jvQ9asfvCuIPA=";228+
216- }.${pkgs.stdenv.hostPlatform.system};229+ # bindgenHook is not optional: moq-video reaches VAAPI through
217- in230+ # libva-sys, whose build script runs bindgen, which needs
218- pkgs.stdenv.mkDerivation {231+ # LIBCLANG_PATH set. Without it the build fails deep inside a
219- pname = "libmoq-ffi";232+ # build script with "Unable to find libclang".
220- inherit version;233+ nativeBuildInputs = with pkgs; [
221- src = pkgs.fetchurl {234+ cmake nasm pkg-config perl rustPlatform.bindgenHook
222- url = "https://github.com/kixelated/moq/releases/download/moq-ffi-v${version}/moq-ffi-${version}-${target}-libmoq_ffi.so";235+ ];
223- inherit hash;236+
224- };237+ # libva and libdrm are here for their HEADERS. VAAPI itself is
225- dontUnpack = true;238+ # dlopened at runtime, so the object carries no DT_NEEDED for it
226- # It carries no RUNPATH and needs libgcc_s, libm and libc — the239+ # and a machine with no VAAPI driver still loads this — openh264
227- # host's on an ordinary distro, and nothing at all on NixOS240+ # is the fallback, and it is vendored and static.
228- # unless they are bound here.241+ buildInputs = with pkgs; [ openssl libva libdrm ];
229- nativeBuildInputs = [ pkgs.autoPatchelfHook ];242+
230- buildInputs = [ pkgs.stdenv.cc.cc.lib ];243+ installPhase = ''
231- installPhase = ''244+ runHook preInstall
232- mkdir -p $out/lib245+ mkdir -p $out/lib
233- cp $src $out/lib/libmoq_ffi.so246+ find target -name 'libmoq_ffi.so' -print -exec cp {} $out/lib/ \;
234- chmod +w $out/lib/libmoq_ffi.so247+ test -f $out/lib/libmoq_ffi.so
235- '';248+ runHook postInstall
236- };249+ '';
250+ };
237 251
238 # One directory for the loader to look in. jolt resolves every252 # One directory for the loader to look in. jolt resolves every
239 # :jolt/native name against JOLT_NATIVE_LIB, and the objects now come253 # :jolt/native name against JOLT_NATIVE_LIB, and the objects now come
modified justfile +5 -4
@@ -214,10 +214,11 @@ repl *args:
214214 #
215215 # UniFFI embeds its interface metadata in the object, so `uniffi-bindgen
216216 # --library` reads the truth out of the .so rather than a header shipped
217-# beside it — which for this release is a different build entirely (the Apple
218-# artifact has moq-ffi's `audio` and `video` features, Linux and Android do
219-# not). Binding the header would link on a Mac and fail on both platforms frq
220-# ships to, so the object is the only source this recipe will accept.
217+# beside it. For this release those differ three ways at one version number:
218+# the published Linux/Android objects are built without moq-ffi's `audio` and
219+# `video` features (206 functions, no codecs), the shipped C header describes
220+# the Apple build (230), and what our flake builds has the codecs in (230).
221+# The object is the only source this recipe will accept.
221222 #
222223 # The bindgen must match the uniffi that built the object — 0.32 for moq-ffi
223224 # 0.3.17 — and it is built once into the scratch dir rather than pinned into
@@ -214,10 +214,11 @@ repl *args:
214 #214 #
215 # UniFFI embeds its interface metadata in the object, so `uniffi-bindgen215 # UniFFI embeds its interface metadata in the object, so `uniffi-bindgen
216 # --library` reads the truth out of the .so rather than a header shipped216 # --library` reads the truth out of the .so rather than a header shipped
217-# beside it — which for this release is a different build entirely (the Apple217+# beside it. For this release those differ three ways at one version number:
218-# artifact has moq-ffi's `audio` and `video` features, Linux and Android do218+# the published Linux/Android objects are built without moq-ffi's `audio` and
219-# not). Binding the header would link on a Mac and fail on both platforms frq219+# `video` features (206 functions, no codecs), the shipped C header describes
220-# ships to, so the object is the only source this recipe will accept.220+# the Apple build (230), and what our flake builds has the codecs in (230).
221+# The object is the only source this recipe will accept.
221 #222 #
222 # The bindgen must match the uniffi that built the object — 0.32 for moq-ffi223 # The bindgen must match the uniffi that built the object — 0.32 for moq-ffi
223 # 0.3.17 — and it is built once into the scratch dir rather than pinned into224 # 0.3.17 — and it is built once into the scratch dir rather than pinned into
modified src/frq/moq/raw.clj +89 -10
@@ -5,15 +5,22 @@
55
66 These are not transcribed from a header. UniFFI embeds its interface
77 metadata in the object itself, and `uniffi-bindgen --library` reads it back
8- out, so what is declared here is what the .so we ship actually exports
9- which matters more than it sounds. The release's Apple artifact and its
10- Linux/Android ones are *different builds*: moq-ffi's `audio` and `video`
11- features are on by default and were switched off for Linux and Android, so
12- the shipped C header describes 230 entry points where the object we load has
13- 403 symbols covering 206 functions, with `publish_audio`, `publish_video`
14- and the whole `moqaudio*`/`moqvideo*` surface absent. Binding the header
15- would have produced calls that link on a Mac and fail on the two platforms
16- frq targets.
8+ out, so what is declared here is what the .so we load actually exports.
9+
10+ That distinction is not academic. moq-ffi has `audio` and `video` features,
11+ on by default, that carry Opus and H.264 and every Linux and Android
12+ artifact its release publishes is built WITHOUT them. The C header shipped
13+ beside those artifacts describes the Apple build, which has them. Three
14+ different surfaces, one version number:
15+
16+ the published Linux/Android .so 206 functions, no codecs
17+ the published C header (Apple) 230 functions
18+ what the flake builds 230 functions, codecs in
19+
20+ Binding the header would have linked on a Mac and failed on both platforms
21+ frq ships to; binding the published Linux object would have compiled and
22+ then had nowhere to encode a frame. Generating from the object the flake
23+ builds is what keeps those three from drifting apart silently.
1724
1825 Nothing here is hand-written and nothing is inferred. The generator maps a
1926 ctype it does not recognise to nothing at all and reports it, rather than
@@ -31,9 +38,39 @@
3138 async function has no status and answers a future handle instead poll it
3239 through `frq.moq.uniffi/start-future`.
3340
34- Generated from moq-ffi 0.3.17, UniFFI contract 30."
41+ Generated from moq-ffi 0.3.17 built with default features, UniFFI contract 30."
3542 (:require [jolt.ffi :as ffi]))
3643
44+;; MoqError, as UniFFI numbers it in THIS object. Generated with the
45+;; entry points above, and for the same reason: the variants are
46+;; inserted into rather than appended to, so a table written by hand
47+;; against one build names the wrong error in the next.
48+(def moq-error-variants
49+ {1 :protocol
50+ 2 :media
51+ 3 :mux
52+ 4 :json-track
53+ 5 :audio
54+ 6 :video
55+ 7 :url
56+ 8 :time-overflow
57+ 9 :log-level
58+ 10 :task
59+ 11 :json
60+ 12 :cancelled
61+ 13 :closed
62+ 14 :connect
63+ 15 :bind
64+ 16 :reject
65+ 17 :already-responded
66+ 18 :codec
67+ 19 :unauthorized
68+ 20 :forbidden
69+ 21 :not-found
70+ 22 :unsupported
71+ 23 :invalid-route
72+ 24 :log})
73+
3774 (ffi/defcfn rust-future-cancel-f32 "ffi_moq_ffi_rust_future_cancel_f32" [:uint64] :void)
3875 (ffi/defcfn rust-future-cancel-f64 "ffi_moq_ffi_rust_future_cancel_f64" [:uint64] :void)
3976 (ffi/defcfn rust-future-cancel-i16 "ffi_moq_ffi_rust_future_cancel_i16" [:uint64] :void)
@@ -98,10 +135,19 @@
98135 (ffi/defcfn checksum-method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_checksum_method_moqannouncedbroadcast_cancel" [] :uint16)
99136 (ffi/defcfn checksum-method-moqannouncement-broadcast "uniffi_moq_ffi_checksum_method_moqannouncement_broadcast" [] :uint16)
100137 (ffi/defcfn checksum-method-moqannouncement-path "uniffi_moq_ffi_checksum_method_moqannouncement_path" [] :uint16)
138+(ffi/defcfn checksum-method-moqaudioconsumer-cancel "uniffi_moq_ffi_checksum_method_moqaudioconsumer_cancel" [] :uint16)
139+(ffi/defcfn checksum-method-moqaudioconsumer-next "uniffi_moq_ffi_checksum_method_moqaudioconsumer_next" [] :uint16)
140+(ffi/defcfn checksum-method-moqaudioproducer-finish "uniffi_moq_ffi_checksum_method_moqaudioproducer_finish" [] :uint16)
141+(ffi/defcfn checksum-method-moqaudioproducer-name "uniffi_moq_ffi_checksum_method_moqaudioproducer_name" [] :uint16)
142+(ffi/defcfn checksum-method-moqaudioproducer-reset-epoch "uniffi_moq_ffi_checksum_method_moqaudioproducer_reset_epoch" [] :uint16)
143+(ffi/defcfn checksum-method-moqaudioproducer-unused "uniffi_moq_ffi_checksum_method_moqaudioproducer_unused" [] :uint16)
144+(ffi/defcfn checksum-method-moqaudioproducer-used "uniffi_moq_ffi_checksum_method_moqaudioproducer_used" [] :uint16)
145+(ffi/defcfn checksum-method-moqaudioproducer-write "uniffi_moq_ffi_checksum_method_moqaudioproducer_write" [] :uint16)
101146 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_group" [] :uint16)
102147 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_media_group" [] :uint16)
103148 (ffi/defcfn checksum-method-moqbroadcastconsumer-route "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route" [] :uint16)
104149 (ffi/defcfn checksum-method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route_updates" [] :uint16)
150+(ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-audio "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_audio" [] :uint16)
105151 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_catalog" [] :uint16)
106152 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_snapshot" [] :uint16)
107153 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_stream" [] :uint16)
@@ -112,12 +158,14 @@
112158 (ffi/defcfn checksum-method-moqbroadcastproducer-consume "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_consume" [] :uint16)
113159 (ffi/defcfn checksum-method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_dynamic" [] :uint16)
114160 (ffi/defcfn checksum-method-moqbroadcastproducer-finish "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_finish" [] :uint16)
161+(ffi/defcfn checksum-method-moqbroadcastproducer-publish-audio "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_audio" [] :uint16)
115162 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_snapshot" [] :uint16)
116163 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_stream" [] :uint16)
117164 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media" [] :uint16)
118165 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_on_track" [] :uint16)
119166 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_stream" [] :uint16)
120167 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_track" [] :uint16)
168+(ffi/defcfn checksum-method-moqbroadcastproducer-publish-video "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_video" [] :uint16)
121169 (ffi/defcfn checksum-method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_remove_catalog_section" [] :uint16)
122170 (ffi/defcfn checksum-method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_announce" [] :uint16)
123171 (ffi/defcfn checksum-method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_catalog_section" [] :uint16)
@@ -231,9 +279,18 @@
231279 (ffi/defcfn checksum-method-moqtrackrequest-accept "uniffi_moq_ffi_checksum_method_moqtrackrequest_accept" [] :uint16)
232280 (ffi/defcfn checksum-method-moqtrackrequest-dynamic "uniffi_moq_ffi_checksum_method_moqtrackrequest_dynamic" [] :uint16)
233281 (ffi/defcfn checksum-method-moqtrackrequest-name "uniffi_moq_ffi_checksum_method_moqtrackrequest_name" [] :uint16)
282+(ffi/defcfn checksum-method-moqvideoproducer-cut "uniffi_moq_ffi_checksum_method_moqvideoproducer_cut" [] :uint16)
283+(ffi/defcfn checksum-method-moqvideoproducer-finish "uniffi_moq_ffi_checksum_method_moqvideoproducer_finish" [] :uint16)
284+(ffi/defcfn checksum-method-moqvideoproducer-name "uniffi_moq_ffi_checksum_method_moqvideoproducer_name" [] :uint16)
285+(ffi/defcfn checksum-method-moqvideoproducer-set-bitrate "uniffi_moq_ffi_checksum_method_moqvideoproducer_set_bitrate" [] :uint16)
286+(ffi/defcfn checksum-method-moqvideoproducer-unused "uniffi_moq_ffi_checksum_method_moqvideoproducer_unused" [] :uint16)
287+(ffi/defcfn checksum-method-moqvideoproducer-used "uniffi_moq_ffi_checksum_method_moqvideoproducer_used" [] :uint16)
288+(ffi/defcfn checksum-method-moqvideoproducer-write "uniffi_moq_ffi_checksum_method_moqvideoproducer_write" [] :uint16)
234289 (ffi/defcfn clone-moqannounced "uniffi_moq_ffi_fn_clone_moqannounced" [:uint64 :pointer] :uint64)
235290 (ffi/defcfn clone-moqannouncedbroadcast "uniffi_moq_ffi_fn_clone_moqannouncedbroadcast" [:uint64 :pointer] :uint64)
236291 (ffi/defcfn clone-moqannouncement "uniffi_moq_ffi_fn_clone_moqannouncement" [:uint64 :pointer] :uint64)
292+(ffi/defcfn clone-moqaudioconsumer "uniffi_moq_ffi_fn_clone_moqaudioconsumer" [:uint64 :pointer] :uint64)
293+(ffi/defcfn clone-moqaudioproducer "uniffi_moq_ffi_fn_clone_moqaudioproducer" [:uint64 :pointer] :uint64)
237294 (ffi/defcfn clone-moqbroadcastconsumer "uniffi_moq_ffi_fn_clone_moqbroadcastconsumer" [:uint64 :pointer] :uint64)
238295 (ffi/defcfn clone-moqbroadcastdynamic "uniffi_moq_ffi_fn_clone_moqbroadcastdynamic" [:uint64 :pointer] :uint64)
239296 (ffi/defcfn clone-moqbroadcastproducer "uniffi_moq_ffi_fn_clone_moqbroadcastproducer" [:uint64 :pointer] :uint64)
@@ -262,6 +319,7 @@
262319 (ffi/defcfn clone-moqtrackdynamic "uniffi_moq_ffi_fn_clone_moqtrackdynamic" [:uint64 :pointer] :uint64)
263320 (ffi/defcfn clone-moqtrackproducer "uniffi_moq_ffi_fn_clone_moqtrackproducer" [:uint64 :pointer] :uint64)
264321 (ffi/defcfn clone-moqtrackrequest "uniffi_moq_ffi_fn_clone_moqtrackrequest" [:uint64 :pointer] :uint64)
322+(ffi/defcfn clone-moqvideoproducer "uniffi_moq_ffi_fn_clone_moqvideoproducer" [:uint64 :pointer] :uint64)
265323 (ffi/defcfn constructor-moqbroadcastproducer-new "uniffi_moq_ffi_fn_constructor_moqbroadcastproducer_new" [:pointer] :uint64)
266324 (ffi/defcfn constructor-moqclient-new "uniffi_moq_ffi_fn_constructor_moqclient_new" [:pointer] :uint64)
267325 (ffi/defcfn constructor-moqoriginproducer-new "uniffi_moq_ffi_fn_constructor_moqoriginproducer_new" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
@@ -269,6 +327,8 @@
269327 (ffi/defcfn free-moqannounced "uniffi_moq_ffi_fn_free_moqannounced" [:uint64 :pointer] :void)
270328 (ffi/defcfn free-moqannouncedbroadcast "uniffi_moq_ffi_fn_free_moqannouncedbroadcast" [:uint64 :pointer] :void)
271329 (ffi/defcfn free-moqannouncement "uniffi_moq_ffi_fn_free_moqannouncement" [:uint64 :pointer] :void)
330+(ffi/defcfn free-moqaudioconsumer "uniffi_moq_ffi_fn_free_moqaudioconsumer" [:uint64 :pointer] :void)
331+(ffi/defcfn free-moqaudioproducer "uniffi_moq_ffi_fn_free_moqaudioproducer" [:uint64 :pointer] :void)
272332 (ffi/defcfn free-moqbroadcastconsumer "uniffi_moq_ffi_fn_free_moqbroadcastconsumer" [:uint64 :pointer] :void)
273333 (ffi/defcfn free-moqbroadcastdynamic "uniffi_moq_ffi_fn_free_moqbroadcastdynamic" [:uint64 :pointer] :void)
274334 (ffi/defcfn free-moqbroadcastproducer "uniffi_moq_ffi_fn_free_moqbroadcastproducer" [:uint64 :pointer] :void)
@@ -297,6 +357,7 @@
297357 (ffi/defcfn free-moqtrackdynamic "uniffi_moq_ffi_fn_free_moqtrackdynamic" [:uint64 :pointer] :void)
298358 (ffi/defcfn free-moqtrackproducer "uniffi_moq_ffi_fn_free_moqtrackproducer" [:uint64 :pointer] :void)
299359 (ffi/defcfn free-moqtrackrequest "uniffi_moq_ffi_fn_free_moqtrackrequest" [:uint64 :pointer] :void)
360+(ffi/defcfn free-moqvideoproducer "uniffi_moq_ffi_fn_free_moqvideoproducer" [:uint64 :pointer] :void)
300361 (ffi/defcfn func-moq-log-level "uniffi_moq_ffi_fn_func_moq_log_level" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
301362 (ffi/defcfn method-moqannounced-cancel "uniffi_moq_ffi_fn_method_moqannounced_cancel" [:uint64 :pointer] :void)
302363 (ffi/defcfn method-moqannounced-next "uniffi_moq_ffi_fn_method_moqannounced_next" [:uint64] :uint64)
@@ -304,10 +365,19 @@
304365 (ffi/defcfn method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_fn_method_moqannouncedbroadcast_cancel" [:uint64 :pointer] :void)
305366 (ffi/defcfn method-moqannouncement-broadcast "uniffi_moq_ffi_fn_method_moqannouncement_broadcast" [:uint64 :pointer] :uint64)
306367 (ffi/defcfn method-moqannouncement-path "uniffi_moq_ffi_fn_method_moqannouncement_path" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
368+(ffi/defcfn method-moqaudioconsumer-cancel "uniffi_moq_ffi_fn_method_moqaudioconsumer_cancel" [:uint64 :pointer] :void)
369+(ffi/defcfn method-moqaudioconsumer-next "uniffi_moq_ffi_fn_method_moqaudioconsumer_next" [:uint64] :uint64)
370+(ffi/defcfn method-moqaudioproducer-finish "uniffi_moq_ffi_fn_method_moqaudioproducer_finish" [:uint64 :pointer] :void)
371+(ffi/defcfn method-moqaudioproducer-name "uniffi_moq_ffi_fn_method_moqaudioproducer_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
372+(ffi/defcfn method-moqaudioproducer-reset-epoch "uniffi_moq_ffi_fn_method_moqaudioproducer_reset_epoch" [:uint64 :pointer] :void)
373+(ffi/defcfn method-moqaudioproducer-unused "uniffi_moq_ffi_fn_method_moqaudioproducer_unused" [:uint64] :uint64)
374+(ffi/defcfn method-moqaudioproducer-used "uniffi_moq_ffi_fn_method_moqaudioproducer_used" [:uint64] :uint64)
375+(ffi/defcfn method-moqaudioproducer-write "uniffi_moq_ffi_fn_method_moqaudioproducer_write" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
307376 (ffi/defcfn method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
308377 (ffi/defcfn method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_media_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
309378 (ffi/defcfn method-moqbroadcastconsumer-route "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
310379 (ffi/defcfn method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route_updates" [:uint64 :pointer] :uint64)
380+(ffi/defcfn method-moqbroadcastconsumer-subscribe-audio "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_audio" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
311381 (ffi/defcfn method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_catalog" [:uint64] :uint64)
312382 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
313383 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
@@ -318,12 +388,14 @@
318388 (ffi/defcfn method-moqbroadcastproducer-consume "uniffi_moq_ffi_fn_method_moqbroadcastproducer_consume" [:uint64 :pointer] :uint64)
319389 (ffi/defcfn method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_fn_method_moqbroadcastproducer_dynamic" [:uint64 :pointer] :uint64)
320390 (ffi/defcfn method-moqbroadcastproducer-finish "uniffi_moq_ffi_fn_method_moqbroadcastproducer_finish" [:uint64 :pointer] :void)
391+(ffi/defcfn method-moqbroadcastproducer-publish-audio "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_audio" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
321392 (ffi/defcfn method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
322393 (ffi/defcfn method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
323394 (ffi/defcfn method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
324395 (ffi/defcfn method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_on_track" [:uint64 :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
325396 (ffi/defcfn method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
326397 (ffi/defcfn method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_track" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
398+(ffi/defcfn method-moqbroadcastproducer-publish-video "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_video" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
327399 (ffi/defcfn method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_remove_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
328400 (ffi/defcfn method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_announce" [:uint64 :int8 :pointer] :void)
329401 (ffi/defcfn method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
@@ -437,3 +509,10 @@
437509 (ffi/defcfn method-moqtrackrequest-accept "uniffi_moq_ffi_fn_method_moqtrackrequest_accept" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
438510 (ffi/defcfn method-moqtrackrequest-dynamic "uniffi_moq_ffi_fn_method_moqtrackrequest_dynamic" [:uint64 :pointer] :uint64)
439511 (ffi/defcfn method-moqtrackrequest-name "uniffi_moq_ffi_fn_method_moqtrackrequest_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
512+(ffi/defcfn method-moqvideoproducer-cut "uniffi_moq_ffi_fn_method_moqvideoproducer_cut" [:uint64 :pointer] :void)
513+(ffi/defcfn method-moqvideoproducer-finish "uniffi_moq_ffi_fn_method_moqvideoproducer_finish" [:uint64 :pointer] :void)
514+(ffi/defcfn method-moqvideoproducer-name "uniffi_moq_ffi_fn_method_moqvideoproducer_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
515+(ffi/defcfn method-moqvideoproducer-set-bitrate "uniffi_moq_ffi_fn_method_moqvideoproducer_set_bitrate" [:uint64 :uint64 :pointer] :void)
516+(ffi/defcfn method-moqvideoproducer-unused "uniffi_moq_ffi_fn_method_moqvideoproducer_unused" [:uint64] :uint64)
517+(ffi/defcfn method-moqvideoproducer-used "uniffi_moq_ffi_fn_method_moqvideoproducer_used" [:uint64] :uint64)
518+(ffi/defcfn method-moqvideoproducer-write "uniffi_moq_ffi_fn_method_moqvideoproducer_write" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
@@ -5,15 +5,22 @@
5 5
6 These are not transcribed from a header. UniFFI embeds its interface6 These are not transcribed from a header. UniFFI embeds its interface
7 metadata in the object itself, and `uniffi-bindgen --library` reads it back7 metadata in the object itself, and `uniffi-bindgen --library` reads it back
8- out, so what is declared here is what the .so we ship actually exports 8+ out, so what is declared here is what the .so we load actually exports.
9- which matters more than it sounds. The release's Apple artifact and its9+
10- Linux/Android ones are *different builds*: moq-ffi's `audio` and `video`10+ That distinction is not academic. moq-ffi has `audio` and `video` features,
11- features are on by default and were switched off for Linux and Android, so11+ on by default, that carry Opus and H.264 and every Linux and Android
12- the shipped C header describes 230 entry points where the object we load has12+ artifact its release publishes is built WITHOUT them. The C header shipped
13- 403 symbols covering 206 functions, with `publish_audio`, `publish_video`13+ beside those artifacts describes the Apple build, which has them. Three
14- and the whole `moqaudio*`/`moqvideo*` surface absent. Binding the header14+ different surfaces, one version number:
15- would have produced calls that link on a Mac and fail on the two platforms15+
16- frq targets.16+ the published Linux/Android .so 206 functions, no codecs
17+ the published C header (Apple) 230 functions
18+ what the flake builds 230 functions, codecs in
19+
20+ Binding the header would have linked on a Mac and failed on both platforms
21+ frq ships to; binding the published Linux object would have compiled and
22+ then had nowhere to encode a frame. Generating from the object the flake
23+ builds is what keeps those three from drifting apart silently.
17 24
18 Nothing here is hand-written and nothing is inferred. The generator maps a25 Nothing here is hand-written and nothing is inferred. The generator maps a
19 ctype it does not recognise to nothing at all and reports it, rather than26 ctype it does not recognise to nothing at all and reports it, rather than
@@ -31,9 +38,39 @@
31 async function has no status and answers a future handle instead poll it38 async function has no status and answers a future handle instead poll it
32 through `frq.moq.uniffi/start-future`.39 through `frq.moq.uniffi/start-future`.
33 40
34- Generated from moq-ffi 0.3.17, UniFFI contract 30."41+ Generated from moq-ffi 0.3.17 built with default features, UniFFI contract 30."
35 (:require [jolt.ffi :as ffi]))42 (:require [jolt.ffi :as ffi]))
36 43
44+;; MoqError, as UniFFI numbers it in THIS object. Generated with the
45+;; entry points above, and for the same reason: the variants are
46+;; inserted into rather than appended to, so a table written by hand
47+;; against one build names the wrong error in the next.
48+(def moq-error-variants
49+ {1 :protocol
50+ 2 :media
51+ 3 :mux
52+ 4 :json-track
53+ 5 :audio
54+ 6 :video
55+ 7 :url
56+ 8 :time-overflow
57+ 9 :log-level
58+ 10 :task
59+ 11 :json
60+ 12 :cancelled
61+ 13 :closed
62+ 14 :connect
63+ 15 :bind
64+ 16 :reject
65+ 17 :already-responded
66+ 18 :codec
67+ 19 :unauthorized
68+ 20 :forbidden
69+ 21 :not-found
70+ 22 :unsupported
71+ 23 :invalid-route
72+ 24 :log})
73+
37 (ffi/defcfn rust-future-cancel-f32 "ffi_moq_ffi_rust_future_cancel_f32" [:uint64] :void)74 (ffi/defcfn rust-future-cancel-f32 "ffi_moq_ffi_rust_future_cancel_f32" [:uint64] :void)
38 (ffi/defcfn rust-future-cancel-f64 "ffi_moq_ffi_rust_future_cancel_f64" [:uint64] :void)75 (ffi/defcfn rust-future-cancel-f64 "ffi_moq_ffi_rust_future_cancel_f64" [:uint64] :void)
39 (ffi/defcfn rust-future-cancel-i16 "ffi_moq_ffi_rust_future_cancel_i16" [:uint64] :void)76 (ffi/defcfn rust-future-cancel-i16 "ffi_moq_ffi_rust_future_cancel_i16" [:uint64] :void)
@@ -98,10 +135,19 @@
98 (ffi/defcfn checksum-method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_checksum_method_moqannouncedbroadcast_cancel" [] :uint16)135 (ffi/defcfn checksum-method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_checksum_method_moqannouncedbroadcast_cancel" [] :uint16)
99 (ffi/defcfn checksum-method-moqannouncement-broadcast "uniffi_moq_ffi_checksum_method_moqannouncement_broadcast" [] :uint16)136 (ffi/defcfn checksum-method-moqannouncement-broadcast "uniffi_moq_ffi_checksum_method_moqannouncement_broadcast" [] :uint16)
100 (ffi/defcfn checksum-method-moqannouncement-path "uniffi_moq_ffi_checksum_method_moqannouncement_path" [] :uint16)137 (ffi/defcfn checksum-method-moqannouncement-path "uniffi_moq_ffi_checksum_method_moqannouncement_path" [] :uint16)
138+(ffi/defcfn checksum-method-moqaudioconsumer-cancel "uniffi_moq_ffi_checksum_method_moqaudioconsumer_cancel" [] :uint16)
139+(ffi/defcfn checksum-method-moqaudioconsumer-next "uniffi_moq_ffi_checksum_method_moqaudioconsumer_next" [] :uint16)
140+(ffi/defcfn checksum-method-moqaudioproducer-finish "uniffi_moq_ffi_checksum_method_moqaudioproducer_finish" [] :uint16)
141+(ffi/defcfn checksum-method-moqaudioproducer-name "uniffi_moq_ffi_checksum_method_moqaudioproducer_name" [] :uint16)
142+(ffi/defcfn checksum-method-moqaudioproducer-reset-epoch "uniffi_moq_ffi_checksum_method_moqaudioproducer_reset_epoch" [] :uint16)
143+(ffi/defcfn checksum-method-moqaudioproducer-unused "uniffi_moq_ffi_checksum_method_moqaudioproducer_unused" [] :uint16)
144+(ffi/defcfn checksum-method-moqaudioproducer-used "uniffi_moq_ffi_checksum_method_moqaudioproducer_used" [] :uint16)
145+(ffi/defcfn checksum-method-moqaudioproducer-write "uniffi_moq_ffi_checksum_method_moqaudioproducer_write" [] :uint16)
101 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_group" [] :uint16)146 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_group" [] :uint16)
102 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_media_group" [] :uint16)147 (ffi/defcfn checksum-method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_fetch_media_group" [] :uint16)
103 (ffi/defcfn checksum-method-moqbroadcastconsumer-route "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route" [] :uint16)148 (ffi/defcfn checksum-method-moqbroadcastconsumer-route "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route" [] :uint16)
104 (ffi/defcfn checksum-method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route_updates" [] :uint16)149 (ffi/defcfn checksum-method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_route_updates" [] :uint16)
150+(ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-audio "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_audio" [] :uint16)
105 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_catalog" [] :uint16)151 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_catalog" [] :uint16)
106 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_snapshot" [] :uint16)152 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_snapshot" [] :uint16)
107 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_stream" [] :uint16)153 (ffi/defcfn checksum-method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastconsumer_subscribe_json_stream" [] :uint16)
@@ -112,12 +158,14 @@
112 (ffi/defcfn checksum-method-moqbroadcastproducer-consume "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_consume" [] :uint16)158 (ffi/defcfn checksum-method-moqbroadcastproducer-consume "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_consume" [] :uint16)
113 (ffi/defcfn checksum-method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_dynamic" [] :uint16)159 (ffi/defcfn checksum-method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_dynamic" [] :uint16)
114 (ffi/defcfn checksum-method-moqbroadcastproducer-finish "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_finish" [] :uint16)160 (ffi/defcfn checksum-method-moqbroadcastproducer-finish "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_finish" [] :uint16)
161+(ffi/defcfn checksum-method-moqbroadcastproducer-publish-audio "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_audio" [] :uint16)
115 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_snapshot" [] :uint16)162 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_snapshot" [] :uint16)
116 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_stream" [] :uint16)163 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_json_stream" [] :uint16)
117 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media" [] :uint16)164 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media" [] :uint16)
118 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_on_track" [] :uint16)165 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_on_track" [] :uint16)
119 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_stream" [] :uint16)166 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_media_stream" [] :uint16)
120 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_track" [] :uint16)167 (ffi/defcfn checksum-method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_track" [] :uint16)
168+(ffi/defcfn checksum-method-moqbroadcastproducer-publish-video "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_publish_video" [] :uint16)
121 (ffi/defcfn checksum-method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_remove_catalog_section" [] :uint16)169 (ffi/defcfn checksum-method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_remove_catalog_section" [] :uint16)
122 (ffi/defcfn checksum-method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_announce" [] :uint16)170 (ffi/defcfn checksum-method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_announce" [] :uint16)
123 (ffi/defcfn checksum-method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_catalog_section" [] :uint16)171 (ffi/defcfn checksum-method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_checksum_method_moqbroadcastproducer_set_catalog_section" [] :uint16)
@@ -231,9 +279,18 @@
231 (ffi/defcfn checksum-method-moqtrackrequest-accept "uniffi_moq_ffi_checksum_method_moqtrackrequest_accept" [] :uint16)279 (ffi/defcfn checksum-method-moqtrackrequest-accept "uniffi_moq_ffi_checksum_method_moqtrackrequest_accept" [] :uint16)
232 (ffi/defcfn checksum-method-moqtrackrequest-dynamic "uniffi_moq_ffi_checksum_method_moqtrackrequest_dynamic" [] :uint16)280 (ffi/defcfn checksum-method-moqtrackrequest-dynamic "uniffi_moq_ffi_checksum_method_moqtrackrequest_dynamic" [] :uint16)
233 (ffi/defcfn checksum-method-moqtrackrequest-name "uniffi_moq_ffi_checksum_method_moqtrackrequest_name" [] :uint16)281 (ffi/defcfn checksum-method-moqtrackrequest-name "uniffi_moq_ffi_checksum_method_moqtrackrequest_name" [] :uint16)
282+(ffi/defcfn checksum-method-moqvideoproducer-cut "uniffi_moq_ffi_checksum_method_moqvideoproducer_cut" [] :uint16)
283+(ffi/defcfn checksum-method-moqvideoproducer-finish "uniffi_moq_ffi_checksum_method_moqvideoproducer_finish" [] :uint16)
284+(ffi/defcfn checksum-method-moqvideoproducer-name "uniffi_moq_ffi_checksum_method_moqvideoproducer_name" [] :uint16)
285+(ffi/defcfn checksum-method-moqvideoproducer-set-bitrate "uniffi_moq_ffi_checksum_method_moqvideoproducer_set_bitrate" [] :uint16)
286+(ffi/defcfn checksum-method-moqvideoproducer-unused "uniffi_moq_ffi_checksum_method_moqvideoproducer_unused" [] :uint16)
287+(ffi/defcfn checksum-method-moqvideoproducer-used "uniffi_moq_ffi_checksum_method_moqvideoproducer_used" [] :uint16)
288+(ffi/defcfn checksum-method-moqvideoproducer-write "uniffi_moq_ffi_checksum_method_moqvideoproducer_write" [] :uint16)
234 (ffi/defcfn clone-moqannounced "uniffi_moq_ffi_fn_clone_moqannounced" [:uint64 :pointer] :uint64)289 (ffi/defcfn clone-moqannounced "uniffi_moq_ffi_fn_clone_moqannounced" [:uint64 :pointer] :uint64)
235 (ffi/defcfn clone-moqannouncedbroadcast "uniffi_moq_ffi_fn_clone_moqannouncedbroadcast" [:uint64 :pointer] :uint64)290 (ffi/defcfn clone-moqannouncedbroadcast "uniffi_moq_ffi_fn_clone_moqannouncedbroadcast" [:uint64 :pointer] :uint64)
236 (ffi/defcfn clone-moqannouncement "uniffi_moq_ffi_fn_clone_moqannouncement" [:uint64 :pointer] :uint64)291 (ffi/defcfn clone-moqannouncement "uniffi_moq_ffi_fn_clone_moqannouncement" [:uint64 :pointer] :uint64)
292+(ffi/defcfn clone-moqaudioconsumer "uniffi_moq_ffi_fn_clone_moqaudioconsumer" [:uint64 :pointer] :uint64)
293+(ffi/defcfn clone-moqaudioproducer "uniffi_moq_ffi_fn_clone_moqaudioproducer" [:uint64 :pointer] :uint64)
237 (ffi/defcfn clone-moqbroadcastconsumer "uniffi_moq_ffi_fn_clone_moqbroadcastconsumer" [:uint64 :pointer] :uint64)294 (ffi/defcfn clone-moqbroadcastconsumer "uniffi_moq_ffi_fn_clone_moqbroadcastconsumer" [:uint64 :pointer] :uint64)
238 (ffi/defcfn clone-moqbroadcastdynamic "uniffi_moq_ffi_fn_clone_moqbroadcastdynamic" [:uint64 :pointer] :uint64)295 (ffi/defcfn clone-moqbroadcastdynamic "uniffi_moq_ffi_fn_clone_moqbroadcastdynamic" [:uint64 :pointer] :uint64)
239 (ffi/defcfn clone-moqbroadcastproducer "uniffi_moq_ffi_fn_clone_moqbroadcastproducer" [:uint64 :pointer] :uint64)296 (ffi/defcfn clone-moqbroadcastproducer "uniffi_moq_ffi_fn_clone_moqbroadcastproducer" [:uint64 :pointer] :uint64)
@@ -262,6 +319,7 @@
262 (ffi/defcfn clone-moqtrackdynamic "uniffi_moq_ffi_fn_clone_moqtrackdynamic" [:uint64 :pointer] :uint64)319 (ffi/defcfn clone-moqtrackdynamic "uniffi_moq_ffi_fn_clone_moqtrackdynamic" [:uint64 :pointer] :uint64)
263 (ffi/defcfn clone-moqtrackproducer "uniffi_moq_ffi_fn_clone_moqtrackproducer" [:uint64 :pointer] :uint64)320 (ffi/defcfn clone-moqtrackproducer "uniffi_moq_ffi_fn_clone_moqtrackproducer" [:uint64 :pointer] :uint64)
264 (ffi/defcfn clone-moqtrackrequest "uniffi_moq_ffi_fn_clone_moqtrackrequest" [:uint64 :pointer] :uint64)321 (ffi/defcfn clone-moqtrackrequest "uniffi_moq_ffi_fn_clone_moqtrackrequest" [:uint64 :pointer] :uint64)
322+(ffi/defcfn clone-moqvideoproducer "uniffi_moq_ffi_fn_clone_moqvideoproducer" [:uint64 :pointer] :uint64)
265 (ffi/defcfn constructor-moqbroadcastproducer-new "uniffi_moq_ffi_fn_constructor_moqbroadcastproducer_new" [:pointer] :uint64)323 (ffi/defcfn constructor-moqbroadcastproducer-new "uniffi_moq_ffi_fn_constructor_moqbroadcastproducer_new" [:pointer] :uint64)
266 (ffi/defcfn constructor-moqclient-new "uniffi_moq_ffi_fn_constructor_moqclient_new" [:pointer] :uint64)324 (ffi/defcfn constructor-moqclient-new "uniffi_moq_ffi_fn_constructor_moqclient_new" [:pointer] :uint64)
267 (ffi/defcfn constructor-moqoriginproducer-new "uniffi_moq_ffi_fn_constructor_moqoriginproducer_new" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)325 (ffi/defcfn constructor-moqoriginproducer-new "uniffi_moq_ffi_fn_constructor_moqoriginproducer_new" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
@@ -269,6 +327,8 @@
269 (ffi/defcfn free-moqannounced "uniffi_moq_ffi_fn_free_moqannounced" [:uint64 :pointer] :void)327 (ffi/defcfn free-moqannounced "uniffi_moq_ffi_fn_free_moqannounced" [:uint64 :pointer] :void)
270 (ffi/defcfn free-moqannouncedbroadcast "uniffi_moq_ffi_fn_free_moqannouncedbroadcast" [:uint64 :pointer] :void)328 (ffi/defcfn free-moqannouncedbroadcast "uniffi_moq_ffi_fn_free_moqannouncedbroadcast" [:uint64 :pointer] :void)
271 (ffi/defcfn free-moqannouncement "uniffi_moq_ffi_fn_free_moqannouncement" [:uint64 :pointer] :void)329 (ffi/defcfn free-moqannouncement "uniffi_moq_ffi_fn_free_moqannouncement" [:uint64 :pointer] :void)
330+(ffi/defcfn free-moqaudioconsumer "uniffi_moq_ffi_fn_free_moqaudioconsumer" [:uint64 :pointer] :void)
331+(ffi/defcfn free-moqaudioproducer "uniffi_moq_ffi_fn_free_moqaudioproducer" [:uint64 :pointer] :void)
272 (ffi/defcfn free-moqbroadcastconsumer "uniffi_moq_ffi_fn_free_moqbroadcastconsumer" [:uint64 :pointer] :void)332 (ffi/defcfn free-moqbroadcastconsumer "uniffi_moq_ffi_fn_free_moqbroadcastconsumer" [:uint64 :pointer] :void)
273 (ffi/defcfn free-moqbroadcastdynamic "uniffi_moq_ffi_fn_free_moqbroadcastdynamic" [:uint64 :pointer] :void)333 (ffi/defcfn free-moqbroadcastdynamic "uniffi_moq_ffi_fn_free_moqbroadcastdynamic" [:uint64 :pointer] :void)
274 (ffi/defcfn free-moqbroadcastproducer "uniffi_moq_ffi_fn_free_moqbroadcastproducer" [:uint64 :pointer] :void)334 (ffi/defcfn free-moqbroadcastproducer "uniffi_moq_ffi_fn_free_moqbroadcastproducer" [:uint64 :pointer] :void)
@@ -297,6 +357,7 @@
297 (ffi/defcfn free-moqtrackdynamic "uniffi_moq_ffi_fn_free_moqtrackdynamic" [:uint64 :pointer] :void)357 (ffi/defcfn free-moqtrackdynamic "uniffi_moq_ffi_fn_free_moqtrackdynamic" [:uint64 :pointer] :void)
298 (ffi/defcfn free-moqtrackproducer "uniffi_moq_ffi_fn_free_moqtrackproducer" [:uint64 :pointer] :void)358 (ffi/defcfn free-moqtrackproducer "uniffi_moq_ffi_fn_free_moqtrackproducer" [:uint64 :pointer] :void)
299 (ffi/defcfn free-moqtrackrequest "uniffi_moq_ffi_fn_free_moqtrackrequest" [:uint64 :pointer] :void)359 (ffi/defcfn free-moqtrackrequest "uniffi_moq_ffi_fn_free_moqtrackrequest" [:uint64 :pointer] :void)
360+(ffi/defcfn free-moqvideoproducer "uniffi_moq_ffi_fn_free_moqvideoproducer" [:uint64 :pointer] :void)
300 (ffi/defcfn func-moq-log-level "uniffi_moq_ffi_fn_func_moq_log_level" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)361 (ffi/defcfn func-moq-log-level "uniffi_moq_ffi_fn_func_moq_log_level" [[:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
301 (ffi/defcfn method-moqannounced-cancel "uniffi_moq_ffi_fn_method_moqannounced_cancel" [:uint64 :pointer] :void)362 (ffi/defcfn method-moqannounced-cancel "uniffi_moq_ffi_fn_method_moqannounced_cancel" [:uint64 :pointer] :void)
302 (ffi/defcfn method-moqannounced-next "uniffi_moq_ffi_fn_method_moqannounced_next" [:uint64] :uint64)363 (ffi/defcfn method-moqannounced-next "uniffi_moq_ffi_fn_method_moqannounced_next" [:uint64] :uint64)
@@ -304,10 +365,19 @@
304 (ffi/defcfn method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_fn_method_moqannouncedbroadcast_cancel" [:uint64 :pointer] :void)365 (ffi/defcfn method-moqannouncedbroadcast-cancel "uniffi_moq_ffi_fn_method_moqannouncedbroadcast_cancel" [:uint64 :pointer] :void)
305 (ffi/defcfn method-moqannouncement-broadcast "uniffi_moq_ffi_fn_method_moqannouncement_broadcast" [:uint64 :pointer] :uint64)366 (ffi/defcfn method-moqannouncement-broadcast "uniffi_moq_ffi_fn_method_moqannouncement_broadcast" [:uint64 :pointer] :uint64)
306 (ffi/defcfn method-moqannouncement-path "uniffi_moq_ffi_fn_method_moqannouncement_path" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])367 (ffi/defcfn method-moqannouncement-path "uniffi_moq_ffi_fn_method_moqannouncement_path" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
368+(ffi/defcfn method-moqaudioconsumer-cancel "uniffi_moq_ffi_fn_method_moqaudioconsumer_cancel" [:uint64 :pointer] :void)
369+(ffi/defcfn method-moqaudioconsumer-next "uniffi_moq_ffi_fn_method_moqaudioconsumer_next" [:uint64] :uint64)
370+(ffi/defcfn method-moqaudioproducer-finish "uniffi_moq_ffi_fn_method_moqaudioproducer_finish" [:uint64 :pointer] :void)
371+(ffi/defcfn method-moqaudioproducer-name "uniffi_moq_ffi_fn_method_moqaudioproducer_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
372+(ffi/defcfn method-moqaudioproducer-reset-epoch "uniffi_moq_ffi_fn_method_moqaudioproducer_reset_epoch" [:uint64 :pointer] :void)
373+(ffi/defcfn method-moqaudioproducer-unused "uniffi_moq_ffi_fn_method_moqaudioproducer_unused" [:uint64] :uint64)
374+(ffi/defcfn method-moqaudioproducer-used "uniffi_moq_ffi_fn_method_moqaudioproducer_used" [:uint64] :uint64)
375+(ffi/defcfn method-moqaudioproducer-write "uniffi_moq_ffi_fn_method_moqaudioproducer_write" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
307 (ffi/defcfn method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)376 (ffi/defcfn method-moqbroadcastconsumer-fetch-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
308 (ffi/defcfn method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_media_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)377 (ffi/defcfn method-moqbroadcastconsumer-fetch-media-group "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_fetch_media_group" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
309 (ffi/defcfn method-moqbroadcastconsumer-route "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])378 (ffi/defcfn method-moqbroadcastconsumer-route "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
310 (ffi/defcfn method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route_updates" [:uint64 :pointer] :uint64)379 (ffi/defcfn method-moqbroadcastconsumer-route-updates "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_route_updates" [:uint64 :pointer] :uint64)
380+(ffi/defcfn method-moqbroadcastconsumer-subscribe-audio "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_audio" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
311 (ffi/defcfn method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_catalog" [:uint64] :uint64)381 (ffi/defcfn method-moqbroadcastconsumer-subscribe-catalog "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_catalog" [:uint64] :uint64)
312 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)382 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
313 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)383 (ffi/defcfn method-moqbroadcastconsumer-subscribe-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastconsumer_subscribe_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]]] :uint64)
@@ -318,12 +388,14 @@
318 (ffi/defcfn method-moqbroadcastproducer-consume "uniffi_moq_ffi_fn_method_moqbroadcastproducer_consume" [:uint64 :pointer] :uint64)388 (ffi/defcfn method-moqbroadcastproducer-consume "uniffi_moq_ffi_fn_method_moqbroadcastproducer_consume" [:uint64 :pointer] :uint64)
319 (ffi/defcfn method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_fn_method_moqbroadcastproducer_dynamic" [:uint64 :pointer] :uint64)389 (ffi/defcfn method-moqbroadcastproducer-dynamic "uniffi_moq_ffi_fn_method_moqbroadcastproducer_dynamic" [:uint64 :pointer] :uint64)
320 (ffi/defcfn method-moqbroadcastproducer-finish "uniffi_moq_ffi_fn_method_moqbroadcastproducer_finish" [:uint64 :pointer] :void)390 (ffi/defcfn method-moqbroadcastproducer-finish "uniffi_moq_ffi_fn_method_moqbroadcastproducer_finish" [:uint64 :pointer] :void)
391+(ffi/defcfn method-moqbroadcastproducer-publish-audio "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_audio" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
321 (ffi/defcfn method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)392 (ffi/defcfn method-moqbroadcastproducer-publish-json-snapshot "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_snapshot" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
322 (ffi/defcfn method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)393 (ffi/defcfn method-moqbroadcastproducer-publish-json-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_json_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
323 (ffi/defcfn method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)394 (ffi/defcfn method-moqbroadcastproducer-publish-media "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
324 (ffi/defcfn method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_on_track" [:uint64 :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)395 (ffi/defcfn method-moqbroadcastproducer-publish-media-on-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_on_track" [:uint64 :uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
325 (ffi/defcfn method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)396 (ffi/defcfn method-moqbroadcastproducer-publish-media-stream "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_media_stream" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
326 (ffi/defcfn method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_track" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)397 (ffi/defcfn method-moqbroadcastproducer-publish-track "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_track" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
398+(ffi/defcfn method-moqbroadcastproducer-publish-video "uniffi_moq_ffi_fn_method_moqbroadcastproducer_publish_video" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
327 (ffi/defcfn method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_remove_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)399 (ffi/defcfn method-moqbroadcastproducer-remove-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_remove_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
328 (ffi/defcfn method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_announce" [:uint64 :int8 :pointer] :void)400 (ffi/defcfn method-moqbroadcastproducer-set-announce "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_announce" [:uint64 :int8 :pointer] :void)
329 (ffi/defcfn method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)401 (ffi/defcfn method-moqbroadcastproducer-set-catalog-section "uniffi_moq_ffi_fn_method_moqbroadcastproducer_set_catalog_section" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
@@ -437,3 +509,10 @@
437 (ffi/defcfn method-moqtrackrequest-accept "uniffi_moq_ffi_fn_method_moqtrackrequest_accept" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)509 (ffi/defcfn method-moqtrackrequest-accept "uniffi_moq_ffi_fn_method_moqtrackrequest_accept" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :uint64)
438 (ffi/defcfn method-moqtrackrequest-dynamic "uniffi_moq_ffi_fn_method_moqtrackrequest_dynamic" [:uint64 :pointer] :uint64)510 (ffi/defcfn method-moqtrackrequest-dynamic "uniffi_moq_ffi_fn_method_moqtrackrequest_dynamic" [:uint64 :pointer] :uint64)
439 (ffi/defcfn method-moqtrackrequest-name "uniffi_moq_ffi_fn_method_moqtrackrequest_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])511 (ffi/defcfn method-moqtrackrequest-name "uniffi_moq_ffi_fn_method_moqtrackrequest_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
512+(ffi/defcfn method-moqvideoproducer-cut "uniffi_moq_ffi_fn_method_moqvideoproducer_cut" [:uint64 :pointer] :void)
513+(ffi/defcfn method-moqvideoproducer-finish "uniffi_moq_ffi_fn_method_moqvideoproducer_finish" [:uint64 :pointer] :void)
514+(ffi/defcfn method-moqvideoproducer-name "uniffi_moq_ffi_fn_method_moqvideoproducer_name" [:uint64 :pointer] [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]])
515+(ffi/defcfn method-moqvideoproducer-set-bitrate "uniffi_moq_ffi_fn_method_moqvideoproducer_set_bitrate" [:uint64 :uint64 :pointer] :void)
516+(ffi/defcfn method-moqvideoproducer-unused "uniffi_moq_ffi_fn_method_moqvideoproducer_unused" [:uint64] :uint64)
517+(ffi/defcfn method-moqvideoproducer-used "uniffi_moq_ffi_fn_method_moqvideoproducer_used" [:uint64] :uint64)
518+(ffi/defcfn method-moqvideoproducer-write "uniffi_moq_ffi_fn_method_moqvideoproducer_write" [:uint64 [:by-value [:struct [[:capacity :uint64] [:len :uint64] [:data :pointer]]]] :pointer] :void)
modified src/frq/moq/uniffi.clj +8 -10
@@ -93,15 +93,13 @@
9393 v#
9494 (throw-status! s#))))))
9595
96-(def ^:private moq-error-variants
97- ;; MoqError, in the order UniFFI numbers it (1-based, as written by the
98- ;; generated readers). Regenerated by hand when the pin moves — a variant
99- ;; added upstream shows up here as :moq/unknown rather than as a wrong name.
100- {1 :protocol 2 :media 3 :mux 4 :json-track 5 :url
101- 6 :time-overflow 7 :log-level 8 :task 9 :json 10 :cancelled
102- 11 :closed 12 :connect 13 :bind 14 :reject 15 :already-responded
103- 16 :codec 17 :unauthorized 18 :forbidden 19 :not-found 20 :unsupported
104- 21 :invalid-route 22 :log})
96+;; The variant table lives in `frq.moq.raw`, generated beside the entry points.
97+;; It was hand-written here once and that was a mistake worth recording: the
98+;; variants are INSERTED into, not appended to — turning moq-ffi's audio and
99+;; video features on adds Audio and Video at 5 and 6 and shifts every later
100+;; variant down two. A stale table does not answer "unknown variant"; it
101+;; answers a confident, wrong name for a real one, and the message beside it
102+;; still reads correctly, so nothing looks broken.
105103
106104 ;; UniFFI serialises into a RustBuffer BIG-ENDIAN, which is not this machine's
107105 ;; order — so these read byte by byte rather than through ffi/read, whose
@@ -128,7 +126,7 @@
128126 (let [variant (be-u32 data 0)
129127 n (be-u32 data 4)
130128 n (min n (- len 8))]
131- {:variant (get moq-error-variants variant :moq/unknown)
129+ {:variant (get raw/moq-error-variants variant :moq/unknown)
132130 :message (when (pos? n) (ffi/read-bytes (+ data 8) n))})))
133131
134132 (defn- status-message
@@ -93,15 +93,13 @@
93 v#93 v#
94 (throw-status! s#))))))94 (throw-status! s#))))))
95 95
96-(def ^:private moq-error-variants96+;; The variant table lives in `frq.moq.raw`, generated beside the entry points.
97- ;; MoqError, in the order UniFFI numbers it (1-based, as written by the97+;; It was hand-written here once and that was a mistake worth recording: the
98- ;; generated readers). Regenerated by hand when the pin moves — a variant98+;; variants are INSERTED into, not appended to — turning moq-ffi's audio and
99- ;; added upstream shows up here as :moq/unknown rather than as a wrong name.99+;; video features on adds Audio and Video at 5 and 6 and shifts every later
100- {1 :protocol 2 :media 3 :mux 4 :json-track 5 :url100+;; variant down two. A stale table does not answer "unknown variant"; it
101- 6 :time-overflow 7 :log-level 8 :task 9 :json 10 :cancelled101+;; answers a confident, wrong name for a real one, and the message beside it
102- 11 :closed 12 :connect 13 :bind 14 :reject 15 :already-responded102+;; still reads correctly, so nothing looks broken.
103- 16 :codec 17 :unauthorized 18 :forbidden 19 :not-found 20 :unsupported
104- 21 :invalid-route 22 :log})
105 103
106 ;; UniFFI serialises into a RustBuffer BIG-ENDIAN, which is not this machine's104 ;; UniFFI serialises into a RustBuffer BIG-ENDIAN, which is not this machine's
107 ;; order — so these read byte by byte rather than through ffi/read, whose105 ;; order — so these read byte by byte rather than through ffi/read, whose
@@ -128,7 +126,7 @@
128 (let [variant (be-u32 data 0)126 (let [variant (be-u32 data 0)
129 n (be-u32 data 4)127 n (be-u32 data 4)
130 n (min n (- len 8))]128 n (min n (- len 8))]
131- {:variant (get moq-error-variants variant :moq/unknown)129+ {:variant (get raw/moq-error-variants variant :moq/unknown)
132 :message (when (pos? n) (ffi/read-bytes (+ data 8) n))})))130 :message (when (pos? n) (ffi/read-bytes (+ data 8) n))})))
133 131
134 (defn- status-message132 (defn- status-message
modified tools/py2jolt.py +27 -0
@@ -82,6 +82,25 @@ def main(path):
8282 rows.append((n, a, r))
8383 return rows, unknown, len(names)
8484
85+def error_variants(path):
86+ """The MoqError variant table, read from the same generated bindings.
87+
88+ Hand-maintaining this is a trap: the variants are not appended to, they are
89+ INSERTED into. Turning moq-ffi\'s audio/video features on adds Audio and
90+ Video at 5 and 6 and shifts every later variant down two, so a stale table
91+ does not report an unknown variant -- it reports a confidently wrong name
92+ for a real one.
93+ """
94+ src = open(path).read()
95+ i = src.index("class _UniffiFfiConverterTypeMoqError")
96+ blk = src[i:]
97+ blk = blk[:blk.index("\nclass ", 10)]
98+ pairs = re.findall(r"if variant == (\d+):\s*\n\s*return MoqError\.(\w+)\(", blk)
99+ def kebab(n):
100+ return re.sub(r"(?<!^)(?=[A-Z])", "-", n).lower()
101+ return [(int(n), kebab(name)) for n, name in pairs]
102+
103+
85104 if __name__ == "__main__":
86105 rows, unknown, total = main(sys.argv[1])
87106 print(f";; {len(rows)} of {total} entry points bound", file=sys.stderr)
@@ -89,6 +108,14 @@ if __name__ == "__main__":
89108 print(";; UNMAPPED (left unbound rather than guessed):", file=sys.stderr)
90109 for t, c in unknown.most_common():
91110 print(f";; {t} x{c}", file=sys.stderr)
111+ variants = error_variants(sys.argv[1])
112+ print(";; MoqError, as UniFFI numbers it in THIS object. Generated with the")
113+ print(";; entry points above, and for the same reason: the variants are")
114+ print(";; inserted into rather than appended to, so a table written by hand")
115+ print(";; against one build names the wrong error in the next.")
116+ print("(def moq-error-variants")
117+ print(" {" + "\n ".join("%d :%s" % (n, k) for n, k in variants) + "})")
118+ print()
92119 for n, a, r in rows:
93120 # Anchored, longest-first: "uniffi_moq_ffi_checksum_" must not be
94121 # eaten by the "ffi_moq_ffi_" that also matches inside it.
@@ -82,6 +82,25 @@ def main(path):
82 rows.append((n, a, r))82 rows.append((n, a, r))
83 return rows, unknown, len(names)83 return rows, unknown, len(names)
84 84
85+def error_variants(path):
86+ """The MoqError variant table, read from the same generated bindings.
87+
88+ Hand-maintaining this is a trap: the variants are not appended to, they are
89+ INSERTED into. Turning moq-ffi\'s audio/video features on adds Audio and
90+ Video at 5 and 6 and shifts every later variant down two, so a stale table
91+ does not report an unknown variant -- it reports a confidently wrong name
92+ for a real one.
93+ """
94+ src = open(path).read()
95+ i = src.index("class _UniffiFfiConverterTypeMoqError")
96+ blk = src[i:]
97+ blk = blk[:blk.index("\nclass ", 10)]
98+ pairs = re.findall(r"if variant == (\d+):\s*\n\s*return MoqError\.(\w+)\(", blk)
99+ def kebab(n):
100+ return re.sub(r"(?<!^)(?=[A-Z])", "-", n).lower()
101+ return [(int(n), kebab(name)) for n, name in pairs]
102+
103+
85 if __name__ == "__main__":104 if __name__ == "__main__":
86 rows, unknown, total = main(sys.argv[1])105 rows, unknown, total = main(sys.argv[1])
87 print(f";; {len(rows)} of {total} entry points bound", file=sys.stderr)106 print(f";; {len(rows)} of {total} entry points bound", file=sys.stderr)
@@ -89,6 +108,14 @@ if __name__ == "__main__":
89 print(";; UNMAPPED (left unbound rather than guessed):", file=sys.stderr)108 print(";; UNMAPPED (left unbound rather than guessed):", file=sys.stderr)
90 for t, c in unknown.most_common():109 for t, c in unknown.most_common():
91 print(f";; {t} x{c}", file=sys.stderr)110 print(f";; {t} x{c}", file=sys.stderr)
111+ variants = error_variants(sys.argv[1])
112+ print(";; MoqError, as UniFFI numbers it in THIS object. Generated with the")
113+ print(";; entry points above, and for the same reason: the variants are")
114+ print(";; inserted into rather than appended to, so a table written by hand")
115+ print(";; against one build names the wrong error in the next.")
116+ print("(def moq-error-variants")
117+ print(" {" + "\n ".join("%d :%s" % (n, k) for n, k in variants) + "})")
118+ print()
92 for n, a, r in rows:119 for n, a, r in rows:
93 # Anchored, longest-first: "uniffi_moq_ffi_checksum_" must not be120 # Anchored, longest-first: "uniffi_moq_ffi_checksum_" must not be
94 # eaten by the "ffi_moq_ffi_" that also matches inside it.121 # eaten by the "ffi_moq_ffi_" that also matches inside it.