@blockcast/mmt-wasm 0.3.0 → 0.4.0-main.1d3ea1cc8ff2
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/package.json +38 -38
- package/pkg/mmt_wasm.d.ts +77 -83
- package/pkg/mmt_wasm.js +126 -107
- package/pkg/mmt_wasm_bg.wasm +0 -0
- package/pkg/mmt_wasm_bg.wasm.d.ts +10 -7
- package/pkg-no-modules/mmt_wasm.d.ts +77 -83
- package/pkg-no-modules/mmt_wasm.js +126 -107
- package/pkg-no-modules/mmt_wasm_bg.wasm +0 -0
- package/pkg-no-modules/mmt_wasm_bg.wasm.d.ts +10 -7
|
@@ -46,6 +46,12 @@ declare namespace wasm_bindgen {
|
|
|
46
46
|
* Blocks that expired with fewer than K symbols (delivery issue, not FEC issue)
|
|
47
47
|
*/
|
|
48
48
|
blocks_delivery_failed: bigint;
|
|
49
|
+
/**
|
|
50
|
+
* `iso-ssbg1-v1` held sources evicted, oldest arrival first, because the
|
|
51
|
+
* unplaced pool was at its `(interleave_depth + 1) * K` cap: no sweep
|
|
52
|
+
* (`cleanup_by_ss_start` / `retire_unplaced`) retired them first.
|
|
53
|
+
*/
|
|
54
|
+
unplaced_evicted: bigint;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
export class MfuFragmentJs {
|
|
@@ -101,27 +107,15 @@ declare namespace wasm_bindgen {
|
|
|
101
107
|
/**
|
|
102
108
|
* Add a repair symbol per ISO 23008-1 §C.5.3.
|
|
103
109
|
*
|
|
104
|
-
* Repair carries (SS_Start, SSB_length, RS_ID).
|
|
105
|
-
* SS_Start
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* (fec-raptorq `InterleavedEncoder::force_complete`). The block records
|
|
114
|
-
* `SSB_length`, completes once that many source symbols arrived, and
|
|
115
|
-
* recovers from `SSB_length` received symbols by supplying the known
|
|
116
|
-
* padding itself. A conflicting `SSB_length` for one block is rejected
|
|
117
|
-
* without changing that block.
|
|
118
|
-
*
|
|
119
|
-
* Under `iso-ssbg1-v1` the block is `[SS_Start, SS_Start + SSB_length)`
|
|
120
|
-
* with `1 <= SSB_length <= K` (K is only the maximum), its RaptorQ geometry
|
|
121
|
-
* is K' = SSB_length with no padding, and repair ESI = SSB_length + RS_ID
|
|
122
|
-
* (C.5.3). The first repair defines the block and claims every held source
|
|
123
|
-
* in range. A conflicting SSB_length, or a range overlapping a different
|
|
124
|
-
* known block, is refused without changing any block. Output is the K'*T
|
|
110
|
+
* Repair carries (SS_Start, SSB_length, RS_ID). The block is
|
|
111
|
+
* `[SS_Start, SS_Start + SSB_length)` with `1 <= SSB_length <= K` (the
|
|
112
|
+
* configured K is only the maximum), its RaptorQ geometry is
|
|
113
|
+
* K' = SSB_length with no padding, and repair ESI = SSB_length + RS_ID.
|
|
114
|
+
* The first repair defines the block and claims every held source in
|
|
115
|
+
* range. A conflicting SSB_length, a range overlapping a different known
|
|
116
|
+
* block, or a start more than `interleave_depth` blocks behind the last
|
|
117
|
+
* `cleanup_by_ss_start`'s `current` (`iso_blocks_behind_lower_bound`), is
|
|
118
|
+
* refused without changing any block. Output is the K'*T
|
|
125
119
|
* concatenated ssbg_mode1 symbols: split by T and trim by the length field.
|
|
126
120
|
*/
|
|
127
121
|
add_repair(ss_start: number, ssb_length: number, rs_id: number, data: Uint8Array, timestamp: number): Uint8Array | undefined;
|
|
@@ -131,13 +125,12 @@ declare namespace wasm_bindgen {
|
|
|
131
125
|
* SS_ID is a flat 32-bit counter. An unconfigured decoder rejects the
|
|
132
126
|
* packet.
|
|
133
127
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* whose block no repair has defined yet is held by SS_ID until one does.
|
|
128
|
+
* Builds the C.3.3 ssbg_mode1 symbol `u16be(len) || data || zero padding`
|
|
129
|
+
* (refusing `len + 2 > T`) and places it at ESI = serial distance from the
|
|
130
|
+
* start of the known block whose `[SS_Start, SS_Start + SSB_length)`
|
|
131
|
+
* contains SS_ID. A source whose block no repair has defined yet is held
|
|
132
|
+
* by SS_ID until one does; at most `(interleave_depth + 1) * K` are held, and
|
|
133
|
+
* the oldest arrival is evicted first (`FecStats::unplaced_evicted`).
|
|
141
134
|
*
|
|
142
135
|
* # Arguments
|
|
143
136
|
* * `ss_id` - Source symbol ID (32-bit monotonic counter)
|
|
@@ -150,21 +143,13 @@ declare namespace wasm_bindgen {
|
|
|
150
143
|
*/
|
|
151
144
|
reset_stats(): void;
|
|
152
145
|
/**
|
|
153
|
-
*
|
|
146
|
+
* The `fec.algorithm` token this decoder was built for.
|
|
154
147
|
*/
|
|
155
|
-
|
|
148
|
+
get_algorithm(): string;
|
|
156
149
|
/**
|
|
157
|
-
*
|
|
158
|
-
* behind `current_sbn`. Refused under `iso-ssbg1-v1`, which has no SBN
|
|
159
|
-
* (use `cleanup_by_ss_start`).
|
|
160
|
-
*
|
|
161
|
-
* Blocks are ordered by RFC 1982 serial comparison of their first SS_ID
|
|
162
|
-
* (`sbn * K mod 2^32`, ISO/IEC 23008-1 C.5.2; BLO-35597 iso:5). For a
|
|
163
|
-
* stream that has not wrapped SS_ID that is exactly the old
|
|
164
|
-
* `sbn < current_sbn - interleave_depth`; after the wrap it still retires
|
|
165
|
-
* the pre-wrap blocks instead of keeping them forever.
|
|
150
|
+
* Get alignment (Al) parameter from OTI
|
|
166
151
|
*/
|
|
167
|
-
|
|
152
|
+
get_alignment(): number;
|
|
168
153
|
/**
|
|
169
154
|
* Get sub-blocks (N) parameter from OTI
|
|
170
155
|
*/
|
|
@@ -178,11 +163,11 @@ declare namespace wasm_bindgen {
|
|
|
178
163
|
*/
|
|
179
164
|
get_symbol_size(): number;
|
|
180
165
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
166
|
+
* Retire the held source symbols that no repair can place any more, by
|
|
167
|
+
* the same rule as `cleanup_by_ss_start`, without retiring any block. For
|
|
168
|
+
* a caller that retires blocks itself, by their deadlines
|
|
169
|
+
* (`cleanup_blocks_detailed`), and needs only this half. Returns how many
|
|
170
|
+
* it retired.
|
|
186
171
|
*/
|
|
187
172
|
retire_unplaced(current: number): number;
|
|
188
173
|
/**
|
|
@@ -202,11 +187,11 @@ declare namespace wasm_bindgen {
|
|
|
202
187
|
*/
|
|
203
188
|
get_source_blocks(): number;
|
|
204
189
|
/**
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
190
|
+
* Retire every block, and every held source symbol, lying more than
|
|
191
|
+
* `interleave_depth` blocks behind SS_ID `current`, the newest SS_ID the
|
|
192
|
+
* caller has seen (no block start or held source follows it). A block
|
|
193
|
+
* start or held source that `current` has moved at least half the SS_ID
|
|
194
|
+
* space past no longer precedes it and is retired too
|
|
210
195
|
* (`iso_past_horizon`).
|
|
211
196
|
*
|
|
212
197
|
* Blocks have no SBN under ssbg_mode1, so distance is measured on the
|
|
@@ -222,23 +207,25 @@ declare namespace wasm_bindgen {
|
|
|
222
207
|
*/
|
|
223
208
|
get_interleave_depth(): number;
|
|
224
209
|
/**
|
|
225
|
-
* Finalize only the source blocks whose host-owned deadlines fired
|
|
226
|
-
*
|
|
210
|
+
* Finalize only the source blocks whose host-owned deadlines fired,
|
|
211
|
+
* named by their SS_Starts.
|
|
227
212
|
*
|
|
228
213
|
* The JavaScript FEC manager owns per-block repair grace. A timeout for one
|
|
229
214
|
* block must therefore not run the decoder's global age scan and evict a
|
|
230
215
|
* peer block that is still waiting for fetched repair.
|
|
231
216
|
*/
|
|
232
|
-
cleanup_blocks_detailed(
|
|
217
|
+
cleanup_blocks_detailed(ss_starts: Uint32Array): void;
|
|
233
218
|
/**
|
|
234
219
|
* Create a new FEC decoder
|
|
235
220
|
*
|
|
236
221
|
* # Arguments
|
|
237
222
|
* * `interleave_depth` - Explicit positive number of interleaved blocks.
|
|
238
|
-
* * `block_profile` - Catalog `fec.blockProfile`: `"
|
|
239
|
-
*
|
|
223
|
+
* * `block_profile` - Catalog `fec.blockProfile`: `"iso-ssbg1-v1"`.
|
|
224
|
+
* Required; any other value is refused.
|
|
225
|
+
* * `algorithm` - Catalog `fec.algorithm`: `"raptorq"` (the default when
|
|
226
|
+
* omitted) or `"reed-solomon"`; any other value is refused.
|
|
240
227
|
*/
|
|
241
|
-
constructor(interleave_depth: number, block_profile: string);
|
|
228
|
+
constructor(interleave_depth: number, block_profile: string, algorithm?: string | null);
|
|
242
229
|
/**
|
|
243
230
|
* Flush all pending decoder state while preserving configuration.
|
|
244
231
|
*/
|
|
@@ -251,7 +238,8 @@ declare namespace wasm_bindgen {
|
|
|
251
238
|
* Configure FEC from 12-byte OTI
|
|
252
239
|
*
|
|
253
240
|
* # Arguments
|
|
254
|
-
* * `oti` - 12-byte
|
|
241
|
+
* * `oti` - 12-byte RFC 6330 Common FEC OTI: decoder geometry per
|
|
242
|
+
* draft-fec-01 Section 4.2 (Z = 1, N = 1, Al = 8)
|
|
255
243
|
*/
|
|
256
244
|
configure(oti: Uint8Array): void;
|
|
257
245
|
/**
|
|
@@ -271,41 +259,40 @@ declare namespace wasm_bindgen {
|
|
|
271
259
|
* `[SS_Start:4][RSB_length:3][RS_ID:3][SSB_length:3][symbol: T]`.
|
|
272
260
|
* Callers split on that stride; `entry i` is at `i * (13 + T)`.
|
|
273
261
|
*
|
|
274
|
-
* `
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* `iso-ssbg1-v1`: `block` is the SS_Start (the block's first SS_ID) and
|
|
280
|
-
* `source_block` is the block's K' ssbg_mode1 symbols (`1 <= K' <= K`,
|
|
281
|
-
* `len % T == 0`, each a well-formed C.3.3 symbol). RaptorQ runs over K'
|
|
282
|
-
* symbols (F = K'*T) and `SSB_length = K'`.
|
|
262
|
+
* `ss_start` is the block's first SS_ID and `source_block` is the
|
|
263
|
+
* block's K' ssbg_mode1 symbols (`1 <= K' <= K`, `len % T == 0`, each a
|
|
264
|
+
* well-formed C.3.3 symbol). RaptorQ runs over K' symbols (F = K'*T) and
|
|
265
|
+
* `SSB_length = K'`.
|
|
283
266
|
*
|
|
284
267
|
* # Arguments
|
|
285
|
-
* * `
|
|
268
|
+
* * `ss_start` - SS_Start: the block's first SS_ID.
|
|
286
269
|
* * `source_block` - The block's source symbols, as described above.
|
|
287
270
|
* * `repair_count` - Number of repair symbols (P) to generate.
|
|
288
271
|
*/
|
|
289
|
-
encode_repair(
|
|
272
|
+
encode_repair(ss_start: number, source_block: Uint8Array, repair_count: number): Uint8Array;
|
|
290
273
|
/**
|
|
291
274
|
* Create an encoder for a fixed `(K, symbol_size)` block geometry.
|
|
292
275
|
*
|
|
293
276
|
* Builds the OTI as `ObjectTransmissionInformation::new(K*T, T, 1, 1, 8)`
|
|
294
|
-
* (single source block, single sub-block, byte alignment) —
|
|
295
|
-
*
|
|
296
|
-
*
|
|
277
|
+
* (single source block, single sub-block, byte alignment) — the geometry
|
|
278
|
+
* [`MmtFecDecoder::configure`] reads back. K is the maximum SSB_length;
|
|
279
|
+
* each block is encoded over its own K' symbols (see
|
|
280
|
+
* [`MmtFecEncoder::encode_repair`]).
|
|
281
|
+
*
|
|
282
|
+
* `block_profile` is the catalog `fec.blockProfile` (`"iso-ssbg1-v1"`);
|
|
283
|
+
* any other value is refused.
|
|
297
284
|
*
|
|
298
|
-
* `
|
|
299
|
-
* `"
|
|
300
|
-
* is the maximum SSB_length.
|
|
285
|
+
* `algorithm` is the catalog `fec.algorithm`: `"raptorq"` (the default
|
|
286
|
+
* when omitted) or `"reed-solomon"` (K + P <= 255 per block).
|
|
301
287
|
*/
|
|
302
|
-
constructor(k: number, symbol_size: number, block_profile: string);
|
|
288
|
+
constructor(k: number, symbol_size: number, block_profile: string, algorithm?: string | null);
|
|
303
289
|
/**
|
|
304
290
|
* The configured 12-byte OTI (RFC 6330 §3.3.2 Common FEC OTI).
|
|
305
291
|
*
|
|
306
292
|
* Publishers (BLO-8975 / BLO-8990 catalog-gen) emit this so the player's
|
|
307
293
|
* [`MmtFecDecoder::configure`] reconstructs identical block geometry. The
|
|
308
|
-
* bytes round-trip exactly through `OtiParams::from_bytes`.
|
|
294
|
+
* bytes round-trip exactly through `OtiParams::from_bytes`. Empty under
|
|
295
|
+
* `reed-solomon`, which has no OTI.
|
|
309
296
|
*/
|
|
310
297
|
oti(): Uint8Array;
|
|
311
298
|
/**
|
|
@@ -320,6 +307,10 @@ declare namespace wasm_bindgen {
|
|
|
320
307
|
* Source symbols per block (K).
|
|
321
308
|
*/
|
|
322
309
|
readonly k: number;
|
|
310
|
+
/**
|
|
311
|
+
* The `fec.algorithm` token this encoder was built for.
|
|
312
|
+
*/
|
|
313
|
+
readonly algorithm: string;
|
|
323
314
|
}
|
|
324
315
|
|
|
325
316
|
/**
|
|
@@ -811,7 +802,7 @@ declare interface InitOutput {
|
|
|
811
802
|
readonly __wbg_get_fecstats_bytes_recovered: (a: number) => bigint;
|
|
812
803
|
readonly __wbg_get_fecstats_repair_packets: (a: number) => bigint;
|
|
813
804
|
readonly __wbg_get_fecstats_source_packets: (a: number) => bigint;
|
|
814
|
-
readonly
|
|
805
|
+
readonly __wbg_get_fecstats_unplaced_evicted: (a: number) => bigint;
|
|
815
806
|
readonly __wbg_mfufragmentjs_free: (a: number, b: number) => void;
|
|
816
807
|
readonly __wbg_mmtfecdecoder_free: (a: number, b: number) => void;
|
|
817
808
|
readonly __wbg_mmtfecencoder_free: (a: number, b: number) => void;
|
|
@@ -824,9 +815,7 @@ declare interface InitOutput {
|
|
|
824
815
|
readonly __wbg_moqfecencoder_free: (a: number, b: number) => void;
|
|
825
816
|
readonly __wbg_moqfecstatsjs_free: (a: number, b: number) => void;
|
|
826
817
|
readonly __wbg_reassembledmfujs_free: (a: number, b: number) => void;
|
|
827
|
-
readonly __wbg_reassemblerstatsjs_free: (a: number, b: number) => void;
|
|
828
818
|
readonly __wbg_recoveredset_free: (a: number, b: number) => void;
|
|
829
|
-
readonly __wbg_samplecombinerstatsjs_free: (a: number, b: number) => void;
|
|
830
819
|
readonly __wbg_set_fecstats_blocks_complete: (a: number, b: bigint) => void;
|
|
831
820
|
readonly __wbg_set_fecstats_blocks_delivery_failed: (a: number, b: bigint) => void;
|
|
832
821
|
readonly __wbg_set_fecstats_blocks_failed: (a: number, b: bigint) => void;
|
|
@@ -834,7 +823,7 @@ declare interface InitOutput {
|
|
|
834
823
|
readonly __wbg_set_fecstats_bytes_recovered: (a: number, b: bigint) => void;
|
|
835
824
|
readonly __wbg_set_fecstats_repair_packets: (a: number, b: bigint) => void;
|
|
836
825
|
readonly __wbg_set_fecstats_source_packets: (a: number, b: bigint) => void;
|
|
837
|
-
readonly
|
|
826
|
+
readonly __wbg_set_fecstats_unplaced_evicted: (a: number, b: bigint) => void;
|
|
838
827
|
readonly __wbg_shredfecbuffer_free: (a: number, b: number) => void;
|
|
839
828
|
readonly __wbg_shredreassembler_free: (a: number, b: number) => void;
|
|
840
829
|
readonly annexb_access_unit_is_keyframe: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -865,11 +854,11 @@ declare interface InitOutput {
|
|
|
865
854
|
readonly mmtfecdecoder_add_repair: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
866
855
|
readonly mmtfecdecoder_add_source: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
867
856
|
readonly mmtfecdecoder_cleanup_blocks_detailed: (a: number, b: number, c: number) => void;
|
|
868
|
-
readonly mmtfecdecoder_cleanup_by_sbn: (a: number, b: number) => [number, number, number, number];
|
|
869
857
|
readonly mmtfecdecoder_cleanup_by_ss_start: (a: number, b: number) => [number, number, number, number];
|
|
870
858
|
readonly mmtfecdecoder_configure: (a: number, b: number, c: number) => [number, number];
|
|
871
859
|
readonly mmtfecdecoder_configure_params: (a: number, b: number, c: number) => [number, number];
|
|
872
860
|
readonly mmtfecdecoder_flush: (a: number) => void;
|
|
861
|
+
readonly mmtfecdecoder_get_algorithm: (a: number) => [number, number];
|
|
873
862
|
readonly mmtfecdecoder_get_alignment: (a: number) => [number, number, number];
|
|
874
863
|
readonly mmtfecdecoder_get_block_profile: (a: number) => [number, number];
|
|
875
864
|
readonly mmtfecdecoder_get_interleave_depth: (a: number) => number;
|
|
@@ -878,14 +867,15 @@ declare interface InitOutput {
|
|
|
878
867
|
readonly mmtfecdecoder_get_stats: (a: number) => number;
|
|
879
868
|
readonly mmtfecdecoder_get_sub_blocks: (a: number) => [number, number, number];
|
|
880
869
|
readonly mmtfecdecoder_get_symbol_size: (a: number) => [number, number, number];
|
|
881
|
-
readonly mmtfecdecoder_new: (a: number, b: number, c: number) => [number, number, number];
|
|
870
|
+
readonly mmtfecdecoder_new: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
882
871
|
readonly mmtfecdecoder_pending_blocks: (a: number) => number;
|
|
883
872
|
readonly mmtfecdecoder_reset_stats: (a: number) => void;
|
|
884
873
|
readonly mmtfecdecoder_retire_unplaced: (a: number, b: number) => [number, number, number];
|
|
874
|
+
readonly mmtfecencoder_algorithm: (a: number) => [number, number];
|
|
885
875
|
readonly mmtfecencoder_block_profile: (a: number) => [number, number];
|
|
886
876
|
readonly mmtfecencoder_encode_repair: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
887
877
|
readonly mmtfecencoder_k: (a: number) => number;
|
|
888
|
-
readonly mmtfecencoder_new: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
878
|
+
readonly mmtfecencoder_new: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
889
879
|
readonly mmtfecencoder_oti: (a: number) => [number, number];
|
|
890
880
|
readonly mmtfecencoder_symbol_size: (a: number) => number;
|
|
891
881
|
readonly mmtpacketizer_build_mfu: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
@@ -978,6 +968,7 @@ declare interface InitOutput {
|
|
|
978
968
|
readonly moqfecstatsjs_blocksIncomplete: (a: number) => number;
|
|
979
969
|
readonly moqfecstatsjs_totalSymbolsReceived: (a: number) => number;
|
|
980
970
|
readonly shredreassembler_pending_fec_sets: (a: number) => number;
|
|
971
|
+
readonly __wbg_get_reassemblerstatsjs_ambiguous_fallback_fragments: (a: number) => bigint;
|
|
981
972
|
readonly __wbg_get_reassemblerstatsjs_duplicate_fragments: (a: number) => bigint;
|
|
982
973
|
readonly __wbg_get_reassemblerstatsjs_evicted_data_units: (a: number) => bigint;
|
|
983
974
|
readonly __wbg_get_reassemblerstatsjs_evicted_memory_limit: (a: number) => bigint;
|
|
@@ -989,6 +980,9 @@ declare interface InitOutput {
|
|
|
989
980
|
readonly __wbg_get_samplecombinerstatsjs_evicted_samples: (a: number) => bigint;
|
|
990
981
|
readonly __wbg_get_samplecombinerstatsjs_passthrough_samples: (a: number) => bigint;
|
|
991
982
|
readonly __wbg_get_samplecombinerstatsjs_timed_out_samples: (a: number) => bigint;
|
|
983
|
+
readonly __wbg_reassemblerstatsjs_free: (a: number, b: number) => void;
|
|
984
|
+
readonly __wbg_samplecombinerstatsjs_free: (a: number, b: number) => void;
|
|
985
|
+
readonly __wbg_set_reassemblerstatsjs_ambiguous_fallback_fragments: (a: number, b: bigint) => void;
|
|
992
986
|
readonly __wbg_set_reassemblerstatsjs_duplicate_fragments: (a: number, b: bigint) => void;
|
|
993
987
|
readonly __wbg_set_reassemblerstatsjs_evicted_data_units: (a: number, b: bigint) => void;
|
|
994
988
|
readonly __wbg_set_reassemblerstatsjs_evicted_memory_limit: (a: number, b: bigint) => void;
|