@blockcast/mmt-base 0.4.0-main.8a3b1baee573 → 0.4.0-main.8ff05f91d861
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.
|
@@ -52,8 +52,9 @@ export declare function isoBlockSpanUsable(fec: unknown): boolean;
|
|
|
52
52
|
* (draft-ramadan-moq-fec §5.1): the decision the container's
|
|
53
53
|
* `catalogFecUnavailable` explains with a typed reason.
|
|
54
54
|
*
|
|
55
|
-
* False when the block
|
|
56
|
-
*
|
|
55
|
+
* False when the block's `algorithm` is a token this receiver does not
|
|
56
|
+
* implement (`fecAlgorithmUnimplemented`); when it declares an FEC instance
|
|
57
|
+
* (any `algorithm` but `"none"`) and names no implemented `blockProfile` (the retired `k-padded-v1`
|
|
57
58
|
* included), or carries an `iso-ssbg1-v1` span it cannot use; and when a block
|
|
58
59
|
* declaring no FEC instance carries a profile token that is not implemented.
|
|
59
60
|
* True for a non-object and for every other block. It reads only the profile
|
|
@@ -64,6 +65,14 @@ export declare function isoBlockSpanUsable(fec: unknown): boolean;
|
|
|
64
65
|
* none of its repair tracks, without failing the session.
|
|
65
66
|
*/
|
|
66
67
|
export declare function catalogFecAvailable(fec: unknown): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether `algorithm` is a token this receiver does not implement
|
|
70
|
+
* (draft-ramadan-moq-fec-01 4): any string but `none`, `raptorq` and
|
|
71
|
+
* `reed-solomon`. Such a track is consumed without FEC and its repair tracks
|
|
72
|
+
* are not joined; the catalog is not in error. An absent algorithm is not a
|
|
73
|
+
* token (the hang dialect omits it) and stays implemented.
|
|
74
|
+
*/
|
|
75
|
+
export declare function fecAlgorithmUnimplemented(algorithm: unknown): boolean;
|
|
67
76
|
/** Smallest `symbolSize` under `iso-ssbg1-v1` (draft-ramadan-moq-fec-01 5.1, 6.3.4 rule 13). */
|
|
68
77
|
export declare const ISO_SSBG1_MIN_SYMBOL_SIZE = 14;
|
|
69
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-fec-source.d.ts","sourceRoot":"","sources":["../src/catalog-fec-source.ts"],"names":[],"mappings":"AAuBA,0DAA0D;AAC1D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,CAAA;AAE9C,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,GACxB;IACE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,mEAAmE;IACnE,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,GACD;IACE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;IACvB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvC,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAUL;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,SAAS,cAAc,EAAc,GAC3C,gBAAgB,GAAG,SAAS,CA4B9B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKxD;AAED
|
|
1
|
+
{"version":3,"file":"catalog-fec-source.d.ts","sourceRoot":"","sources":["../src/catalog-fec-source.ts"],"names":[],"mappings":"AAuBA,0DAA0D;AAC1D,MAAM,MAAM,cAAc,G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AG,EAAE,OAAO,GAAG,OAAO,CAK9E"}
|
|
@@ -96,8 +96,9 @@ export function isoBlockSpanUsable(fec) {
|
|
|
96
96
|
* (draft-ramadan-moq-fec §5.1): the decision the container's
|
|
97
97
|
* `catalogFecUnavailable` explains with a typed reason.
|
|
98
98
|
*
|
|
99
|
-
* False when the block
|
|
100
|
-
*
|
|
99
|
+
* False when the block's `algorithm` is a token this receiver does not
|
|
100
|
+
* implement (`fecAlgorithmUnimplemented`); when it declares an FEC instance
|
|
101
|
+
* (any `algorithm` but `"none"`) and names no implemented `blockProfile` (the retired `k-padded-v1`
|
|
101
102
|
* included), or carries an `iso-ssbg1-v1` span it cannot use; and when a block
|
|
102
103
|
* declaring no FEC instance carries a profile token that is not implemented.
|
|
103
104
|
* True for a non-object and for every other block. It reads only the profile
|
|
@@ -111,11 +112,23 @@ export function catalogFecAvailable(fec) {
|
|
|
111
112
|
const block = recordOf(fec);
|
|
112
113
|
if (block === undefined)
|
|
113
114
|
return true;
|
|
115
|
+
if (fecAlgorithmUnimplemented(block['algorithm']))
|
|
116
|
+
return false;
|
|
114
117
|
const declaresFecInstance = block['algorithm'] !== 'none';
|
|
115
118
|
const profile = block['blockProfile'];
|
|
116
119
|
const profileOk = isFecBlockProfile(profile) || (profile === undefined && !declaresFecInstance);
|
|
117
120
|
return profileOk && (!declaresFecInstance || isoBlockSpanUsable(block));
|
|
118
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Whether `algorithm` is a token this receiver does not implement
|
|
124
|
+
* (draft-ramadan-moq-fec-01 4): any string but `none`, `raptorq` and
|
|
125
|
+
* `reed-solomon`. Such a track is consumed without FEC and its repair tracks
|
|
126
|
+
* are not joined; the catalog is not in error. An absent algorithm is not a
|
|
127
|
+
* token (the hang dialect omits it) and stays implemented.
|
|
128
|
+
*/
|
|
129
|
+
export function fecAlgorithmUnimplemented(algorithm) {
|
|
130
|
+
return typeof algorithm === 'string' && algorithm !== 'none' && algorithm !== 'raptorq' && algorithm !== 'reed-solomon';
|
|
131
|
+
}
|
|
119
132
|
function isPositiveSafeInteger(value) {
|
|
120
133
|
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0;
|
|
121
134
|
}
|
|
@@ -132,7 +145,7 @@ export const ISO_SSBG1_MIN_SYMBOL_SIZE = 14;
|
|
|
132
145
|
*/
|
|
133
146
|
export function catalogFecDeclaresUnconfigurableInstance(fec) {
|
|
134
147
|
const block = recordOf(fec);
|
|
135
|
-
if (block === undefined || block['algorithm'] === 'none')
|
|
148
|
+
if (block === undefined || block['algorithm'] === 'none' || fecAlgorithmUnimplemented(block['algorithm']))
|
|
136
149
|
return false;
|
|
137
150
|
if (!(isPositiveSafeInteger(block['sourceSymbols']) && isPositiveSafeInteger(block['symbolSize'])))
|
|
138
151
|
return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-fec-source.js","sourceRoot":"","sources":["../src/catalog-fec-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AA6B1D,MAAM,SAAS,GAA8B,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;AAE9E,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,SAAS,CAAA;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAgB,EAChB,MAAc,EACd,QAAmC,SAAS;IAE5C,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC9B,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,E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GAAgG;AAChG,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAA;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,wCAAwC,CAAC,GAAY;IACnE,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,MAAM,IAAI,yBAAyB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IACvH,IAAI,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/G,OAAO,KAAK,CAAC,cAAc,CAAC,KAAK,cAAc,IAAK,KAAK,CAAC,YAAY,CAAY,GAAG,yBAAyB,CAAA;AAChH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockcast/mmt-base",
|
|
3
|
-
"version": "0.4.0-main.
|
|
3
|
+
"version": "0.4.0-main.8ff05f91d861",
|
|
4
4
|
"description": "Shared MMTP parsing primitives and protocol constants (zero FEC dependency). Hosts MMTP_HEADER_SIZE, parseMMTPHeader, extractMFUPayload and friends, plus wire constants such as DEFAULT_AMT_RELAY_PORT, so @blockcast/mmt-fec, @blockcast/mmt-container and @blockcast/mmt-transport can share one definition without a circular dep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -126,8 +126,9 @@ export function isoBlockSpanUsable(fec: unknown): boolean {
|
|
|
126
126
|
* (draft-ramadan-moq-fec §5.1): the decision the container's
|
|
127
127
|
* `catalogFecUnavailable` explains with a typed reason.
|
|
128
128
|
*
|
|
129
|
-
* False when the block
|
|
130
|
-
*
|
|
129
|
+
* False when the block's `algorithm` is a token this receiver does not
|
|
130
|
+
* implement (`fecAlgorithmUnimplemented`); when it declares an FEC instance
|
|
131
|
+
* (any `algorithm` but `"none"`) and names no implemented `blockProfile` (the retired `k-padded-v1`
|
|
131
132
|
* included), or carries an `iso-ssbg1-v1` span it cannot use; and when a block
|
|
132
133
|
* declaring no FEC instance carries a profile token that is not implemented.
|
|
133
134
|
* True for a non-object and for every other block. It reads only the profile
|
|
@@ -140,12 +141,24 @@ export function isoBlockSpanUsable(fec: unknown): boolean {
|
|
|
140
141
|
export function catalogFecAvailable(fec: unknown): boolean {
|
|
141
142
|
const block = recordOf(fec)
|
|
142
143
|
if (block === undefined) return true
|
|
144
|
+
if (fecAlgorithmUnimplemented(block['algorithm'])) return false
|
|
143
145
|
const declaresFecInstance = block['algorithm'] !== 'none'
|
|
144
146
|
const profile = block['blockProfile']
|
|
145
147
|
const profileOk = isFecBlockProfile(profile) || (profile === undefined && !declaresFecInstance)
|
|
146
148
|
return profileOk && (!declaresFecInstance || isoBlockSpanUsable(block))
|
|
147
149
|
}
|
|
148
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Whether `algorithm` is a token this receiver does not implement
|
|
153
|
+
* (draft-ramadan-moq-fec-01 4): any string but `none`, `raptorq` and
|
|
154
|
+
* `reed-solomon`. Such a track is consumed without FEC and its repair tracks
|
|
155
|
+
* are not joined; the catalog is not in error. An absent algorithm is not a
|
|
156
|
+
* token (the hang dialect omits it) and stays implemented.
|
|
157
|
+
*/
|
|
158
|
+
export function fecAlgorithmUnimplemented(algorithm: unknown): boolean {
|
|
159
|
+
return typeof algorithm === 'string' && algorithm !== 'none' && algorithm !== 'raptorq' && algorithm !== 'reed-solomon'
|
|
160
|
+
}
|
|
161
|
+
|
|
149
162
|
function isPositiveSafeInteger(value: unknown): boolean {
|
|
150
163
|
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0
|
|
151
164
|
}
|
|
@@ -164,7 +177,7 @@ export const ISO_SSBG1_MIN_SYMBOL_SIZE = 14
|
|
|
164
177
|
*/
|
|
165
178
|
export function catalogFecDeclaresUnconfigurableInstance(fec: unknown): boolean {
|
|
166
179
|
const block = recordOf(fec)
|
|
167
|
-
if (block === undefined || block['algorithm'] === 'none') return false
|
|
180
|
+
if (block === undefined || block['algorithm'] === 'none' || fecAlgorithmUnimplemented(block['algorithm'])) return false
|
|
168
181
|
if (!(isPositiveSafeInteger(block['sourceSymbols']) && isPositiveSafeInteger(block['symbolSize']))) return true
|
|
169
182
|
return block['blockProfile'] === 'iso-ssbg1-v1' && (block['symbolSize'] as number) < ISO_SSBG1_MIN_SYMBOL_SIZE
|
|
170
183
|
}
|