platform-decode §2 reads the query a page asks the platform from the payload of every capability browser-sink §4.1 gives a user-agent decoder, not only AV1 and HEVC. §2.1 adds VP9 (the codec string from the first key frame's uncompressed header, the level from VP9's level table over the frame size and the mean rate of the IVF timestamps, the matrix of its colour space), AVC (avc1 and the SPS's profile, constraint byte and level, the size after the cropping rectangle) and VP8. §2.2 adds the audio query, asked of AudioDecoder.isConfigSupported and of decodingInfo with an AudioConfiguration: Ogg Opus (its OpusHead the description), one Opus packet (the TOC byte), FLAC (STREAMINFO; the marker and metadata the description) and AAC in ADTS (mp4a.40.<object type>, or mp4a.66 to mp4a.68 for MPEG-2). §2.3 reads, by the same readers, the chunks a page gives the decoder and which of them are key. §3: answers to several configurations under one codec string are merged, so no object is routed to a decoder that refused its configuration. browser-sink §3 takes the audio answers into the report; §14.3 has the composing page ask about every alternative platform-decode maps and decode one routed ua through WebCodecs from §2.3's chunks. wai::platform_decode: Query::Video and Query::Audio, chunks, chunks_json, merge_answers, media_of. wai-web: platformMapped, platformChunks, platformMerge; compose.js asks and decodes through them for every mapped capability, video and audio. platform-decode-conformance/queries.json: the query and chunk summary of real payloads of every mapped capability (payloads/, written by payloads/make.sh with an independent prober's readings in prober.tsv, and the identify and encode corpora's streams), and planted faults with their outcomes. live-conformance/browser_sink_verify.py, given that directory, recomputes every case with its own readers and requires every mutated copy to fail. verify_platform_decode.mjs reads every payload through the wasm32 build in Chromium and WebKit and decodes it where the platform accepts its configuration; platform-decode §5 records the run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
3.8 KiB
platform-decode-conformance — the query a sink asks a web platform
Vectors for extensions/platform-decode.md: the query
a sink reads from an entry's payload for a web platform's Media Capabilities and WebCodecs
(§2.1 video, §2.2 audio), and the chunks it gives the decoder (§2.3). The order the
platform's answers feed is SPEC §4's energy order inside browser-sink's routing, and its
vectors are the choices of ../live-conformance/browser/.
Provenance. queries.json names payloads written by real encoders and muxers, none of
them made for these vectors but those in payloads/:
- two floor objects of the packaging corpus (
../pack-conformance/packs/), whose codec strings are the ones the packager wrote into the packs' HLS masters, and one HEVC SPS the platform's encoder wrote through WebCodecs, configured withprefer-hardware, a hint the user agent may ignore (§5 of the extension records the run); - the elementary streams of
../identify-conformance/ext/(VP9 in IVF, H.264 and H.265 Annex B, Ogg Opus, FLAC, ADTS), written bytools/make_external.shthere; - AVC and HEVC streams the platform's and a software encoder wrote
(
../encode-conformance/streams/); payloads/, written bypayloads/make.shwith open encoders from synthetic test patterns and sine waves: VP8, VP9 4:4:4 (profile 1) and 10-bit BT.2020 full range (profile 2), AVC High with B-frames and a cropped height, stereo AAC-LC at 44.1 kHz, stereo 24-bit FLAC, stereo Ogg Opus, and one Opus packet with no container (the first audio packet of that stream).payloads/prober.tsvis what an independent media prober read of each: its codec, profile, size, pixel format, colour, rate and channels.
Then planted faults: a payload with one edit (mutate, a byte offset and the bits flipped
there) and the outcome it gives, refused or another query.
Every expectation of the cases this revision added was computed by the second implementation (below) from the payload, and the reference gives each one; neither reads the other's code.
Layout
queries.json—cases: acapability; apayload_file(aWAI1envelope, relative towai/), apayload_raw(a file whose bytes are the payload) or ansps_hex;rate, the presentation rate a sink gives a payload that states none;mutate, the edit of a planted fault; thenrefused: true, orexpect(members of the query's JSON form,platform_decode::query_json) andchunks(platform_decode::chunks_json: how many chunks, how many key, the bytes they hold, the samples a channel they decode to, the description's length).payloads/— the payloads above,make.shandprober.tsv.grain-free-av1/— §6 of the extension: a grain-freewai.video.av1base, its reference decode and probe, twowai.video.int_refinelayers written against that decode, a stream with film grain, and the cases a sink replays; itsREADME.mdstates them and their verifiers.
Equivalence
An implementation conforms when it gives every query's members and every chunk summary,
and refuses every case marked refused. The reference is wai::platform_decode
(wai-rs/src/platform_decode.rs), whose tests read this file. The second implementation is
../live-conformance/browser_sink_verify.py, written from the extension's text, which with
this directory as its second argument recomputes every case from the payload and requires
every mutated copy of the vectors to fail:
python3 -I live-conformance/browser_sink_verify.py live-conformance/browser platform-decode-conformance
wai-web/demo/verify_platform_decode.mjs reads every payload here that is not a planted
fault in browser engines, through the wasm32 build, and decodes it through the platform's
WebCodecs where the platform accepts its configuration.