@blockcast/mmt-container 2.2.0-main.cc3fe0684403 → 2.2.0-main.d79fbb738dc0

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.
Files changed (126) hide show
  1. package/README.md +125 -2
  2. package/dist/__tests__/ad-creative-signer.d.ts +11 -0
  3. package/dist/__tests__/ad-creative-signer.d.ts.map +1 -0
  4. package/dist/__tests__/test-utils.d.ts +1 -0
  5. package/dist/__tests__/test-utils.d.ts.map +1 -1
  6. package/dist/ad-creative-record.d.ts +65 -0
  7. package/dist/ad-creative-record.d.ts.map +1 -0
  8. package/dist/ad-creative-record.js +2281 -0
  9. package/dist/ad-creative-record.js.map +7 -0
  10. package/dist/ad-creative-timeline.d.ts +102 -0
  11. package/dist/ad-creative-timeline.d.ts.map +1 -0
  12. package/dist/ad-creative-timeline.js +2529 -0
  13. package/dist/ad-creative-timeline.js.map +7 -0
  14. package/dist/block-policy.d.ts +128 -14
  15. package/dist/block-policy.d.ts.map +1 -1
  16. package/dist/block-policy.js +472 -27
  17. package/dist/block-policy.js.map +2 -2
  18. package/dist/browser-runtime.js +1040 -120
  19. package/dist/browser-runtime.js.map +4 -4
  20. package/dist/carp-catalog.d.ts +1 -0
  21. package/dist/carp-catalog.d.ts.map +1 -1
  22. package/dist/carp-catalog.js +34 -0
  23. package/dist/carp-catalog.js.map +4 -4
  24. package/dist/catalog-fec-params.js.map +1 -1
  25. package/dist/catalog-network-source.d.ts +1 -17
  26. package/dist/catalog-network-source.d.ts.map +1 -1
  27. package/dist/catalog-network-source.js +25 -19
  28. package/dist/catalog-network-source.js.map +3 -3
  29. package/dist/cmaf-block-assembler.d.ts +10 -2
  30. package/dist/cmaf-block-assembler.d.ts.map +1 -1
  31. package/dist/cmaf-block-assembler.js +30 -8
  32. package/dist/cmaf-block-assembler.js.map +3 -3
  33. package/dist/codec-utils.d.ts.map +1 -1
  34. package/dist/codec-utils.js +16 -3
  35. package/dist/codec-utils.js.map +2 -2
  36. package/dist/conceal-timeline.d.ts +24 -1
  37. package/dist/conceal-timeline.d.ts.map +1 -1
  38. package/dist/conceal-timeline.js +201 -4
  39. package/dist/conceal-timeline.js.map +3 -3
  40. package/dist/datagram-leg-deadline.d.ts +26 -2
  41. package/dist/datagram-leg-deadline.d.ts.map +1 -1
  42. package/dist/datagram-leg-deadline.js +14 -2
  43. package/dist/datagram-leg-deadline.js.map +2 -2
  44. package/dist/event-timeline-mmtp.d.ts +17 -0
  45. package/dist/event-timeline-mmtp.d.ts.map +1 -0
  46. package/dist/event-timeline-mmtp.js +3117 -0
  47. package/dist/event-timeline-mmtp.js.map +7 -0
  48. package/dist/fec-manager.d.ts +24 -3
  49. package/dist/fec-manager.d.ts.map +1 -1
  50. package/dist/fec-manager.js +531 -38
  51. package/dist/fec-manager.js.map +2 -2
  52. package/dist/feed-gate.d.ts +114 -0
  53. package/dist/feed-gate.d.ts.map +1 -0
  54. package/dist/feed-gate.js +175 -0
  55. package/dist/feed-gate.js.map +7 -0
  56. package/dist/index.d.ts +4 -3
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +16 -2
  59. package/dist/index.js.map +2 -2
  60. package/dist/iso-bmff-timing.d.ts +16 -0
  61. package/dist/iso-bmff-timing.d.ts.map +1 -1
  62. package/dist/iso-bmff-timing.js +28 -0
  63. package/dist/iso-bmff-timing.js.map +2 -2
  64. package/dist/mfu-reassembler.d.ts +2 -0
  65. package/dist/mfu-reassembler.d.ts.map +1 -1
  66. package/dist/mfu-reassembler.js +4 -2
  67. package/dist/mfu-reassembler.js.map +2 -2
  68. package/dist/mmtp-container-parser.d.ts +12 -0
  69. package/dist/mmtp-container-parser.d.ts.map +1 -1
  70. package/dist/mmtp-container-parser.js +73 -3
  71. package/dist/mmtp-container-parser.js.map +2 -2
  72. package/dist/mmtp-container-parser.no-modules.js +103 -25
  73. package/dist/mmtp-container-parser.no-modules.js.map +4 -4
  74. package/dist/mmtp-decode-pipeline.js +73 -3
  75. package/dist/mmtp-decode-pipeline.js.map +2 -2
  76. package/dist/mmtp-router.d.ts +20 -2
  77. package/dist/mmtp-router.d.ts.map +1 -1
  78. package/dist/mmtp-router.js +150 -23
  79. package/dist/mmtp-router.js.map +3 -3
  80. package/dist/multicast-auth-catalog.js.map +1 -1
  81. package/dist/multicast-input.js.map +1 -1
  82. package/dist/multicast-manager.d.ts +23 -2
  83. package/dist/multicast-manager.d.ts.map +1 -1
  84. package/dist/multicast-manager.js +737 -86
  85. package/dist/multicast-manager.js.map +3 -3
  86. package/dist/multicast-transport.js +44 -22
  87. package/dist/multicast-transport.js.map +2 -2
  88. package/dist/no-modules.js +98 -22
  89. package/dist/no-modules.js.map +4 -4
  90. package/dist/repair-fetch.d.ts +15 -7
  91. package/dist/repair-fetch.d.ts.map +1 -1
  92. package/dist/repair-fetch.js +34 -7
  93. package/dist/repair-fetch.js.map +2 -2
  94. package/dist/wasm-mfu-reassembler.js.map +2 -2
  95. package/dist/wasm-mmtp-container-parser.js +73 -3
  96. package/dist/wasm-mmtp-container-parser.js.map +2 -2
  97. package/package.json +17 -5
  98. package/schemas/catalog.schema.json +7 -2
  99. package/src/ad-creative-record.ts +276 -0
  100. package/src/ad-creative-timeline.ts +409 -0
  101. package/src/block-policy.ts +673 -42
  102. package/src/carp-catalog.ts +9 -0
  103. package/src/catalog-network-source.ts +3 -37
  104. package/src/cmaf-block-assembler.ts +17 -0
  105. package/src/codec-utils.ts +19 -3
  106. package/src/conceal-timeline.ts +60 -5
  107. package/src/datagram-leg-deadline.ts +34 -2
  108. package/src/event-timeline-mmtp.ts +55 -0
  109. package/src/fec-manager.ts +84 -12
  110. package/src/feed-gate.ts +295 -0
  111. package/src/index.ts +22 -0
  112. package/src/iso-bmff-timing.ts +33 -0
  113. package/src/mfu-reassembler.ts +4 -0
  114. package/src/mmtp-container-parser.ts +51 -5
  115. package/src/mmtp-router.ts +116 -4
  116. package/src/multicast-manager.ts +31 -0
  117. package/src/repair-fetch.ts +70 -19
  118. package/test-vectors/catalog/README.md +1 -0
  119. package/test-vectors/catalog/negative/event-timeline-empty-event-type.json +41 -0
  120. package/test-vectors/catalog/positive/event-timeline-ad-creative.json +41 -0
  121. package/test-vectors/catalog/positive/event-timeline-wallclock-no-depends.json +38 -0
  122. package/test-vectors/catalog/positive/multicast-event-timeline.json +81 -0
  123. package/test-vectors/catalog/section-codes.json +1 -0
  124. package/test-vectors/catalog-timing.json +184 -1
  125. package/test-vectors/frame-needs-v1.json +295 -0
  126. package/test-vectors/repair-policy-v1.json +98 -18
@@ -1,45 +1,44 @@
1
1
  {
2
- "version": 1,
3
- "description": "Receiver repair policy (draft-ramadan-moq-fec-01 Section 11.4.2 and Section 11.4.5 item 3, Blockcast/moqcast-draft PR #2 @ 3162ef93). Which repair FETCHes a receiver sends, which it cancels, and which it never sends. Hand-authored from the specification, NOT generated by any implementation (BLO-49776).",
2
+ "version": 3,
3
+ "description": "Receiver repair policy (draft-ramadan-moq-fec-multicast-01 Section 6.2.1 at Blockcast/moqcast-draft main 6293fff (PR #29), which narrows fec-01 Section 11.4.2, and fec-01 Section 11.4.5 item 3, Blockcast/moqcast-draft PR #2 @ 3162ef93). Which repair FETCHes a receiver sends, which it cancels, and which it never sends. Hand-authored from the specification, NOT generated by any implementation (BLO-49776; version 2: BLO-51662; version 3: BLO-56030).",
4
4
  "scope": [
5
5
  "Section 11.4 applies only to a multicast or AMT leg with a MoQ session (fec-01 11.4). These cases describe that leg; a receiver with no repair FETCH path records ABSENT, not a pass.",
6
6
  "schedulerCases drive a repair scheduler. Every block spans K' = 4 SS_IDs, so block B covers SS_IDs B..B+3. Track video is a source track (packetId 1, keyframe or delta blocks); track audio is packetId 2 (audio blocks). A block is named track/SS_Start.",
7
7
  "Best-effort (delta and audio) requests in schedulerCases are presumed covered by unexpired credit under fec-01 11.4.5 item 2; that credit is a precondition of each case, not something the case exercises.",
8
- "A RAP 'held complete at ssId' is a keyframe access unit at SS_ID ssId that the receiver holds complete: admitted complete under the multicast-01 7.2.7 profile, received or recovered complete outside it. A block lies below it when the block's last SS_ID is less than ssId; a RAP at or inside the block does not make the block moot.",
8
+ "A RAP 'held complete at ssId' is a keyframe access unit at SS_ID ssId that the receiver has admitted complete (fec-multicast-01 6.2.1 condition 1). A block lies below it when the block's last SS_ID is less than ssId; a RAP at or inside the block does not make the block moot.",
9
+ "fec-multicast-01 6.2.1 condition 2: a keyframe repair is moot only when it also cannot arrive by the block's playout deadline, which is the later of the block's FEC deadline and the presentation time of the earliest media the block would repair, and excludes the keyframe-budget hold (the time a receiver holds video presentation for the repair). It cannot arrive when the current time is not earlier than that deadline, or T + RTT is not earlier than it (T: the FETCH's send time, or now for a repair not yet requested; RTT: the receiver's current round-trip estimate for the repair connection), or the receiver has no RTT estimate.",
10
+ "Every schedulerCase names its regime, which fixes RTT and deadlines; the clock starts at 0 when the case starts and every block's media is anchored at the time its request is made. 'playout': RTT 1 ms, playout deadline 1 s after the request, keyframe-budget hold to 5 s, so every repair lands by playout. 'budget': RTT 2 s and the same 1 s playout deadline and 5 s hold for blocks below SS_ID 16, so a repair of such a block can only land within the hold; blocks from SS_ID 16 up are anchored 2 s later and land by playout. 'rtt-unmeasured': the 'playout' regime with no RTT estimate. Op 'clock' moves the clock, and the receiver acts on whatever falls due by then: at 'arrival-cutoff' (999.5 ms) a repair sent at 0 still lands by its playout deadline but one requested now would not; at 'playout-deadline' (1 s) the playout deadline of a block requested at 0 has passed.",
9
11
  "fetched lists every FETCH the receiver sends, in order. cancelled lists every sent FETCH it then cancels (FETCH_CANCEL on the wire). skipped names requests made but not sent, with the receiver's reason; stopped names sent FETCHes stopped, with the stop reason. A list not given is expected empty.",
10
12
  "assistedCases drive one block of a protected flow (multicast-01 7.2.7) that is one symbol short of SSB_length, with unlisted repair symbols pooled for it. Each unlisted symbol triggers one unlisted-assisted decode in a scratch decoder; outcome 'fail' is a failed decode, 'recover' a decode whose recovered data unit admission accepts, 'recover-unadmitted' a decode whose recovered data unit admission refuses.",
11
- "status names where a case's rule comes from: 'fec-01' is a -01 requirement; 'libmmt interpretation' is our reading where -01 is silent; 'regression' rows were already required at moqcast-draft main 615a9a8 and are kept to pin standing behaviour.",
13
+ "status names where a case's rule comes from: 'fec-01' is a -01 requirement; 'fec-multicast-01' is the 6.2.1 narrowing (moqcast-draft main 6293fff); 'libmmt interpretation' is our reading where the draft is silent; 'regression' rows were already required at moqcast-draft main 615a9a8 and are kept to pin standing behaviour.",
12
14
  "A keyframe request refused before its FETCH is sent (libmmt's reliable-path RTT check) is libmmt-local and deviates from the fec-01 11.4.2 MUST, so it is pinned in libmmt's own suite (repair-fetch-keyframe-budget.test.ts), not here. The 11.4.5 item 3 rule that a block 11.4.2 does not request cancels nothing is exercised by keyframe-below-complete-rap-not-requested."
13
15
  ],
14
16
  "schedulerCases": [
15
17
  {
16
18
  "name": "keyframe-below-complete-rap-not-requested",
17
19
  "status": "fec-01",
18
- "rule": "fec-01 11.4.2: a keyframe-bearing block at its FEC deadline is requested unless it lies below a RAP already held complete; 11.4.5 item 3: a block whose repair 11.4.2 does not request cancels nothing (case a).",
20
+ "regime": "budget",
21
+ "rule": "fec-01 11.4.2: a keyframe-bearing block at its FEC deadline is requested unless it lies below a RAP already held complete; 11.4.5 item 3: a block whose repair 11.4.2 does not request cancels nothing (case a). Under fec-multicast-01 6.2.1 that holds only for a repair that cannot arrive by playout, hence the budget regime.",
19
22
  "ops": [
20
23
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
21
24
  { "op": "rapHeld", "ssId": 4 },
22
25
  { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }
23
26
  ],
24
- "expect": {
25
- "fetched": ["video/20"],
26
- "skipped": [{ "block": "video/0", "reason": "moot-rap" }]
27
- }
27
+ "expect": { "fetched": ["video/20"], "skipped": [{ "block": "video/0", "reason": "moot-rap" }] }
28
28
  },
29
29
  {
30
30
  "name": "control-rap-inside-block-is-requested",
31
31
  "status": "libmmt interpretation",
32
+ "regime": "playout",
32
33
  "rule": "Control for the case above. fec-01 does not define 'lies below'; libmmt reads it so that a RAP at the block's own last SS_ID is part of the block, so the block is not below it and is requested.",
33
- "ops": [
34
- { "op": "rapHeld", "ssId": 3 },
35
- { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }
36
- ],
34
+ "ops": [{ "op": "rapHeld", "ssId": 3 }, { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }],
37
35
  "expect": { "fetched": ["video/0"] }
38
36
  },
39
37
  {
40
38
  "name": "rap-completes-mid-fetch-cancels",
41
39
  "status": "regression",
42
- "rule": "fec-01 11.4.2 (already a SHOULD at main 615a9a8): a RAP completing while a keyframe repair is outstanding makes that repair moot and the receiver cancels it; a block above the RAP keeps its FETCH (case b).",
40
+ "regime": "budget",
41
+ "rule": "fec-01 11.4.2 (already a SHOULD at main 615a9a8): a RAP completing while a keyframe repair is outstanding makes that repair moot and the receiver cancels it; a block above the RAP keeps its FETCH (case b). Under fec-multicast-01 6.2.1 that holds only for a repair that cannot arrive by playout, hence the budget regime.",
43
42
  "ops": [
44
43
  { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
45
44
  { "op": "fire", "track": "video", "block": 8, "class": "keyframe" },
@@ -54,6 +53,7 @@
54
53
  {
55
54
  "name": "audio-request-preempts-nothing",
56
55
  "status": "fec-01",
56
+ "regime": "playout",
57
57
  "rule": "fec-01 11.4.5 item 3: only the keyframe repair 11.4.2 requests cancels best-effort FETCHes; an audio request cancels nothing.",
58
58
  "ops": [
59
59
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
@@ -64,6 +64,7 @@
64
64
  {
65
65
  "name": "sent-keyframe-repair-cancels-delta-and-audio",
66
66
  "status": "regression",
67
+ "regime": "playout",
67
68
  "rule": "fec-01 11.4.5 item 3 (standing at main 615a9a8): a keyframe repair FETCH that is sent cancels the outstanding delta and audio FETCHes (case c-pos).",
68
69
  "ops": [
69
70
  { "op": "fire", "track": "video", "block": 20, "class": "delta" },
@@ -73,11 +74,90 @@
73
74
  "expect": {
74
75
  "fetched": ["video/20", "audio/0", "video/40"],
75
76
  "cancelled": ["video/20", "audio/0"],
76
- "stopped": [
77
- { "block": "video/20", "reason": "preempted" },
78
- { "block": "audio/0", "reason": "preempted" }
79
- ]
77
+ "stopped": [{ "block": "video/20", "reason": "preempted" }, { "block": "audio/0", "reason": "preempted" }]
78
+ }
79
+ },
80
+ {
81
+ "name": "keyframe-repair-landing-by-playout-kept",
82
+ "status": "fec-multicast-01",
83
+ "regime": "playout",
84
+ "rule": "fec-multicast-01 6.2.1: a keyframe repair that can arrive by its playout deadline is not moot, so it is requested below a RAP held complete and kept when a newer RAP completes.",
85
+ "ops": [
86
+ { "op": "rapHeld", "ssId": 4 },
87
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
88
+ { "op": "fire", "track": "video", "block": 8, "class": "keyframe" },
89
+ { "op": "rapComplete", "ssId": 9 }
90
+ ],
91
+ "expect": { "fetched": ["video/0", "video/8"] }
92
+ },
93
+ {
94
+ "name": "sent-fetch-judged-at-send-time",
95
+ "status": "fec-multicast-01",
96
+ "regime": "playout",
97
+ "rule": "fec-multicast-01 6.2.1: a FETCH already sent is judged by the time it was sent; sent at 0 with a 1 ms RTT it lands by the 1 s playout deadline, so a RAP completing at 999.5 ms does not cancel it.",
98
+ "ops": [
99
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
100
+ { "op": "clock", "at": "arrival-cutoff" },
101
+ { "op": "rapComplete", "ssId": 5 }
102
+ ],
103
+ "expect": { "fetched": ["video/0"] }
104
+ },
105
+ {
106
+ "name": "outstanding-repair-past-playout-deadline-cancels",
107
+ "status": "fec-multicast-01",
108
+ "regime": "playout",
109
+ "rule": "fec-multicast-01 6.2.1: once the playout deadline has passed, a newer RAP the receiver has admitted complete makes an outstanding repair moot and the receiver cancels it, however early it was sent.",
110
+ "ops": [
111
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
112
+ { "op": "clock", "at": "playout-deadline" },
113
+ { "op": "rapComplete", "ssId": 5 }
114
+ ],
115
+ "expect": {
116
+ "fetched": ["video/0"],
117
+ "cancelled": ["video/0"],
118
+ "stopped": [{ "block": "video/0", "reason": "moot" }]
119
+ }
120
+ },
121
+ {
122
+ "name": "outstanding-repair-moot-at-playout-deadline",
123
+ "status": "fec-multicast-01",
124
+ "regime": "playout",
125
+ "rule": "fec-multicast-01 6.2.1 defines moot as a state (condition 1: a RAP already admitted complete), not as the event of a RAP being admitted. A RAP admitted complete at 999.5 ms keeps a repair sent at 0 that lands by playout; when the playout deadline passes with that RAP still held complete, the repair is moot from then on, with no newer RAP, and the receiver cancels it at that deadline.",
126
+ "ops": [
127
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
128
+ { "op": "clock", "at": "arrival-cutoff" },
129
+ { "op": "rapComplete", "ssId": 5 },
130
+ { "op": "clock", "at": "playout-deadline" }
131
+ ],
132
+ "expect": {
133
+ "fetched": ["video/0"],
134
+ "cancelled": ["video/0"],
135
+ "stopped": [{ "block": "video/0", "reason": "moot" }]
80
136
  }
137
+ },
138
+ {
139
+ "name": "repair-below-held-rap-moot-at-playout-deadline",
140
+ "status": "fec-multicast-01",
141
+ "regime": "playout",
142
+ "rule": "fec-multicast-01 6.2.1: a keyframe repair requested below a RAP already held complete is sent while it can land by playout, and is moot once that deadline passes with the RAP still held, so the receiver cancels it at that deadline.",
143
+ "ops": [
144
+ { "op": "rapHeld", "ssId": 4 },
145
+ { "op": "fire", "track": "video", "block": 0, "class": "keyframe" },
146
+ { "op": "clock", "at": "playout-deadline" }
147
+ ],
148
+ "expect": {
149
+ "fetched": ["video/0"],
150
+ "cancelled": ["video/0"],
151
+ "stopped": [{ "block": "video/0", "reason": "moot" }]
152
+ }
153
+ },
154
+ {
155
+ "name": "rtt-unmeasured-keyframe-below-complete-rap-is-moot",
156
+ "status": "fec-multicast-01",
157
+ "regime": "rtt-unmeasured",
158
+ "rule": "fec-multicast-01 6.2.1: a receiver with no RTT estimate treats the repair as unable to arrive by the playout deadline, so a keyframe block below a RAP held complete is moot.",
159
+ "ops": [{ "op": "rapHeld", "ssId": 4 }, { "op": "fire", "track": "video", "block": 0, "class": "keyframe" }],
160
+ "expect": { "skipped": [{ "block": "video/0", "reason": "moot-rap" }] }
81
161
  }
82
162
  ],
83
163
  "assistedCases": [