From 277cebd344abd5b0f93dc42035fc63779a476986 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 18 Nov 2026 16:04:04 -0800 Subject: [PATCH 1/2] chore(quest): claim quest/m2/hang04/README.md Quest-Claim: 4ace436e3bb1d1d6 From bcded05647774a7653fa056102a868d99b934325 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 18 Nov 2026 16:21:14 -0800 Subject: [PATCH 2/2] docs(hang): the hang-04 changelog describes the catalog that ships Rewrite the draft's moq-hang-04 changelog as the change from the published hang-03, dropping steps main took on the way and adding the Discovery, TTML, CMAF run, and LOC framing changes it missed. Complete the list of catalog changes an older consumer can ignore, and give the data track bitrate its range. The shared parity corpus now covers stats, echo, path spelling, includes, the sync clock, every data track field, text, and the remaining video and audio fields. It found Rust accepting a data track bitrate above 2^53 - 1 that JS refuses; Rust now refuses it too. Finishes the hang04 epic. Co-Authored-By: Claude Opus 5.5 --- drafts/draft-lcurley-moq-hang.md | 62 ++-- quest/m2/README.md | 3 +- quest/m2/hang04/README.md | 47 --- quest/m3/ffi-catalog-skipped.md | 4 - rs/hang/fixtures/catalog-parity.json | 441 +++++++++++++++++++++++++++ rs/hang/src/catalog/binary.rs | 4 +- rs/hang/src/catalog/json.rs | 4 +- 7 files changed, 476 insertions(+), 89 deletions(-) delete mode 100644 quest/m2/hang04/README.md diff --git a/drafts/draft-lcurley-moq-hang.md b/drafts/draft-lcurley-moq-hang.md index 645fab0dd10..275914d7759 100644 --- a/drafts/draft-lcurley-moq-hang.md +++ b/drafts/draft-lcurley-moq-hang.md @@ -168,7 +168,7 @@ A field one entry carries raises only that entry's `version`, so an older consum A change raises a version only when a consumer that ignored it would misread the catalog, never for a field it can safely ignore. This draft writes no root `version`, and needs an entry `version` of 4 only for a `track` ({{field-track}}) other than the entry's ID, which an older consumer subscribes to instead. -Every other catalog change in this draft is safe to ignore: `enabled` ({{field-enabled}}) leaves an older consumer selecting a disabled rendition, which plays nothing; `sync` ({{sync}}) only offers the clock and join interval, which an older consumer goes without; `stats` and `echo` ({{media-stats}}) only offer optional tracks; `include` ({{include}}) only offers broadcasts to open on selection; video `reorder` leaves an older consumer inferring decode times from timestamps; `jitter`, `delay`, audio `warmup` ({{field-warmup}}), and the data track estimates are hints. +Every other catalog change in this draft is safe to ignore: `enabled` ({{field-enabled}}) leaves an older consumer selecting a disabled rendition, which plays nothing; `sync` ({{sync}}) only offers the clock and join interval, which an older consumer goes without; `stats` and `echo` ({{media-stats}}) only offer optional tracks; `include` ({{include}}) only offers broadcasts to open on selection; video `preference` leaves an older consumer choosing among every rendition it can decode; `instance` ({{field-instance}}) leaves it reading whichever stream it resolves; video `reorder` leaves it inferring decode times from timestamps; video `color`, `projection`, `stereo`, and `interlaced` and audio `layout` leave it presenting the decoded picture or channels unadjusted; `jitter`, `delay`, audio `warmup` ({{field-warmup}}), and the data track estimates are hints. ## Sync {#sync} The catalog's root `sync` field holds the broadcast's timeline: the clock every track's timestamps share, and how often a viewer can join its audio and video. @@ -670,8 +670,8 @@ A publisher SHOULD therefore keep a `stream` track's log within what its groups The `broadcast`, `instance`, and `track` fields carry the same meaning here as they do for a media rendition ({{field-broadcast}}, {{field-instance}}, {{field-track}}). ### bitrate, jitter, and delay {#data-estimates} -The optional `bitrate` field is the track's maximum bitrate in bits per second. -The optional `jitter` and `delay` fields carry the same meaning and rules as they do for a media rendition ({{field-jitter}}, {{field-delay}}), with a payload in place of a frame. +The optional `bitrate` field is the track's maximum bitrate in bits per second, an integer from 0 to 2^53 - 1. +The optional `jitter` and `delay` fields carry the same meaning, range, and rules as they do for a media rendition ({{field-jitter}}, {{field-delay}}), with a payload in place of a frame. A payload's presentation timestamp is its capture time on the broadcast's clock, the one its media renditions use, when the publisher knows it (a datagram's arrival, a sensor read), and otherwise the time the publisher wrote it. A publisher measures `delay` only from payloads that carry a capture time, and MUST omit it for a track written without one. @@ -1046,47 +1046,45 @@ This document has no IANA actions. ## moq-hang-04 {:numbered="false"} +- A reader refuses a JSON frame in which an object repeats a member name. - A catalog update takes effect at its frame's timestamp on the media timeline, not when a consumer reads it, and a publisher keeps superseded catalog groups as fresh as its media's for consumers behind the live edge; an untimed catalog track's updates apply on arrival. -- Defined AAC payloads without a `description` as ADTS, and payloads with an AudioSpecificConfig as raw AAC. -- A `broadcast` reference and an echo `path` are spelled like a path: one with an empty segment or a lone `\` refuses the catalog instead of collapsing. - Removed `catalog.json.z` and the data track `compression` field: compression is a track property the transport carries ({{compression}}), so each compressed track is one name, and the catalog, `stats` and `echo` snapshots, and JSON data tracks SHOULD be compressed. -- Replaced the root `archive` section and its per-track timelines with the root `sync` section ({{sync}}). Its `interval` is the longest group of any audio or video track, fixed for the broadcast, and the grid an edge numbers HLS and DASH segments on, each segment the smallest whole multiple of it at least a second long, from each group's first timestamp ({{hls}}); the root `clock` moved to `sync.clock`. Segment indexes, frame positions, `end`, `keyframe`, `timescale`, `replay`, `replayEpoch`, `store`, and `version` are gone. -- A reader refuses a JSON frame in which an object repeats a member name. -- A malformed audio or video rendition ({{malformed}}) refuses the catalog: a known codec string without valid parameters, a zero or out-of-range dimension, sample rate, or channel count, a bitrate or duration above 2^53 - 1, or a container without a string `kind`. - Added `version` on the root and on each rendition, data track, and include ({{catalog-version}}): the oldest draft that reads it. A consumer refuses a catalog whose root `version` is above its own, and skips an entry whose `version` is. A `track` other than the entry's ID needs an entry `version` of 4. Consumers MUST ignore unknown fields. -- A data track marks a discontinuity with a group of one object with no bytes, since its empty payload is data. An object with no bytes on an audio or video track, or sharing its group, is malformed. +- A root member this draft defines has its shape, or the catalog is refused: a section or field of the wrong type, `null`, or out of range is never read as absent. An application MUST NOT carry its own data under a root key this draft defines. +- Replaced the root `archive` and `clock` sections, and the timeline track the archive named, with the root `sync` section ({{sync}}): `sync.clock` is the former root `clock`, which every track, the catalog track included, converts into, and `sync.interval` is the longest group of any audio or video track, fixed for the broadcast. Removed the Timeline section. +- Added the HLS and DASH section ({{hls}}): an edge numbers segments on the grid `sync.interval` fixes, each segment the smallest whole multiple of the interval at least a second long and starting at the group containing its line, and lists a line no group starts as a gap. - Removed the Recording section: the store layout is a moq-archive format, documented with that crate, not part of this draft. -- Removed the viewer feedback `latency` field. - Removed the MPEG-TS Service Information section: {{moqmpegts}} defines the `mpegts` root section. -- Added the optional video `preference` field: a consumer selects automatically among the highest preference it can decode. -- Added the optional video `reorder` field: the most frames that can precede one in decode order and follow it in presentation, fixed for the track once declared. A consumer that authors decode times derives them from it and the current group alone, refusing deeper reordering; without it, a consumer infers them from timestamps. +- Removed the Discovery section. +- Added the optional root `include` map ({{include}}): whole broadcasts named by a relative `broadcast` and an optional `instance`, sharing the listing catalog's timeline and `sync`, opened only on selection, whose rendition IDs stay their own. An HLS master selects the includes it lists by reading their catalogs, without demanding media, and segments them on the listing catalog's `sync.interval`; an on-demand publisher answers its catalog without starting media production. +- Added optional `stats` and `echo` catalog sections, publisher and viewer snapshots keyed by rendition ID, and the `.echo` feedback broadcast convention. +- Added an optional `track` field to video, audio, text, `json`, and `binary` entries naming the track in its broadcast; the entry's key is its ID and names the track when `track` is absent. A consumer MUST reject a catalog using one ID for both a video and an audio rendition. - Added an optional `instance` beside every rendition and data track `broadcast` reference ({{field-instance}}). A consumer reads each referenced path from the first broadcast it resolves for a catalog instance; a present `instance` fails a rendition that resolves another stream, and is best effort against an Instance a receiver minted. -- Added the optional root `include` map ({{include}}): whole broadcasts named by a relative `broadcast` and an optional `instance`, opened only on selection, whose rendition IDs stay their own. -- Includes share the listing catalog's PTS timeline and root settings, including its clock and join interval. -- An HLS master selects the includes it lists by reading their catalogs, without demanding media, and segments them on the listing catalog's `sync.interval`; an on-demand publisher answers its catalog without starting media production. -- Added optional `stats` and `echo` catalog sections, publisher/viewer snapshots keyed by rendition ID, and the `.echo` feedback broadcast convention. -- An Opus frame timestamp counts the OpusHead pre-skip: a consumer presents each decoded sample the pre-skip earlier than its frame timestamp places it. - -- Defined the rendition `bitrate` ({{field-bitrate}}): the ceiling of the encoder's rate-control target, which a consumer prices the rendition at. -- Fixed a track's identity for its name ({{identity}}): codec, description, container, display aspect, sample rate, and channel count never change, while every other field, including size, bitrate, and framerate, updates in place. A change of identity takes a new track name, which a rendition may name with `track` while keeping its ID, or a new stream Instance. -- Specified MSF text metadata preservation and refusal of unrepresentable text packaging during gateway conversion. +- A `broadcast` reference and an echo `path` are spelled like a path: one with an empty segment or a lone `\` refuses the catalog instead of collapsing. - Specified conversion between relative broadcast references and MSF track namespaces without changing track identity, reading a namespace aligned with the catalog path's trailing segments as the catalog itself. - -- Added the optional audio `warmup` ({{field-warmup}}): the decoder pre-roll after a group start, rounded up to whole milliseconds, that a consumer decodes but does not present after a join. -- Defined `jitter` from media timestamps alone, the reorder delay and batch spans a publisher writes, replacing fixed frame-duration hints and wall-clock flush lateness. -- Timed CMAF samples from the frame timestamp, which is the fragment's earliest presentation time; `tfdt` is only relative within the fragment, and places the samples of an untimed frame. A timed CMAF track counts in its `mdhd` ticks. -- Replaced the live-edge floor with monotonic group starts: a group may overlap the previous group's content but not start before it. -- Added optional `bitrate` and `jitter` fields to `json` and `binary` track entries. +- Fixed a track's identity for its name ({{identity}}): codec, description, container, display aspect, interlacing, sample rate, and channel count never change, while every other field, including size, bitrate, and framerate, updates in place. A change of identity takes a new track name, which a rendition may name with `track` while keeping its ID, or a new stream Instance. +- A malformed audio or video rendition ({{malformed}}) refuses the catalog: a known codec string without valid parameters, a zero or out-of-range dimension, sample rate, or channel count, a bitrate or duration above 2^53 - 1, or a container without a string `kind`. +- Defined the rendition `bitrate` ({{field-bitrate}}): the ceiling of the encoder's rate-control target, which a consumer prices the rendition at. +- Defined `jitter` from media timestamps alone, the reorder delay and batch spans a publisher writes, replacing the flush delay and its frame-duration examples. - Added the optional `delay` rendition field: how far a rendition's timestamps persistently trail those other renditions already wrote, the least trail within each window of a second or a group and the largest of those windows, never lowered once advertised and never subtracted across renditions. -- A root member this draft defines has its shape, or the catalog is refused: a `sync`, `text`, `json`, `binary`, `stats`, or `echo` value of the wrong type, or `null`, and a malformed `clock` or `interval`, no longer read as absent. An application keeps its own root data under a namespaced key. -- Added the optional `delay` field to `json` and `binary` track entries, measured only from payloads stamped with their capture time on the broadcast clock. - Replaced the video `stalled` field with an optional `enabled` field on audio and video renditions. A consumer MUST NOT select a disabled rendition and ignores `stalled`. A consumer that predates `enabled` keeps selecting a disabled rendition. -- Audio `sampleRate` and `numberOfChannels` describe the decoded output, so HE-AAC names its SBR rate and parametric stereo names two channels. -- Added an optional `track` field to video, audio, text, `json`, and `binary` entries naming the track in its broadcast; the entry's key is its ID and names the track when `track` is absent. A consumer MUST reject a catalog using one ID for both a video and an audio rendition. +- Added the optional video `preference` field: a consumer selects automatically among the highest preference it can decode. +- Added the optional video `reorder` field: the most frames that can precede one in decode order and follow it in presentation, fixed for the track once declared. A consumer that authors decode times derives them from it and the current group alone, refusing deeper reordering; without it, a consumer infers them from timestamps. - Defined video `displayAspectWidth` and `displayAspectHeight` as the whole picture's display aspect, not the sample aspect. - Added the optional video `color` field: H.273 primaries, transfer, matrix, and range, plus the SMPTE ST 2086 mastering display and CTA-861.3 content light levels. - Added the optional video `projection` (rectilinear, or equirectangular with a longitude `fov`) and `stereo` (mono, left-right, or top-bottom) fields and the optional audio `layout` field (ambisonic). -- Added the optional video `interlaced` field, true when each decoded picture weaves two fields, and made it part of the track's identity ({{identity}}). +- Added the optional video `interlaced` field, true when each decoded picture weaves two fields. +- Audio `sampleRate` and `numberOfChannels` describe the decoded output, so HE-AAC names its SBR rate and parametric stereo names two channels. +- Added the optional audio `warmup` ({{field-warmup}}): the decoder pre-roll after a group start, rounded up to whole milliseconds, that a consumer decodes but does not present after a join. +- An Opus frame timestamp counts the OpusHead pre-skip: a consumer presents each decoded sample the pre-skip earlier than its frame timestamp places it. +- Defined AAC payloads without a `description` as ADTS, and payloads with an AudioSpecificConfig as raw AAC. +- A `ttml` payload is one complete TTML document in the `media` time base, clipped to its frame: its `body` begin matches the frame timestamp, and its `body` end bounds what it presents. +- Specified MSF text metadata preservation and refusal of unrepresentable text packaging during gateway conversion. +- Added optional `bitrate`, `jitter`, and `delay` fields to `json` and `binary` track entries, `delay` measured only from payloads stamped with their capture time on the broadcast clock. +- Replaced the live-edge floor with monotonic group starts: a group may overlap the previous group's content but not start before it. +- A data track marks a discontinuity with a group of one object with no bytes, since its empty payload is data. An object with no bytes on an audio or video track, or sharing its group, is malformed. +- Timed CMAF samples from the frame timestamp, which is the fragment's earliest presentation time; `tfdt` is only relative within the fragment, and places the samples of an untimed frame. A timed CMAF track counts in its `mdhd` ticks, and a fragment's runs lie back to back in its `mdat`, each `data_offset` counting from its `moof`. +- A `loc` frame's codec payload uses the `legacy` framing. ## moq-hang-03 {:numbered="false"} diff --git a/quest/m2/README.md b/quest/m2/README.md index 97cc32b28cd..4f61f38fbba 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -44,8 +44,7 @@ removal, a rename, or a wire, catalog, or format change that is free until - **Auth and crypto.** End-to-end encryption is its own unpublished crate again ([moq-dev/moq#8947](https://github.com/moq-dev/moq/pull/8947)); its [finished format](/quest/m3/e2ee-format.md) follows in m3. -- **Catalog, drafts, and formats.** [hang-04](/quest/m2/hang04/README.md) - (the `sync` section, a version per entry, no video `warmup`, the TS passthrough under +- **Catalog, drafts, and formats.** hang-04 (done: the `sync` section, a version per entry, no video `warmup`, the TS passthrough under `mpegts`, one strict rule); [declared ends](/quest/m2/time-addressing/consumers.md), back from m3. - **Native media and gateways.** [Upstream str0m](https://github.com/moq-dev/moq/pull/8963), which reverses the diff --git a/quest/m2/hang04/README.md b/quest/m2/hang04/README.md deleted file mode 100644 index e7f5b031c92..00000000000 --- a/quest/m2/hang04/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# [S] hang-04 freezes a catalog worth keeping - -## Goal - -The catalog JSON that the cut publishes as moq-hang-04 is the one a later -version can grow from: the broadcast's clock and join interval sit in a -section named for what they are, a player skips an entry it cannot read -instead of losing the whole catalog, nothing is promised that no producer -writes, and a mis-shaped section means one thing. Each child changes that -JSON, in `rs/hang`, `js/hang`, and `drafts/draft-lcurley-moq-hang.md`, while -hang-04 is still unpublished and every change is free. - -This README's own work is the last read before the freeze: once the children -have landed, the draft's `moq-hang-04` changelog describes the catalog that -ships (not the steps main took to reach it), `js/hang`'s -`catalog/parity.test.ts` and the Rust fixtures cover every section the draft -defines, and `just drafts check` passes. - -## Plan - -Decided 2026-11-16 (maintainer, /quest-plan of the pre-cut audit). The audit -read the catalog as a frozen format: hang-03 is what the datatracker and -`release` carry, so every hang-04 change on main is still open, and the 0.22 -readers are the first that check `version` at all. Each child's Plan records -its own decisions. - -The children land in any order. - -Every root section already reads under the hang draft's one rule (a root -member the draft defines has its shape, or the catalog is refused), so -the `sync` section and the MPEG-TS section are born strict. - -What the audit judged and kept, so nobody reopens it without new evidence: -`include`, `track` apart from the ID, `instance` on references, `enabled`, -`preference`, `reorder`, `color`, `projection`, `stereo`, audio `layout`, -`interlaced`, audio `warmup`, `jitter`, the data tracks' estimates, `stats`, -and `echo`. - -The hang draft's duration and discontinuity marker rules are rewritten by -[media consumers](/quest/m2/time-addressing/consumers.md), which now lands -before the cut, so hang-04 never specifies the markers. - -Public API: each child's. Wire: the hang-04 catalog JSON, unpublished. - -## Related - -- [Media consumers address groups by start](/quest/m2/time-addressing/consumers.md) - removes the markers from the draft's container rules diff --git a/quest/m3/ffi-catalog-skipped.md b/quest/m3/ffi-catalog-skipped.md index 0d2e62f814c..76e83bcc1e1 100644 --- a/quest/m3/ffi-catalog-skipped.md +++ b/quest/m3/ffi-catalog-skipped.md @@ -29,7 +29,3 @@ version-5 rendition yields the compatibility one plus the report, and each wrapper's smoke test reads the field. Public API: additive in moq-ffi and every wrapper. Wire: none. - -## Related - -- [hang-04 freezes a catalog worth keeping](/quest/m2/hang04/README.md) - the epic whose entry versions this exposes diff --git a/rs/hang/fixtures/catalog-parity.json b/rs/hang/fixtures/catalog-parity.json index fb575275caf..78b8534fbf4 100644 --- a/rs/hang/fixtures/catalog-parity.json +++ b/rs/hang/fixtures/catalog-parity.json @@ -6106,5 +6106,446 @@ } }, "refused": true + }, + { + "name": "stats and echo name their tracks", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "stats": { "track": "stats.json" }, + "echo": { "path": "viewers" } + }, + "video": ["ok"] + }, + { + "name": "echo path with a leading slash", + "catalog": { "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, "echo": { "path": "/viewers" } }, + "refused": true + }, + { + "name": "echo path with a trailing slash", + "catalog": { "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, "echo": { "path": "viewers/" } }, + "refused": true + }, + { + "name": "echo path with an empty segment", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "echo": { "path": "a//viewers" } + }, + "refused": true + }, + { + "name": "echo path with a lone backslash", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "echo": { "path": "a\\viewers" } + }, + "refused": true + }, + { + "name": "video broadcast with a leading slash", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "broadcast": "/source" } + } + } + }, + "refused": true + }, + { + "name": "video broadcast with a trailing slash", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "broadcast": "source/" } + } + } + }, + "refused": true + }, + { + "name": "video broadcast with an empty segment", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "broadcast": "a//source" } + } + } + }, + "refused": true + }, + { + "name": "video broadcast with a lone backslash", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "broadcast": "a\\source" } + } + } + }, + "refused": true + }, + { + "name": "video broadcast relative", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { + "codec": "avc1.64001f", + "broadcast": "./source", + "instance": "abc", + "track": "hd", + "version": 4 + } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "include missing broadcast", + "catalog": { "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, "include": { "a": {} } }, + "refused": true + }, + { + "name": "include broadcast with a leading slash", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "include": { "a": { "broadcast": "/a" } } + }, + "refused": true + }, + { + "name": "include empty instance", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "include": { "a": { "broadcast": "./a", "instance": "" } } + }, + "refused": true + }, + { + "name": "sync clock timescale zero", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "sync": { "clock": { "wall": 1000, "timescale": 0 } } + }, + "refused": true + }, + { + "name": "sync clock wall beyond 2^53", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "sync": { "clock": { "wall": 9007199254740992 } } + }, + "refused": true + }, + { + "name": "sync clock missing wall", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "sync": { "clock": { "timescale": 1000 } } + }, + "refused": true + }, + { + "name": "sync clock with a timescale", + "catalog": { + "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, + "sync": { "clock": { "wall": 1000, "timescale": 90000 } } + }, + "video": ["ok"] + }, + { + "name": "json unknown mode is kept for selection to skip", + "catalog": { "json": { "tracks": { "ok": { "mode": "snapshot" }, "probe": { "mode": "future" } } } }, + "json": ["ok", "probe"] + }, + { + "name": "binary unknown mode is kept for selection to skip", + "catalog": { "binary": { "tracks": { "ok": { "mode": "stream" }, "probe": { "mode": "future" } } } }, + "binary": ["ok", "probe"] + }, + { "name": "json missing mode", "catalog": { "json": { "tracks": { "probe": {} } } }, "refused": true }, + { + "name": "json mode not a string", + "catalog": { "json": { "tracks": { "probe": { "mode": 5 } } } }, + "refused": true + }, + { + "name": "json every field", + "catalog": { + "json": { + "tracks": { + "probe": { + "version": 4, + "mode": "stream", + "schema": "https://example.com/s.json", + "broadcast": "./x", + "instance": "i", + "track": "t", + "bitrate": 1, + "jitter": 2, + "delay": 3 + } + } + } + }, + "json": ["probe"] + }, + { + "name": "binary every field", + "catalog": { + "binary": { + "tracks": { + "probe": { "mode": "snapshot", "mime": "image/jpeg", "bitrate": 1, "jitter": 2, "delay": 3 } + } + } + }, + "binary": ["probe"] + }, + { + "name": "json compression field is unknown", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "compression": "deflate" } } } }, + "json": ["probe"] + }, + { + "name": "text unknown format is kept for selection to skip", + "catalog": { "text": { "renditions": { "ok": { "format": "vtt" }, "probe": { "format": "future" } } } }, + "text": ["ok", "probe"] + }, + { + "name": "text unknown role is kept", + "catalog": { + "text": { + "renditions": { "probe": { "format": "vtt", "role": "descriptions", "lang": "en", "label": "x" } } + } + }, + "text": ["probe"] + }, + { + "name": "text missing format", + "catalog": { "text": { "renditions": { "probe": { "role": "caption" } } } }, + "refused": true + }, + { + "name": "video unknown stereo is absent", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "stereo": "anaglyph" } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "video stalled is ignored", + "catalog": { + "video": { + "renditions": { "ok": { "codec": "avc1.64001f" }, "probe": { "codec": "avc1.64001f", "stalled": true } } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "video equirectangular VR180", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { + "codec": "avc1.64001f", + "projection": { "kind": "equirectangular", "fov": 180 }, + "stereo": "left-right" + } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "video projection fov zero", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "projection": { "kind": "equirectangular", "fov": 0 } } + } + } + }, + "refused": true + }, + { + "name": "video color", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { + "codec": "avc1.64001f", + "color": { + "primaries": 9, + "transfer": 16, + "matrix": 9, + "range": "limited", + "mastering": { + "red": { "x": 0.708, "y": 0.292 }, + "green": { "x": 0.17, "y": 0.797 }, + "blue": { "x": 0.131, "y": 0.046 }, + "white": { "x": 0.3127, "y": 0.329 }, + "maxLuminance": 1000, + "minLuminance": 0.0001 + }, + "contentLight": { "maxCll": 1000, "maxFall": 400 } + } + } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "video color unknown range", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "color": { "range": "studio" } } + } + } + }, + "refused": true + }, + { + "name": "video interlaced", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "interlaced": true } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "video displayAspect alone", + "catalog": { + "video": { + "renditions": { + "ok": { "codec": "avc1.64001f" }, + "probe": { "codec": "avc1.64001f", "displayAspectWidth": 16 } + } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "audio ambisonic with 1 channel", + "catalog": { + "audio": { + "renditions": { + "probe": { "codec": "opus", "sampleRate": 48000, "numberOfChannels": 1, "layout": "ambisonic" } + } + } + }, + "refused": true + }, + { + "name": "audio pcm", + "catalog": { + "audio": { + "renditions": { + "probe": { "codec": "pcm", "sampleRate": 48000, "numberOfChannels": 2, "bitrate": 3072000 } + } + } + }, + "audio": ["probe"] + }, + { + "name": "version 3 entry is read", + "catalog": { + "video": { + "renditions": { "ok": { "codec": "avc1.64001f" }, "probe": { "codec": "avc1.64001f", "version": 3 } } + } + }, + "video": ["ok", "probe"] + }, + { + "name": "root version 4 is read", + "catalog": { "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, "version": 4 }, + "video": ["ok"] + }, + { + "name": "root version 3 is read", + "catalog": { "video": { "renditions": { "ok": { "codec": "avc1.64001f" } } }, "version": 3 }, + "video": ["ok"] + }, + { + "name": "json bitrate beyond 2^53", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "bitrate": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "json bitrate 2^53 - 1", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "bitrate": 9007199254740991 } } } }, + "json": ["probe"] + }, + { + "name": "json jitter beyond 2^53", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "jitter": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "json jitter 2^53 - 1", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "jitter": 9007199254740991 } } } }, + "json": ["probe"] + }, + { + "name": "json delay beyond 2^53", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "delay": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "json delay 2^53 - 1", + "catalog": { "json": { "tracks": { "probe": { "mode": "snapshot", "delay": 9007199254740991 } } } }, + "json": ["probe"] + }, + { + "name": "binary bitrate beyond 2^53", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "bitrate": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "binary bitrate 2^53 - 1", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "bitrate": 9007199254740991 } } } }, + "binary": ["probe"] + }, + { + "name": "binary jitter beyond 2^53", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "jitter": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "binary jitter 2^53 - 1", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "jitter": 9007199254740991 } } } }, + "binary": ["probe"] + }, + { + "name": "binary delay beyond 2^53", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "delay": 9007199254740992 } } } }, + "refused": true + }, + { + "name": "binary delay 2^53 - 1", + "catalog": { "binary": { "tracks": { "probe": { "mode": "snapshot", "delay": 9007199254740991 } } } }, + "binary": ["probe"] } ] diff --git a/rs/hang/src/catalog/binary.rs b/rs/hang/src/catalog/binary.rs index eac35108e0f..0f3ebb19f27 100644 --- a/rs/hang/src/catalog/binary.rs +++ b/rs/hang/src/catalog/binary.rs @@ -116,9 +116,9 @@ pub struct BinaryConfig { #[serde_as(as = "crate::catalog::NotNull")] pub mime: Option, - /// The maximum bitrate of the track in bits per second, if known. + /// The maximum bitrate of the track in bits per second, if known, at most 2^53 - 1. #[serde(default)] - #[serde_as(as = "crate::catalog::NotNull")] + #[serde_as(as = "crate::catalog::NotNull")] pub bitrate: Option, /// The largest media span the publisher hands to the transport behind a payload's timestamp, diff --git a/rs/hang/src/catalog/json.rs b/rs/hang/src/catalog/json.rs index dfa194c3432..5e3075fcdf8 100644 --- a/rs/hang/src/catalog/json.rs +++ b/rs/hang/src/catalog/json.rs @@ -114,9 +114,9 @@ pub struct JsonConfig { #[serde_as(as = "crate::catalog::NotNull")] pub schema: Option, - /// The maximum bitrate of the track in bits per second, if known. + /// The maximum bitrate of the track in bits per second, if known, at most 2^53 - 1. #[serde(default)] - #[serde_as(as = "crate::catalog::NotNull")] + #[serde_as(as = "crate::catalog::NotNull")] pub bitrate: Option, /// The largest media span the publisher hands to the transport behind a payload's timestamp,