open-standards/joule-code/joule-code-rs/crates/joule-moq-web/web/binding/worker.js
Transaction Science a196743340 joule-moq-web: frames bound to the objects they came from, routes before decode, and the binding page
web/room/binding.js: the side table a page carries contentBinding in until a registry
lists the member (decoder and timestamp, clone, transfer, reset, a bound; ambiguity
refused), the capability report built in two passes so that only codec strings the
WebCodecs Codec Registry lists are put to the user agent, and the state of the frame on
screen. The room routes each track before it decodes it, binds every frame its video
decoders output to the verified object and group receipt, and shows the state of each
tile's frame with ?debug=binding. web/binding/ runs live-conformance/browser in the page,
the wasm route's verified decode, the binding through clone, transfer, copyTo and
re-encode, the metadata probe and a capability report from the user agent's answers.
e2e: scenario binding, energy.py for the host's per-process counter, and the decode wasm
built by run.sh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:21:58 -04:00

18 lines
802 B
JavaScript

// The other realm of the transfer test (WAI browser-sink §8, §9.2 step 5): a frame posted here
// with its binding beside it is attached on arrival in this realm's side table; the worker
// says what it holds, then posts the frame back the same way.
import { SideTable, installFramePatches } from "../room/binding.js";
installFramePatches();
const table = new SideTable();
self.onmessage = (e) => {
const { frame, binding } = e.data;
table.transferIn(frame, binding || null);
const held = SideTable.of(frame);
const clone = frame.clone();
const cloned = SideTable.of(clone);
clone.close();
const back = table.transferOut(frame);
self.postMessage({ held: held ? held.binding : null, cloned: cloned ? cloned.binding : null, format: frame.format, frame, binding: back }, [frame]);
};