@blockcast/mmt-container 0.4.0 → 0.4.1-main.2e0aa69d293d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -21
- package/dist/align.d.ts +24 -18
- package/dist/align.d.ts.map +1 -1
- package/dist/align.js +23 -4
- package/dist/align.js.map +2 -2
- package/dist/browser-runtime.js +5070 -908
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +76 -39
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +321 -205
- package/dist/carp-catalog.js.map +3 -3
- package/dist/catalog-fec-params.d.ts +12 -4
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +40 -17
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.d.ts +28 -7
- package/dist/catalog-network-source.d.ts.map +1 -1
- package/dist/catalog-network-source.js +21 -1
- package/dist/catalog-network-source.js.map +2 -2
- package/dist/catalog-validator.d.ts +4 -3
- package/dist/catalog-validator.d.ts.map +1 -1
- package/dist/catalog-validator.js +0 -29
- package/dist/catalog-validator.js.map +3 -3
- package/dist/cmcd-producer.d.ts +13 -1
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +14 -0
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.js +115 -235
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/fec-manager.d.ts +113 -1
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +464 -66
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +2 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +18 -3
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.d.ts +10 -0
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +15 -4
- package/dist/fec-worker-setup.js.map +2 -2
- package/dist/held-layer-admission.d.ts +58 -0
- package/dist/held-layer-admission.d.ts.map +1 -0
- package/dist/held-layer-admission.js +105 -0
- package/dist/held-layer-admission.js.map +7 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +39 -1
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +109 -17
- package/dist/iso-block-locator.js.map +3 -3
- package/dist/mfu-reassembler.js +21 -13
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +93 -22
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +3692 -1213
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +93 -22
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +192 -0
- package/dist/mmtp-fec-session.d.ts.map +1 -0
- package/dist/mmtp-fec-session.js +640 -0
- package/dist/mmtp-fec-session.js.map +7 -0
- package/dist/mmtp-router.d.ts +101 -32
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +422 -189
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +94 -92
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +746 -131
- package/dist/multicast-auth-catalog.js.map +4 -4
- package/dist/multicast-input.d.ts +31 -8
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +299 -35
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +140 -12
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +4104 -605
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +16 -3
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +127 -240
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +21 -13
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.d.ts +5 -3
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +3643 -1197
- package/dist/no-modules.js.map +4 -4
- package/dist/phase14-catalog-override.d.ts +1 -1
- package/dist/phase14-catalog-override.d.ts.map +1 -1
- package/dist/phase14-catalog-override.js +2 -2
- package/dist/phase14-catalog-override.js.map +2 -2
- package/dist/repair-fetch.d.ts +90 -6
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +160 -32
- package/dist/repair-fetch.js.map +3 -3
- package/dist/repair-layers.d.ts +2 -0
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +19 -2
- package/dist/repair-layers.js.map +2 -2
- package/dist/sample-combiner.d.ts +7 -1
- package/dist/sample-combiner.d.ts.map +1 -1
- package/dist/sample-combiner.js +14 -2
- package/dist/sample-combiner.js.map +2 -2
- package/dist/signaling.d.ts +2 -2
- package/dist/signaling.d.ts.map +1 -1
- package/dist/signaling.js +3 -3
- package/dist/signaling.js.map +2 -2
- package/dist/switching-set-alignment.d.ts +1 -1
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js +21 -13
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js +93 -22
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +6 -18
- package/schemas/catalog.schema.json +133 -38
- package/src/align.ts +52 -21
- package/src/carp-catalog.ts +188 -68
- package/src/catalog-fec-params.ts +28 -3
- package/src/catalog-network-source.ts +49 -7
- package/src/catalog-validator.ts +4 -11
- package/src/cmcd-producer.ts +23 -1
- package/src/fec-manager.ts +378 -63
- package/src/fec-state.ts +11 -4
- package/src/fec-worker-setup.ts +30 -2
- package/src/held-layer-admission.ts +161 -0
- package/src/index.ts +32 -19
- package/src/iso-block-locator.ts +110 -7
- package/src/mmtp-container-parser.ts +75 -7
- package/src/mmtp-fec-session.ts +606 -0
- package/src/mmtp-router.ts +453 -236
- package/src/multicast-auth-catalog.ts +196 -231
- package/src/multicast-input.ts +148 -124
- package/src/multicast-manager.ts +447 -53
- package/src/multicast-transport.ts +23 -5
- package/src/no-modules.ts +8 -7
- package/src/phase14-catalog-override.ts +3 -3
- package/src/repair-fetch.ts +306 -42
- package/src/repair-layers.ts +22 -2
- package/src/sample-combiner.ts +15 -2
- package/src/signaling.ts +2 -2
- package/src/switching-set-alignment.ts +1 -1
- package/test-vectors/align.json +108 -32
- package/test-vectors/bc-provenance-v2.json +1526 -0
- package/test-vectors/catalog/README.md +71 -4
- package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
- package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
- package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
- package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
- package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
- package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
- package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
- package/test-vectors/catalog/negative/multicast-amt-driad-with-relay.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-below-min.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
- package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
- package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
- package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
- package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
- package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
- package/test-vectors/catalog/positive/fec-multicast.json +1 -1
- package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
- package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
- package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
- package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +3 -3
- package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
- package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
- package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
- package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
- package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
- package/test-vectors/catalog/section-codes.json +31 -1
- package/test-vectors/catalog-multicast-auth-v1.json +38 -20
- package/test-vectors/catalog-validation.json +101 -5
- package/test-vectors/catalog-validator-public-api.mjs +14 -9
- package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
- package/dist/fec-codec.d.ts +0 -32
- package/dist/fec-codec.d.ts.map +0 -1
- package/dist/fec-codec.js +0 -47
- package/dist/fec-codec.js.map +0 -7
- package/dist/manifest-auth-plan.d.ts +0 -30
- package/dist/manifest-auth-plan.d.ts.map +0 -1
- package/dist/manifest-auth-plan.js +0 -1266
- package/dist/manifest-auth-plan.js.map +0 -7
- package/dist/source-auth.d.ts +0 -2
- package/dist/source-auth.d.ts.map +0 -1
- package/dist/source-auth.js +0 -1209
- package/dist/source-auth.js.map +0 -7
- package/src/fec-codec.ts +0 -61
- package/src/manifest-auth-plan.ts +0 -107
- package/src/source-auth.ts +0 -1
- package/test-vectors/generate-source-auth-fixture.mjs +0 -114
- package/test-vectors/source-auth-v1.json +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockcast/mmt-container",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1-main.2e0aa69d293d",
|
|
4
4
|
"description": "MMTP/LOC container parsing for MMT over MoQ and SSM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"import": "./dist/browser-runtime.js",
|
|
15
15
|
"types": "./dist/index.d.ts"
|
|
16
16
|
},
|
|
17
|
-
"./source-auth": {
|
|
18
|
-
"import": "./dist/source-auth.js",
|
|
19
|
-
"types": "./dist/source-auth.d.ts"
|
|
20
|
-
},
|
|
21
17
|
"./mfu": {
|
|
22
18
|
"import": "./dist/mfu-reassembler.js",
|
|
23
19
|
"types": "./dist/mfu-reassembler.d.ts"
|
|
@@ -86,10 +82,6 @@
|
|
|
86
82
|
"import": "./dist/wasm-mmtp-container-parser.js",
|
|
87
83
|
"types": "./dist/wasm-mmtp-container-parser.d.ts"
|
|
88
84
|
},
|
|
89
|
-
"./fec-codec": {
|
|
90
|
-
"import": "./dist/fec-codec.js",
|
|
91
|
-
"types": "./dist/fec-codec.d.ts"
|
|
92
|
-
},
|
|
93
85
|
"./cmcd-producer": {
|
|
94
86
|
"import": "./dist/cmcd-producer.js",
|
|
95
87
|
"types": "./dist/cmcd-producer.d.ts"
|
|
@@ -106,10 +98,6 @@
|
|
|
106
98
|
"import": "./dist/multicast-auth-catalog.js",
|
|
107
99
|
"types": "./dist/multicast-auth-catalog.d.ts"
|
|
108
100
|
},
|
|
109
|
-
"./manifest-auth-plan": {
|
|
110
|
-
"import": "./dist/manifest-auth-plan.js",
|
|
111
|
-
"types": "./dist/manifest-auth-plan.d.ts"
|
|
112
|
-
},
|
|
113
101
|
"./catalog-validator": {
|
|
114
102
|
"import": "./dist/catalog-validator.js",
|
|
115
103
|
"types": "./dist/catalog-validator.d.ts"
|
|
@@ -170,18 +158,18 @@
|
|
|
170
158
|
"build": "tsc --emitDeclarationOnly && node build.mjs",
|
|
171
159
|
"dev": "tsc --watch",
|
|
172
160
|
"clean": "rm -rf dist",
|
|
173
|
-
"bench:source-auth": "node bench/source-auth-wasm.mjs",
|
|
174
161
|
"bench:amt-hot-path": "node --expose-gc --max-semi-space-size=64 bench/amt-hot-path.mjs",
|
|
175
162
|
"test:catalog-validator-public-api": "node test-vectors/catalog-validator-public-api.mjs",
|
|
176
163
|
"test": "vitest run",
|
|
177
164
|
"test:watch": "vitest"
|
|
178
165
|
},
|
|
179
166
|
"dependencies": {
|
|
167
|
+
"@blockcast/fec-worker": "0.4.1-main.2e0aa69d293d",
|
|
168
|
+
"@blockcast/mmt-base": "0.4.1-main.2e0aa69d293d",
|
|
169
|
+
"@blockcast/mmt-fec": "0.4.1-main.2e0aa69d293d",
|
|
170
|
+
"@blockcast/mmt-manifest-verify": "0.4.1-main.2e0aa69d293d",
|
|
171
|
+
"@noble/curves": "^1.9.7",
|
|
180
172
|
"@noble/hashes": "^1.8.0",
|
|
181
|
-
"@blockcast/mmt-fec": "^0.4.0",
|
|
182
|
-
"@blockcast/mmt-manifest-verify": "^0.4.0",
|
|
183
|
-
"@blockcast/fec-worker": "^0.4.0",
|
|
184
|
-
"@blockcast/mmt-base": "^0.4.0",
|
|
185
173
|
"ajv": "^8.17.1",
|
|
186
174
|
"ajv-formats": "^3.0.1"
|
|
187
175
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"required": ["version", "tracks"],
|
|
8
8
|
"properties": {
|
|
9
|
-
"version": { "
|
|
9
|
+
"version": { "enum": [1, "draft-01"], "description": "MSF catalog version: the integer 1, or the \"draft-01\" tag the draft-ramadan-moq-*-01 examples carry." },
|
|
10
10
|
"streamingFormat": { "const": "mmtp" },
|
|
11
11
|
"streamingFormatVersion": { "type": "string", "minLength": 1 },
|
|
12
12
|
"supportsDeltaUpdates": { "type": "boolean" },
|
|
@@ -16,10 +16,25 @@
|
|
|
16
16
|
"items": { "$ref": "#/$defs/track" }
|
|
17
17
|
},
|
|
18
18
|
"multicast": { "$ref": "#/$defs/multicast" },
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"archive": { "$ref": "#/$defs/archive" },
|
|
20
|
+
"initDataList": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"description": "MSF 5.1.7 initialization data, profiled by draft-ramadan-moq-mmt-01 4.5: a track's initRef names an entry; an \"inline\" entry carries a base64 ftyp+moov in data.",
|
|
23
|
+
"items": { "$ref": "#/$defs/initDataEntry" }
|
|
24
|
+
}
|
|
21
25
|
},
|
|
22
26
|
"$defs": {
|
|
27
|
+
"initDataEntry": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["id", "type"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"id": { "type": "string", "minLength": 1 },
|
|
32
|
+
"type": { "type": "string", "minLength": 1 },
|
|
33
|
+
"data": { "type": "string", "minLength": 1 }
|
|
34
|
+
},
|
|
35
|
+
"if": { "properties": { "type": { "const": "inline" } }, "required": ["type"] },
|
|
36
|
+
"then": { "properties": { "data": true }, "required": ["data"] }
|
|
37
|
+
},
|
|
23
38
|
"archive": {
|
|
24
39
|
"type": "object",
|
|
25
40
|
"additionalProperties": false,
|
|
@@ -78,6 +93,17 @@
|
|
|
78
93
|
"items": { "type": "string", "minLength": 1 }
|
|
79
94
|
},
|
|
80
95
|
"initData": { "type": "string", "minLength": 1 },
|
|
96
|
+
"initRef": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"minLength": 1,
|
|
99
|
+
"description": "id of the root initDataList entry holding this track's init segment (draft-ramadan-moq-mmt-01 4.5). Preferred over initData when both are present."
|
|
100
|
+
},
|
|
101
|
+
"presentationAnchorTicks": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"minimum": -9007199254740991,
|
|
104
|
+
"maximum": 9007199254740991,
|
|
105
|
+
"description": "Signed track timestamp of shared presentation time zero (draft-ramadan-moq-mmt-01 4.4.1); group_number = floor((ticks - presentationAnchorTicks) / groupDurationTicks). REQUIRED for synchronized audio/video tracks; omitted means a local origin of 0."
|
|
106
|
+
},
|
|
81
107
|
"initTrack": { "type": "string", "minLength": 1 },
|
|
82
108
|
"priority": { "type": "integer", "minimum": 0, "maximum": 255 },
|
|
83
109
|
"repairLayer": {
|
|
@@ -102,7 +128,7 @@
|
|
|
102
128
|
"const": "keyframe",
|
|
103
129
|
"description": "fec-repair only. Marks a keyframe overlay: a separate FEC instance over random access point fragments."
|
|
104
130
|
},
|
|
105
|
-
"mmtpMode": { "
|
|
131
|
+
"mmtpMode": { "const": "mfu" },
|
|
106
132
|
"timescale": { "$ref": "#/$defs/positiveInteger" },
|
|
107
133
|
"groupDurationMs": { "$ref": "#/$defs/positiveInteger" },
|
|
108
134
|
"groupDurationTicks": { "$ref": "#/$defs/positiveInteger" },
|
|
@@ -119,7 +145,7 @@
|
|
|
119
145
|
"then": {
|
|
120
146
|
"required": ["mmtpMode", "timescale"],
|
|
121
147
|
"properties": {
|
|
122
|
-
"mmtpMode": { "
|
|
148
|
+
"mmtpMode": { "const": "mfu" },
|
|
123
149
|
"timescale": { "$ref": "#/$defs/positiveInteger" },
|
|
124
150
|
"groupDurationMs": { "$ref": "#/$defs/positiveInteger" }
|
|
125
151
|
},
|
|
@@ -204,7 +230,11 @@
|
|
|
204
230
|
"additionalProperties": false,
|
|
205
231
|
"required": ["algorithm", "sourceSymbols", "repairSymbols", "symbolSize", "repairTrack"],
|
|
206
232
|
"properties": {
|
|
207
|
-
"algorithm": {
|
|
233
|
+
"algorithm": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"minLength": 1,
|
|
236
|
+
"description": "FEC scheme token (draft-ramadan-moq-fec-01 4): raptorq, reed-solomon, none, or another registered value. A receiver that does not implement the token consumes the track without FEC; it is not a catalog error."
|
|
237
|
+
},
|
|
208
238
|
"blockProfile": {
|
|
209
239
|
"enum": ["iso-ssbg1-v1"],
|
|
210
240
|
"description": "FEC block profile (ISO/IEC 23008-1 Annex C, draft-ramadan-moq-fec 5.1). Required whenever algorithm declares an FEC instance (anything but \"none\"); never defaulted or inferred. The only profile is iso-ssbg1-v1: ssbg_mode1, K' = SSB_length, consecutive SS_IDs. Any other token, the retired k-padded-v1 included, is invalid; a receiver treats such a track as having no FEC."
|
|
@@ -223,6 +253,11 @@
|
|
|
223
253
|
"if": { "properties": { "algorithm": { "const": "none" } }, "required": ["algorithm"] },
|
|
224
254
|
"else": { "properties": { "blockProfile": true }, "required": ["blockProfile"] }
|
|
225
255
|
},
|
|
256
|
+
{
|
|
257
|
+
"$comment": "draft-ramadan-moq-fec-01 6.3.4 rule 13: under iso-ssbg1-v1 a symbol is at least 14 octets (Section 7.3); a shorter symbol carries no protected MMTP packet.",
|
|
258
|
+
"if": { "properties": { "blockProfile": { "const": "iso-ssbg1-v1" } }, "required": ["blockProfile"] },
|
|
259
|
+
"then": { "properties": { "symbolSize": { "type": "integer", "minimum": 14 } } }
|
|
260
|
+
},
|
|
226
261
|
{
|
|
227
262
|
"if": { "properties": { "algorithm": { "const": "raptorq" } }, "required": ["algorithm"] },
|
|
228
263
|
"then": {
|
|
@@ -248,8 +283,9 @@
|
|
|
248
283
|
"type": "object",
|
|
249
284
|
"additionalProperties": false,
|
|
250
285
|
"required": ["groupAddress", "port", "tracks"],
|
|
286
|
+
"description": "draft-ramadan-moq-multicast-01 4.1 (Blockcast/moqcast-draft@fd962fd7). sourceAddress selects SSM, its absence ASM; protocol only restates that mode. A bearer such as AMT or ATSC 3.0 is a networkSource entry, never a protocol.",
|
|
251
287
|
"properties": {
|
|
252
|
-
"protocol": { "enum": ["ssm", "asm"
|
|
288
|
+
"protocol": { "enum": ["ssm", "asm"] },
|
|
253
289
|
"sourceAddress": { "type": "string", "minLength": 1 },
|
|
254
290
|
"groupAddress": { "type": "string", "minLength": 1 },
|
|
255
291
|
"port": { "type": "integer", "minimum": 1, "maximum": 65535 },
|
|
@@ -258,82 +294,129 @@
|
|
|
258
294
|
"minItems": 1,
|
|
259
295
|
"items": { "$ref": "#/$defs/endpointTrack" }
|
|
260
296
|
},
|
|
261
|
-
"bandwidth": { "$ref": "#/$defs/positiveInteger" }
|
|
297
|
+
"bandwidth": { "$ref": "#/$defs/positiveInteger" },
|
|
298
|
+
"auth": { "$ref": "#/$defs/endpointAuth" },
|
|
299
|
+
"networkSource": {
|
|
300
|
+
"type": "array",
|
|
301
|
+
"minItems": 1,
|
|
302
|
+
"items": { "$ref": "#/$defs/networkSource" }
|
|
303
|
+
}
|
|
262
304
|
},
|
|
263
305
|
"allOf": [
|
|
264
|
-
{
|
|
265
|
-
"anyOf": [
|
|
266
|
-
{ "properties": { "protocol": true }, "required": ["protocol"] },
|
|
267
|
-
{ "properties": { "sourceAddress": true }, "required": ["sourceAddress"] }
|
|
268
|
-
]
|
|
269
|
-
},
|
|
270
306
|
{
|
|
271
307
|
"if": { "properties": { "protocol": { "const": "ssm" } }, "required": ["protocol"] },
|
|
272
308
|
"then": {
|
|
273
309
|
"required": ["sourceAddress"],
|
|
274
310
|
"properties": { "sourceAddress": { "type": "string", "minLength": 1 } }
|
|
275
311
|
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"if": { "properties": { "protocol": { "const": "asm" } }, "required": ["protocol"] },
|
|
315
|
+
"then": { "not": { "properties": { "sourceAddress": true }, "required": ["sourceAddress"] } }
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"if": { "properties": { "auth": true }, "required": ["auth"] },
|
|
319
|
+
"then": {
|
|
320
|
+
"properties": { "bandwidth": true },
|
|
321
|
+
"required": ["bandwidth"],
|
|
322
|
+
"if": { "properties": { "sourceAddress": true }, "required": ["sourceAddress"] },
|
|
323
|
+
"then": {
|
|
324
|
+
"properties": {
|
|
325
|
+
"auth": { "not": { "type": "object", "properties": { "senderAddress": true }, "required": ["senderAddress"] } }
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"else": {
|
|
329
|
+
"properties": {
|
|
330
|
+
"auth": { "type": "object", "properties": { "senderAddress": true }, "required": ["senderAddress"] }
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
276
334
|
}
|
|
277
335
|
]
|
|
278
336
|
},
|
|
337
|
+
"endpointAuth": {
|
|
338
|
+
"type": "object",
|
|
339
|
+
"additionalProperties": false,
|
|
340
|
+
"required": ["manifestPort", "streamId"],
|
|
341
|
+
"description": "draft-ramadan-moq-multicast-01 7.2.6: marks the endpoint's flow protected. Required on every endpoint when multicast.auth is present and forbidden otherwise; port clashes on one (S, G) are validateCmsfMmtpCatalog's.",
|
|
342
|
+
"properties": {
|
|
343
|
+
"manifestPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
|
|
344
|
+
"streamId": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
|
|
345
|
+
"senderAddress": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"minLength": 1,
|
|
348
|
+
"description": "S of a protected ASM endpoint; must not appear on an SSM endpoint."
|
|
349
|
+
},
|
|
350
|
+
"maxAuthDelayMs": { "type": "integer", "minimum": 50, "maximum": 1000, "default": 200 },
|
|
351
|
+
"manifestTimerMs": { "type": "integer", "minimum": 1, "maximum": 9007199254740991, "default": 20 },
|
|
352
|
+
"manifestTrack": { "type": "string", "minLength": 1 }
|
|
353
|
+
}
|
|
354
|
+
},
|
|
279
355
|
"networkSource": {
|
|
280
356
|
"oneOf": [
|
|
281
357
|
{
|
|
282
358
|
"type": "object",
|
|
283
359
|
"additionalProperties": false,
|
|
284
|
-
"required": ["type"
|
|
360
|
+
"required": ["type"],
|
|
361
|
+
"description": "draft-ramadan-moq-multicast-01 4.2.1. discovery is OPTIONAL: omitted with a hostname relay means dns, omitted with no relay means DRIAD. dns and manual name their relay; driad MUST omit it.",
|
|
285
362
|
"properties": {
|
|
286
363
|
"type": { "const": "amt" },
|
|
287
|
-
"discovery": { "enum": ["driad", "manual"] },
|
|
364
|
+
"discovery": { "enum": ["dns", "driad", "manual"] },
|
|
288
365
|
"relay": { "type": "string", "minLength": 1 },
|
|
289
366
|
"port": { "type": "integer", "minimum": 1, "maximum": 65535 }
|
|
290
|
-
}
|
|
367
|
+
},
|
|
368
|
+
"allOf": [
|
|
369
|
+
{
|
|
370
|
+
"if": { "properties": { "discovery": { "enum": ["dns", "manual"] } }, "required": ["discovery"] },
|
|
371
|
+
"then": { "properties": { "relay": true }, "required": ["relay"] }
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"if": { "properties": { "discovery": { "const": "driad" } }, "required": ["discovery"] },
|
|
375
|
+
"then": { "not": { "properties": { "relay": true }, "required": ["relay"] } }
|
|
376
|
+
}
|
|
377
|
+
]
|
|
291
378
|
},
|
|
292
379
|
{
|
|
293
380
|
"type": "object",
|
|
381
|
+
"description": "ATSC 3.0 broadcast tuning for an MMTP service (draft-multicast-01 Sections 4.2.2-4.2.3). frequency is REQUIRED; plpId, serviceId and slsUri are OPTIONAL.",
|
|
294
382
|
"additionalProperties": false,
|
|
295
|
-
"required": ["type", "frequency"
|
|
383
|
+
"required": ["type", "frequency"],
|
|
296
384
|
"properties": {
|
|
297
385
|
"type": { "const": "atsc3" },
|
|
298
|
-
"frequency": { "$ref": "#/$defs/positiveInteger" },
|
|
386
|
+
"frequency": { "$ref": "#/$defs/positiveInteger", "description": "RF centre frequency in kHz (e.g. 587000 for 587 MHz)." },
|
|
299
387
|
"plpId": { "type": "integer", "minimum": 0, "maximum": 63 },
|
|
300
388
|
"serviceId": { "type": "integer", "minimum": 0, "maximum": 65535 },
|
|
301
|
-
"slsUri": { "type": "string", "format": "uri" }
|
|
389
|
+
"slsUri": { "type": "string", "format": "uri", "description": "SLS of an MMTP service, MP table included (A/331:2026-04 7.2). The SLS describes the MMTP session and nothing of this profile, so manifestPort and keys come from provisioning, not from the SLS." }
|
|
302
390
|
}
|
|
303
391
|
}
|
|
304
392
|
]
|
|
305
393
|
},
|
|
306
|
-
"
|
|
394
|
+
"multicastAuthKey": {
|
|
307
395
|
"type": "object",
|
|
308
396
|
"additionalProperties": false,
|
|
309
|
-
"required": ["
|
|
397
|
+
"required": ["kid", "publicKey", "firstEpoch"],
|
|
310
398
|
"properties": {
|
|
311
|
-
"
|
|
312
|
-
"
|
|
313
|
-
"
|
|
314
|
-
"sourceSymbolFormat": { "type": "string", "minLength": 1 }
|
|
399
|
+
"kid": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
|
|
400
|
+
"publicKey": { "type": "string", "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$" },
|
|
401
|
+
"firstEpoch": { "type": "integer", "minimum": 0, "maximum": 4294967295 }
|
|
315
402
|
}
|
|
316
403
|
},
|
|
317
404
|
"multicastAuth": {
|
|
318
405
|
"type": "object",
|
|
319
406
|
"additionalProperties": false,
|
|
320
|
-
"required": ["scheme", "
|
|
407
|
+
"required": ["scheme", "version", "sig", "keys", "minEpoch"],
|
|
408
|
+
"description": "bc-provenance version 2, draft-ramadan-moq-multicast-01 7.2.6. A keys array repeating a kid or a firstEpoch holds no key set; validateCmsfMmtpCatalog rejects it.",
|
|
321
409
|
"properties": {
|
|
322
410
|
"scheme": { "const": "bc-provenance" },
|
|
323
|
-
"
|
|
411
|
+
"version": { "const": 2 },
|
|
324
412
|
"sig": { "const": "ed25519" },
|
|
325
|
-
"
|
|
326
|
-
"keyId": { "type": "string", "minLength": 1 },
|
|
327
|
-
"previousKey": { "type": "string", "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$" },
|
|
328
|
-
"compaction": { "enum": ["merkle", "none"] },
|
|
329
|
-
"enforcement": { "enum": ["shadow", "enforce"] },
|
|
330
|
-
"tracks": {
|
|
413
|
+
"keys": {
|
|
331
414
|
"type": "array",
|
|
332
415
|
"minItems": 1,
|
|
333
|
-
"
|
|
334
|
-
"
|
|
335
|
-
|
|
336
|
-
}
|
|
416
|
+
"maxItems": 4,
|
|
417
|
+
"items": { "$ref": "#/$defs/multicastAuthKey" }
|
|
418
|
+
},
|
|
419
|
+
"minEpoch": { "type": "integer", "minimum": 0, "maximum": 4294967295 }
|
|
337
420
|
}
|
|
338
421
|
},
|
|
339
422
|
"multicast": {
|
|
@@ -350,6 +433,18 @@
|
|
|
350
433
|
"type": "array",
|
|
351
434
|
"minItems": 1,
|
|
352
435
|
"items": { "$ref": "#/$defs/networkSource" }
|
|
436
|
+
},
|
|
437
|
+
"auth": { "$ref": "#/$defs/multicastAuth" }
|
|
438
|
+
},
|
|
439
|
+
"if": { "properties": { "auth": true }, "required": ["auth"] },
|
|
440
|
+
"then": {
|
|
441
|
+
"properties": {
|
|
442
|
+
"endpoints": { "type": "array", "items": { "type": "object", "properties": { "auth": true }, "required": ["auth"] } }
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"else": {
|
|
446
|
+
"properties": {
|
|
447
|
+
"endpoints": { "type": "array", "items": { "not": { "type": "object", "properties": { "auth": true }, "required": ["auth"] } } }
|
|
353
448
|
}
|
|
354
449
|
}
|
|
355
450
|
}
|
package/src/align.ts
CHANGED
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
* ──────────────────────────────────────────────────────────────────────────
|
|
9
9
|
* Contract (integer-ticks form, authoritative):
|
|
10
10
|
*
|
|
11
|
-
* groupId =
|
|
11
|
+
* groupId = floor((ticks - presentationAnchorTicks) / groupDurationTicks)
|
|
12
12
|
*
|
|
13
13
|
* Where `ticks` is a media timestamp expressed at the catalog's `timescale`
|
|
14
|
-
* (Hz),
|
|
14
|
+
* (Hz), `groupDurationTicks = groupDurationSec * timescale`, and
|
|
15
|
+
* `presentationAnchorTicks` is the track's signed catalog anchor
|
|
16
|
+
* (draft-ramadan-moq-mmt-01 Section 4.4.1; zero when the track omits it).
|
|
17
|
+
* There is no clamp: a `ticks` earlier than the anchor is an error the
|
|
18
|
+
* publisher must reject, never group 0.
|
|
15
19
|
*
|
|
16
20
|
* Integer math means there is no epsilon and no float rounding to reason
|
|
17
21
|
* about. The seconds-form wrapper `groupIdFor(Seconds, seconds)` exists for
|
|
@@ -30,13 +34,13 @@
|
|
|
30
34
|
* sender/relay/receiver is worse than any formula change.
|
|
31
35
|
*
|
|
32
36
|
* Canonical implementations:
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* TS: THIS FILE (libmmt) — consumed via @blockcast/mmt-container.
|
|
38
|
+
* Rust: libmmt `mmt-core/src/align.rs` (`group_id_for_ticks`) — consumed
|
|
39
|
+
* by FFmpeg / hang-mmt-fec libmoq, which re-pin to this fixture.
|
|
40
|
+
* Go: Blockcast/multicast `cmd/caddy/sender/group_align.go` is the CMAF
|
|
41
|
+
* (cmafpackaging) sender, not an mmtp implementation; it loads this
|
|
42
|
+
* fixture only when LIBMMT_ALIGN_VECTORS is set and must follow the
|
|
43
|
+
* version-2 vectors before it does.
|
|
40
44
|
* ──────────────────────────────────────────────────────────────────────────
|
|
41
45
|
*/
|
|
42
46
|
|
|
@@ -84,17 +88,22 @@ export function asSeconds(n: number): Seconds {
|
|
|
84
88
|
* Deterministic groupId from integer ticks. Authoritative form of the
|
|
85
89
|
* contract (see module docstring).
|
|
86
90
|
*
|
|
87
|
-
* @param ticks
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
+
* @param ticks — media presentation time in ticks (integer).
|
|
92
|
+
* @param groupDurationTicks — group duration in ticks (positive integer).
|
|
93
|
+
* @param presentationAnchorTicks — catalog `presentationAnchorTicks` (signed
|
|
94
|
+
* integer); defaults to 0, the local origin
|
|
95
|
+
* of a track that omits the field.
|
|
91
96
|
* @returns non-negative integer groupId.
|
|
92
97
|
*
|
|
93
|
-
* Throws on non-integer/non-finite inputs
|
|
94
|
-
*
|
|
95
|
-
*
|
|
98
|
+
* Throws on non-integer/non-finite inputs, non-positive duration, or
|
|
99
|
+
* `ticks < presentationAnchorTicks` (moq-mmt-01 4.4.1: the publisher MUST
|
|
100
|
+
* reject that MPU and MUST NOT clamp it to group 0).
|
|
96
101
|
*/
|
|
97
|
-
export function groupIdForTicks(
|
|
102
|
+
export function groupIdForTicks(
|
|
103
|
+
ticks: number,
|
|
104
|
+
groupDurationTicks: number,
|
|
105
|
+
presentationAnchorTicks = 0,
|
|
106
|
+
): number {
|
|
98
107
|
if (!Number.isInteger(ticks)) {
|
|
99
108
|
throw new Error(
|
|
100
109
|
`[align] groupIdForTicks: ticks must be an integer, got ${ticks}`,
|
|
@@ -105,8 +114,23 @@ export function groupIdForTicks(ticks: number, groupDurationTicks: number): numb
|
|
|
105
114
|
`[align] groupIdForTicks: groupDurationTicks must be a positive integer, got ${groupDurationTicks}`,
|
|
106
115
|
)
|
|
107
116
|
}
|
|
108
|
-
if (
|
|
109
|
-
|
|
117
|
+
if (!Number.isInteger(presentationAnchorTicks)) {
|
|
118
|
+
throw new Error(
|
|
119
|
+
`[align] groupIdForTicks: presentationAnchorTicks must be an integer, got ${presentationAnchorTicks}`,
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
const relativeTicks = ticks - presentationAnchorTicks
|
|
123
|
+
if (!Number.isSafeInteger(relativeTicks)) {
|
|
124
|
+
throw new Error(
|
|
125
|
+
`[align] groupIdForTicks: ticks - presentationAnchorTicks = ${relativeTicks} is not a safe integer`,
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
if (relativeTicks < 0) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
`[align] groupIdForTicks: ticks ${ticks} precede presentationAnchorTicks ${presentationAnchorTicks}; the publisher must reject this MPU (moq-mmt-01 4.4.1)`,
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
return Math.floor(relativeTicks / groupDurationTicks)
|
|
110
134
|
}
|
|
111
135
|
|
|
112
136
|
/**
|
|
@@ -119,7 +143,8 @@ export function groupIdForTicks(ticks: number, groupDurationTicks: number): numb
|
|
|
119
143
|
* branch of the parameter type is a migration ramp — new code should
|
|
120
144
|
* pass `Seconds` explicitly (via `secondsFromTicks` or `asSeconds`).
|
|
121
145
|
*
|
|
122
|
-
* @param mediaTimeSec — finite
|
|
146
|
+
* @param mediaTimeSec — finite non-negative seconds (anchor 0); a
|
|
147
|
+
* negative value throws, it is never clamped.
|
|
123
148
|
* @param groupDurationSec — positive finite seconds.
|
|
124
149
|
*
|
|
125
150
|
* @deprecated Use `groupIdForTicks(ticks, groupDurationTicks)` with
|
|
@@ -153,7 +178,13 @@ export function groupIdFor(
|
|
|
153
178
|
`[align] groupIdFor: groupDurationSec must be a positive finite number, got ${groupDurationSec}`,
|
|
154
179
|
)
|
|
155
180
|
}
|
|
156
|
-
|
|
181
|
+
// No clamp (moq-mmt-01 4.4.1). Checked before rounding: a tiny negative
|
|
182
|
+
// rounds to -0 ticks, which `groupIdForTicks` would accept as 0.
|
|
183
|
+
if ((mediaTimeSec as number) < 0) {
|
|
184
|
+
throw new Error(
|
|
185
|
+
`[align] groupIdFor: mediaTimeSec ${mediaTimeSec} precedes presentationAnchorTicks 0; the publisher must reject this MPU (moq-mmt-01 4.4.1)`,
|
|
186
|
+
)
|
|
187
|
+
}
|
|
157
188
|
// 1e9 Hz keeps both operands inside Number.MAX_SAFE_INTEGER (2^53-1)
|
|
158
189
|
// for ~104 days of media time. Beyond that, Math.round returns a
|
|
159
190
|
// non-safe-integer float that Number.isInteger still accepts — throw
|