@ac-kit/format-dash 0.0.0-stage → 0.1.1
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/CHANGELOG.md +89 -0
- package/LICENSE +28 -0
- package/README.md +180 -2
- package/dist/_template.d.ts +34 -0
- package/dist/_template.d.ts.map +1 -0
- package/dist/_template.js +90 -0
- package/dist/_template.js.map +1 -0
- package/dist/_xlink.d.ts +9 -0
- package/dist/_xlink.d.ts.map +1 -0
- package/dist/_xlink.js +14 -0
- package/dist/_xlink.js.map +1 -0
- package/dist/dash-namespaces.d.ts +27 -0
- package/dist/dash-namespaces.d.ts.map +1 -0
- package/dist/dash-namespaces.js +30 -0
- package/dist/dash-namespaces.js.map +1 -0
- package/dist/errors.d.ts +127 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +52 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/limits.d.ts +51 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +39 -0
- package/dist/limits.js.map +1 -0
- package/dist/model/dash-common.d.ts +124 -0
- package/dist/model/dash-common.d.ts.map +1 -0
- package/dist/model/dash-common.js +2 -0
- package/dist/model/dash-common.js.map +1 -0
- package/dist/model/dash-mpd.d.ts +111 -0
- package/dist/model/dash-mpd.d.ts.map +1 -0
- package/dist/model/dash-mpd.js +2 -0
- package/dist/model/dash-mpd.js.map +1 -0
- package/dist/model/dash-segment-information.d.ts +90 -0
- package/dist/model/dash-segment-information.d.ts.map +1 -0
- package/dist/model/dash-segment-information.js +2 -0
- package/dist/model/dash-segment-information.js.map +1 -0
- package/dist/parse/_attribute-reader.d.ts +94 -0
- package/dist/parse/_attribute-reader.d.ts.map +1 -0
- package/dist/parse/_attribute-reader.js +382 -0
- package/dist/parse/_attribute-reader.js.map +1 -0
- package/dist/parse/_context.d.ts +35 -0
- package/dist/parse/_context.d.ts.map +1 -0
- package/dist/parse/_context.js +39 -0
- package/dist/parse/_context.js.map +1 -0
- package/dist/parse/_xs-temporal.d.ts +22 -0
- package/dist/parse/_xs-temporal.d.ts.map +1 -0
- package/dist/parse/_xs-temporal.js +98 -0
- package/dist/parse/_xs-temporal.js.map +1 -0
- package/dist/parse/parse-dash-mpd.d.ts +67 -0
- package/dist/parse/parse-dash-mpd.d.ts.map +1 -0
- package/dist/parse/parse-dash-mpd.js +928 -0
- package/dist/parse/parse-dash-mpd.js.map +1 -0
- package/dist/resolve/_base-url.d.ts +41 -0
- package/dist/resolve/_base-url.d.ts.map +1 -0
- package/dist/resolve/_base-url.js +69 -0
- package/dist/resolve/_base-url.js.map +1 -0
- package/dist/resolve/_essential-properties.d.ts +38 -0
- package/dist/resolve/_essential-properties.d.ts.map +1 -0
- package/dist/resolve/_essential-properties.js +106 -0
- package/dist/resolve/_essential-properties.js.map +1 -0
- package/dist/resolve/_inherit.d.ts +43 -0
- package/dist/resolve/_inherit.d.ts.map +1 -0
- package/dist/resolve/_inherit.js +105 -0
- package/dist/resolve/_inherit.js.map +1 -0
- package/dist/resolve/_segment-runs.d.ts +81 -0
- package/dist/resolve/_segment-runs.d.ts.map +1 -0
- package/dist/resolve/_segment-runs.js +126 -0
- package/dist/resolve/_segment-runs.js.map +1 -0
- package/dist/resolve/dash-resolve-diagnostic.d.ts +34 -0
- package/dist/resolve/dash-resolve-diagnostic.d.ts.map +1 -0
- package/dist/resolve/dash-resolve-diagnostic.js +2 -0
- package/dist/resolve/dash-resolve-diagnostic.js.map +1 -0
- package/dist/resolve/resolve-dash-representations.d.ts +130 -0
- package/dist/resolve/resolve-dash-representations.d.ts.map +1 -0
- package/dist/resolve/resolve-dash-representations.js +203 -0
- package/dist/resolve/resolve-dash-representations.js.map +1 -0
- package/dist/resolve/resolve-dash-segments.d.ts +169 -0
- package/dist/resolve/resolve-dash-segments.d.ts.map +1 -0
- package/dist/resolve/resolve-dash-segments.js +665 -0
- package/dist/resolve/resolve-dash-segments.js.map +1 -0
- package/dist/timing/_exact-period-timings.d.ts +28 -0
- package/dist/timing/_exact-period-timings.d.ts.map +1 -0
- package/dist/timing/_exact-period-timings.js +142 -0
- package/dist/timing/_exact-period-timings.js.map +1 -0
- package/dist/timing/dash-period-timings.d.ts +29 -0
- package/dist/timing/dash-period-timings.d.ts.map +1 -0
- package/dist/timing/dash-period-timings.js +23 -0
- package/dist/timing/dash-period-timings.js.map +1 -0
- package/package.json +63 -3
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable identifiers of everything {@link parseDashMpd} can report.
|
|
3
|
+
*
|
|
4
|
+
* Every code but `nonstandard-namespace` is a violation of ISO/IEC 23009-1: a
|
|
5
|
+
* strict parse throws at the first one, a lenient parse recovers as the code
|
|
6
|
+
* says and records it. `nonstandard-namespace` is an advisory in both modes.
|
|
7
|
+
*
|
|
8
|
+
* - `not-an-mpd`: the root element is not an MPD; fails in both modes.
|
|
9
|
+
* - `nonstandard-namespace`: the MPD is in no namespace, or in
|
|
10
|
+
* {@link DASH_MPD_LEGACY_NAMESPACE}; read as if it were in
|
|
11
|
+
* {@link DASH_MPD_NAMESPACE}.
|
|
12
|
+
* - `namespace`: a Namespaces in XML violation `resolveNamespaces` recovered from
|
|
13
|
+
* in lenient mode (strict mode throws its `XmlNamespaceError`).
|
|
14
|
+
* - `missing-attribute`: a required attribute is absent — `MPD@profiles`,
|
|
15
|
+
* `MPD@minBufferTime`, `MPD@availabilityStartTime` of a dynamic MPD,
|
|
16
|
+
* `Representation@id`, `@bandwidth`, `S@d`, a descriptor's `@schemeIdUri`.
|
|
17
|
+
* Lenient: the field is `null` (`profiles` empty).
|
|
18
|
+
* - `missing-element`: the MPD has no Period. Lenient: `periods` is empty.
|
|
19
|
+
* - `invalid-attribute-value`, `unsafe-integer`, `invalid-duration`,
|
|
20
|
+
* `invalid-date-time`, `invalid-template`: a typed attribute does not read as
|
|
21
|
+
* its type — an `xs:unsignedInt` past 4 294 967 295, an `xs:unsignedLong`
|
|
22
|
+
* past 2^64−1, a number past 2^53−1 where the model holds a `number`, a
|
|
23
|
+
* duration with years, months, weeks or a negative sign, a template with an
|
|
24
|
+
* unknown identifier or a format other than `%0<width>d` (width at most 64).
|
|
25
|
+
* Lenient: the field is `null` and the attribute moves to
|
|
26
|
+
* `invalidAttributes`; an unreadable `MPD@type` makes `type` `null`.
|
|
27
|
+
* - `conflicting-segment-information`: one element holds more than one of
|
|
28
|
+
* SegmentBase, SegmentList and SegmentTemplate, or two of one, or two
|
|
29
|
+
* SegmentTimelines. Lenient: the first is kept, the rest stay in
|
|
30
|
+
* `otherElements`.
|
|
31
|
+
* - `duplicate-representation-id`: two Representations of one Period share an
|
|
32
|
+
* `@id`. Lenient: both are kept.
|
|
33
|
+
*/
|
|
34
|
+
export type DashDiagnosticCode = "not-an-mpd" | "nonstandard-namespace" | "namespace" | "missing-attribute" | "missing-element" | "invalid-attribute-value" | "unsafe-integer" | "invalid-duration" | "invalid-date-time" | "invalid-template" | "conflicting-segment-information" | "duplicate-representation-id";
|
|
35
|
+
/** One problem found while parsing, at a source offset. */
|
|
36
|
+
export type DashDiagnostic = {
|
|
37
|
+
readonly code: DashDiagnosticCode;
|
|
38
|
+
/** An advisory never fails a parse; a violation fails a strict one. */
|
|
39
|
+
readonly severity: "violation" | "advisory";
|
|
40
|
+
readonly message: string;
|
|
41
|
+
/**
|
|
42
|
+
* Source offset of the element or attribute at fault, or of its nearest
|
|
43
|
+
* ancestor with a span (nodes an XML entity expanded into have none);
|
|
44
|
+
* `undefined` for a tree built in code.
|
|
45
|
+
*/
|
|
46
|
+
readonly position: number | undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* An MPD that XML accepts but ISO/IEC 23009-1 does not, in the way the active
|
|
50
|
+
* mode does not tolerate: any violation in strict mode, and in both modes a
|
|
51
|
+
* root that is not an MPD.
|
|
52
|
+
*/
|
|
53
|
+
export declare class DashSyntaxError extends SyntaxError {
|
|
54
|
+
readonly code: DashDiagnosticCode;
|
|
55
|
+
/** As {@link DashDiagnostic.position}. */
|
|
56
|
+
readonly position: number | undefined;
|
|
57
|
+
constructor(code: DashDiagnosticCode, message: string,
|
|
58
|
+
/** As {@link DashDiagnostic.position}. */
|
|
59
|
+
position: number | undefined);
|
|
60
|
+
}
|
|
61
|
+
/** Which of the {@link DashLimits} a {@link DashLimitError} reports. */
|
|
62
|
+
export type DashLimitName = "maxLength" | "maxTimelineEntries" | "maxSegments" | "budget";
|
|
63
|
+
/** Input past one of the {@link DashLimits}; thrown in every mode. */
|
|
64
|
+
export declare class DashLimitError extends RangeError {
|
|
65
|
+
readonly limit: DashLimitName;
|
|
66
|
+
/** The bound that was exceeded; for `budget`, the private budget's limit. */
|
|
67
|
+
readonly value: number;
|
|
68
|
+
/**
|
|
69
|
+
* How many there were, when known: for `maxSegments`, the exact number of
|
|
70
|
+
* segments the request selects, so a caller can narrow `from`/`to`.
|
|
71
|
+
*/
|
|
72
|
+
readonly count: bigint | null;
|
|
73
|
+
constructor(limit: DashLimitName,
|
|
74
|
+
/** The bound that was exceeded; for `budget`, the private budget's limit. */
|
|
75
|
+
value: number,
|
|
76
|
+
/**
|
|
77
|
+
* How many there were, when known: for `maxSegments`, the exact number of
|
|
78
|
+
* segments the request selects, so a caller can narrow `from`/`to`.
|
|
79
|
+
*/
|
|
80
|
+
count?: bigint | null, options?: ErrorOptions);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Why a Representation's segments cannot be listed, though the MPD parsed.
|
|
84
|
+
*
|
|
85
|
+
* - `unknown-period-start`: the Period has no `@start` and no earlier Period
|
|
86
|
+
* gives one — an early-available Period of a dynamic MPD.
|
|
87
|
+
* - `unknown-period-duration`: the segment count depends on the Period's end
|
|
88
|
+
* (SegmentTemplate or SegmentList `@duration`, a single SegmentList entry,
|
|
89
|
+
* SegmentBase or a BaseURL alone), and neither a following Period,
|
|
90
|
+
* `Period@duration`, `MPD@mediaPresentationDuration` nor (for `@duration`)
|
|
91
|
+
* `@endNumber` bounds it, nor, live, a finite availability.
|
|
92
|
+
* - `unbounded-repeat`: a negative `S@r` on the last `S` with no Period end, no
|
|
93
|
+
* `@endNumber`, no SegmentURL count and, in a dynamic MPD, an infinite
|
|
94
|
+
* `availabilityTimeOffset`.
|
|
95
|
+
* - `invalid-timeline`: an `S` with `@d="0"`, an `@t` before the previous
|
|
96
|
+
* segment's start, or a negative `@r` followed by an `S` without `@t`.
|
|
97
|
+
* - `invalid-timescale`: `@timescale="0"`.
|
|
98
|
+
* - `invalid-duration`: `@duration="0"`, or a duration of the model with years or
|
|
99
|
+
* months, which have no fixed length.
|
|
100
|
+
* - `segment-count-mismatch`: a SegmentList's SegmentTimeline describes a
|
|
101
|
+
* different number of segments than it has SegmentURLs.
|
|
102
|
+
* - `missing-segment-duration`: a SegmentList of several entries with neither
|
|
103
|
+
* SegmentTimeline nor `@duration`.
|
|
104
|
+
* - `missing-media`: a SegmentTemplate with no `@media`.
|
|
105
|
+
* - `invalid-template`: a template with an unknown identifier or format.
|
|
106
|
+
* - `missing-attribute`: a value a lenient parse left `null` is needed —
|
|
107
|
+
* `Representation@id` or `@bandwidth` for a template,
|
|
108
|
+
* `MPD@availabilityStartTime` of a dynamic MPD.
|
|
109
|
+
* - `unsafe-segment-number`: a segment number would pass 2^53−1.
|
|
110
|
+
* - `unreadable-value`: a value the listing depends on is among the
|
|
111
|
+
* `invalidAttributes` of a lenient parse — `MPD@type`, a timescale, a
|
|
112
|
+
* duration, `S@t`/`@d`/`@r`, an availability offset… — so a default would
|
|
113
|
+
* stand where the MPD meant something else.
|
|
114
|
+
* - `invalid-availability`: the availability window cannot be represented:
|
|
115
|
+
* `availabilityTimeOffset`s summing past a double, or availability instants
|
|
116
|
+
* outside `Temporal.Instant`'s range.
|
|
117
|
+
*/
|
|
118
|
+
export type DashResolveErrorCode = "unknown-period-start" | "unknown-period-duration" | "unbounded-repeat" | "invalid-timeline" | "invalid-timescale" | "invalid-duration" | "segment-count-mismatch" | "missing-segment-duration" | "missing-media" | "invalid-template" | "missing-attribute" | "unsafe-segment-number" | "unreadable-value" | "invalid-availability";
|
|
119
|
+
/**
|
|
120
|
+
* A Representation whose segments {@link resolveDashSegments} cannot list: the
|
|
121
|
+
* MPD parsed, but its segment description is incomplete or contradicts itself.
|
|
122
|
+
*/
|
|
123
|
+
export declare class DashResolveError extends Error {
|
|
124
|
+
readonly code: DashResolveErrorCode;
|
|
125
|
+
constructor(code: DashResolveErrorCode, message: string);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,kBAAkB,GAC3B,YAAY,GACZ,uBAAuB,GACvB,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,yBAAyB,GACzB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,iCAAiC,GACjC,6BAA6B,CAAC;AAEjC,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,UAAU,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAE9C,QAAQ,CAAC,IAAI,EAAE,kBAAkB;IAEjC,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAJtC,YACU,IAAI,EAAE,kBAAkB,EACjC,OAAO,EAAE,MAAM;IACf,0CAA0C;IACjC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAIrC;CACD;AAED,wEAAwE;AACxE,MAAM,MAAM,aAAa,GACtB,WAAW,GACX,oBAAoB,GACpB,aAAa,GACb,QAAQ,CAAC;AAEZ,sEAAsE;AACtE,qBAAa,cAAe,SAAQ,UAAU;IAE5C,QAAQ,CAAC,KAAK,EAAE,aAAa;IAC7B,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAR9B,YACU,KAAK,EAAE,aAAa;IAC7B,6EAA6E;IACpE,KAAK,EAAE,MAAM;IACtB;;;OAGG;IACM,KAAK,GAAE,MAAM,GAAG,IAAW,EACpC,OAAO,CAAC,EAAE,YAAY,EAStB;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,oBAAoB,GAC7B,sBAAsB,GACtB,yBAAyB,GACzB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,wBAAwB,GACxB,0BAA0B,GAC1B,eAAe,GACf,kBAAkB,GAClB,mBAAmB,GACnB,uBAAuB,GACvB,kBAAkB,GAClB,sBAAsB,CAAC;AAE1B;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,oBAAoB;IADpC,YACU,IAAI,EAAE,oBAAoB,EACnC,OAAO,EAAE,MAAM,EAIf;CACD"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An MPD that XML accepts but ISO/IEC 23009-1 does not, in the way the active
|
|
3
|
+
* mode does not tolerate: any violation in strict mode, and in both modes a
|
|
4
|
+
* root that is not an MPD.
|
|
5
|
+
*/
|
|
6
|
+
export class DashSyntaxError extends SyntaxError {
|
|
7
|
+
code;
|
|
8
|
+
position;
|
|
9
|
+
constructor(code, message,
|
|
10
|
+
/** As {@link DashDiagnostic.position}. */
|
|
11
|
+
position) {
|
|
12
|
+
super(position === undefined ? message : `${message} at ${position}`);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.position = position;
|
|
15
|
+
this.name = "DashSyntaxError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Input past one of the {@link DashLimits}; thrown in every mode. */
|
|
19
|
+
export class DashLimitError extends RangeError {
|
|
20
|
+
limit;
|
|
21
|
+
value;
|
|
22
|
+
count;
|
|
23
|
+
constructor(limit,
|
|
24
|
+
/** The bound that was exceeded; for `budget`, the private budget's limit. */
|
|
25
|
+
value,
|
|
26
|
+
/**
|
|
27
|
+
* How many there were, when known: for `maxSegments`, the exact number of
|
|
28
|
+
* segments the request selects, so a caller can narrow `from`/`to`.
|
|
29
|
+
*/
|
|
30
|
+
count = null, options) {
|
|
31
|
+
super(count === null
|
|
32
|
+
? `DASH MPD exceeds ${limit} (${value})`
|
|
33
|
+
: `DASH MPD exceeds ${limit} (${value}): ${count}`, options);
|
|
34
|
+
this.limit = limit;
|
|
35
|
+
this.value = value;
|
|
36
|
+
this.count = count;
|
|
37
|
+
this.name = "DashLimitError";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A Representation whose segments {@link resolveDashSegments} cannot list: the
|
|
42
|
+
* MPD parsed, but its segment description is incomplete or contradicts itself.
|
|
43
|
+
*/
|
|
44
|
+
export class DashResolveError extends Error {
|
|
45
|
+
code;
|
|
46
|
+
constructor(code, message) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.code = code;
|
|
49
|
+
this.name = "DashResolveError";
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AA6DA;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAErC,IAAI;IAGJ,QAAQ;IAJlB,YACU,IAAwB,EACjC,OAAe;IACf,0CAA0C;IACjC,QAA4B;QAErC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,QAAQ,EAAE,CAAC,CAAC;oBAL7D,IAAI;wBAGJ,QAAQ;QAGjB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAC/B,CAAC;CACD;AASD,sEAAsE;AACtE,MAAM,OAAO,cAAe,SAAQ,UAAU;IAEnC,KAAK;IAEL,KAAK;IAKL,KAAK;IARf,YACU,KAAoB;IAC7B,6EAA6E;IACpE,KAAa;IACtB;;;OAGG;IACM,KAAK,GAAkB,IAAI,EACpC,OAAsB;QAEtB,KAAK,CACJ,KAAK,KAAK,IAAI;YACb,CAAC,CAAC,oBAAoB,KAAK,KAAK,KAAK,GAAG;YACxC,CAAC,CAAC,oBAAoB,KAAK,KAAK,KAAK,MAAM,KAAK,EAAE,EACnD,OAAO,CACP,CAAC;qBAfO,KAAK;qBAEL,KAAK;qBAKL,KAAK;QASd,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC9B,CAAC;CACD;AAsDD;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAEhC,IAAI;IADd,YACU,IAA0B,EACnC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;oBAHN,IAAI;QAIb,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAChC,CAAC;CACD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./dash-namespaces.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./limits.js";
|
|
4
|
+
export * from "./model/dash-common.js";
|
|
5
|
+
export * from "./model/dash-mpd.js";
|
|
6
|
+
export * from "./model/dash-segment-information.js";
|
|
7
|
+
export * from "./parse/parse-dash-mpd.js";
|
|
8
|
+
export * from "./resolve/dash-resolve-diagnostic.js";
|
|
9
|
+
export * from "./resolve/resolve-dash-representations.js";
|
|
10
|
+
export * from "./resolve/resolve-dash-segments.js";
|
|
11
|
+
export * from "./timing/dash-period-timings.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./dash-namespaces.js";
|
|
2
|
+
export * from "./errors.js";
|
|
3
|
+
export * from "./limits.js";
|
|
4
|
+
export * from "./model/dash-common.js";
|
|
5
|
+
export * from "./model/dash-mpd.js";
|
|
6
|
+
export * from "./model/dash-segment-information.js";
|
|
7
|
+
export * from "./parse/parse-dash-mpd.js";
|
|
8
|
+
export * from "./resolve/dash-resolve-diagnostic.js";
|
|
9
|
+
export * from "./resolve/resolve-dash-representations.js";
|
|
10
|
+
export * from "./resolve/resolve-dash-segments.js";
|
|
11
|
+
export * from "./timing/dash-period-timings.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC"}
|
package/dist/limits.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounds on what one MPD may cost to parse and to expand.
|
|
3
|
+
*
|
|
4
|
+
* An MPD comes from a server the caller does not control. Each bound guards a
|
|
5
|
+
* different multiplier: the source text, the `<S>` entries a timeline stores
|
|
6
|
+
* (each becomes an object), and the segments one Representation expands to,
|
|
7
|
+
* which `S@r` can make astronomically many from a few characters. The XML
|
|
8
|
+
* limits of `@ac-kit/format-xml` (entity expansion, nesting depth) apply on
|
|
9
|
+
* top.
|
|
10
|
+
*/
|
|
11
|
+
export type DashLimits = {
|
|
12
|
+
/**
|
|
13
|
+
* Most characters of source, 16 777 216 (16 Mi) by default. Bytes are bounded
|
|
14
|
+
* at three times this before decoding, the most UTF-8 a string of that many
|
|
15
|
+
* UTF-16 units takes.
|
|
16
|
+
*/
|
|
17
|
+
readonly maxLength?: number;
|
|
18
|
+
/** Most `<S>` elements in the whole MPD, 1 000 000 by default. */
|
|
19
|
+
readonly maxTimelineEntries?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Most segments {@link resolveDashSegments} may select for one Representation,
|
|
22
|
+
* 100 000 by default — a day of one-second segments; narrow `from`/`to` for
|
|
23
|
+
* more.
|
|
24
|
+
*/
|
|
25
|
+
readonly maxSegments?: number;
|
|
26
|
+
/** Most warnings kept, 1 000 by default; later ones are counted, not stored. */
|
|
27
|
+
readonly maxWarnings?: number;
|
|
28
|
+
};
|
|
29
|
+
/** Every bound in {@link DashLimits}, filled in. */
|
|
30
|
+
export type ResolvedDashLimits = Required<DashLimits>;
|
|
31
|
+
/** The defaults behind every unset bound in {@link DashLimits}. */
|
|
32
|
+
export declare const DEFAULT_DASH_LIMITS: Readonly<ResolvedDashLimits>;
|
|
33
|
+
/**
|
|
34
|
+
* The default work allowance per call. Parsing shares it among XML parsing,
|
|
35
|
+
* namespace resolution and MPD model construction; resolvers charge their own
|
|
36
|
+
* work to the same allowance per call. This is a work limit, not a wall clock
|
|
37
|
+
* timeout.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEFAULT_DASH_WORK_BUDGET = 500000;
|
|
40
|
+
/**
|
|
41
|
+
* The widest `%0<width>d` a template may ask for. Wider is refused rather than
|
|
42
|
+
* honoured, so one attribute cannot make every URL megabytes long.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DASH_MAX_TEMPLATE_WIDTH = 64;
|
|
45
|
+
/**
|
|
46
|
+
* Fills in the unset bounds from {@link DEFAULT_DASH_LIMITS}.
|
|
47
|
+
*
|
|
48
|
+
* @throws {RangeError} When a bound is not a non-negative safe integer.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dashLimits(limits?: DashLimits): ResolvedDashLimits;
|
|
51
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG;IACxB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEtD,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,kBAAkB,CAK5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAclE"}
|
package/dist/limits.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** The defaults behind every unset bound in {@link DashLimits}. */
|
|
2
|
+
export const DEFAULT_DASH_LIMITS = {
|
|
3
|
+
maxLength: 4194304,
|
|
4
|
+
maxTimelineEntries: 100000,
|
|
5
|
+
maxSegments: 100000,
|
|
6
|
+
maxWarnings: 1000,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The default work allowance per call. Parsing shares it among XML parsing,
|
|
10
|
+
* namespace resolution and MPD model construction; resolvers charge their own
|
|
11
|
+
* work to the same allowance per call. This is a work limit, not a wall clock
|
|
12
|
+
* timeout.
|
|
13
|
+
*/
|
|
14
|
+
export const DEFAULT_DASH_WORK_BUDGET = 500000;
|
|
15
|
+
/**
|
|
16
|
+
* The widest `%0<width>d` a template may ask for. Wider is refused rather than
|
|
17
|
+
* honoured, so one attribute cannot make every URL megabytes long.
|
|
18
|
+
*/
|
|
19
|
+
export const DASH_MAX_TEMPLATE_WIDTH = 64;
|
|
20
|
+
/**
|
|
21
|
+
* Fills in the unset bounds from {@link DEFAULT_DASH_LIMITS}.
|
|
22
|
+
*
|
|
23
|
+
* @throws {RangeError} When a bound is not a non-negative safe integer.
|
|
24
|
+
*/
|
|
25
|
+
export function dashLimits(limits) {
|
|
26
|
+
const resolved = {
|
|
27
|
+
maxLength: limits?.maxLength ?? DEFAULT_DASH_LIMITS.maxLength,
|
|
28
|
+
maxTimelineEntries: limits?.maxTimelineEntries ?? DEFAULT_DASH_LIMITS.maxTimelineEntries,
|
|
29
|
+
maxSegments: limits?.maxSegments ?? DEFAULT_DASH_LIMITS.maxSegments,
|
|
30
|
+
maxWarnings: limits?.maxWarnings ?? DEFAULT_DASH_LIMITS.maxWarnings,
|
|
31
|
+
};
|
|
32
|
+
for (const [name, value] of Object.entries(resolved)) {
|
|
33
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
34
|
+
throw new RangeError(`${name} must be a non-negative safe integer`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return resolved;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAgCA,mEAAmE;AACnE,MAAM,CAAC,MAAM,mBAAmB,GAAiC;IAChE,SAAS,EAAE,OAAS;IACpB,kBAAkB,EAAE,MAAO;IAC3B,WAAW,EAAE,MAAO;IACpB,WAAW,EAAE,IAAI;CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAO,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAmB;IAC7C,MAAM,QAAQ,GAAuB;QACpC,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,mBAAmB,CAAC,SAAS;QAC7D,kBAAkB,EACjB,MAAM,EAAE,kBAAkB,IAAI,mBAAmB,CAAC,kBAAkB;QACrE,WAAW,EAAE,MAAM,EAAE,WAAW,IAAI,mBAAmB,CAAC,WAAW;QACnE,WAAW,EAAE,MAAM,EAAE,WAAW,IAAI,mBAAmB,CAAC,WAAW;KACnE,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YAC/C,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,sCAAsC,CAAC,CAAC;QACrE,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { Span } from "@ac-kit/core";
|
|
2
|
+
import type { XmlAttribute, XmlElement } from "@ac-kit/format-xml";
|
|
3
|
+
/**
|
|
4
|
+
* What every typed node keeps of its source beyond its typed fields, so nothing
|
|
5
|
+
* an MPD says is lost.
|
|
6
|
+
*/
|
|
7
|
+
export type DashExtensions = {
|
|
8
|
+
/**
|
|
9
|
+
* Attributes the model does not type, in source order: namespace
|
|
10
|
+
* declarations, foreign namespaces, MPD attributes this version does not
|
|
11
|
+
* read.
|
|
12
|
+
*/
|
|
13
|
+
readonly otherAttributes: readonly XmlAttribute[];
|
|
14
|
+
/**
|
|
15
|
+
* Child elements the model does not type, in source order, as parsed — among
|
|
16
|
+
* them EventStream, ServiceDescription, Preselection, SubRepresentation and
|
|
17
|
+
* vendor elements.
|
|
18
|
+
*/
|
|
19
|
+
readonly otherElements: readonly XmlElement[];
|
|
20
|
+
/**
|
|
21
|
+
* Attributes a lenient parse could not read as their type, in the order read:
|
|
22
|
+
* their typed field is `null`, and listing segments refuses a Representation
|
|
23
|
+
* that depends on one. Always empty after a strict parse.
|
|
24
|
+
*/
|
|
25
|
+
readonly invalidAttributes: readonly XmlAttribute[];
|
|
26
|
+
/** The element's source span, when it has one. */
|
|
27
|
+
readonly span?: Span;
|
|
28
|
+
};
|
|
29
|
+
/** `30000/1001`, `16:9`; a decimal frame rate (`29.97`) is read as 2997/100. */
|
|
30
|
+
export type DashRatio = {
|
|
31
|
+
readonly numerator: number;
|
|
32
|
+
readonly denominator: number;
|
|
33
|
+
};
|
|
34
|
+
/** An inclusive byte range, `first-last`, or `first-` to the end. */
|
|
35
|
+
export type DashByteRange = {
|
|
36
|
+
readonly first: number;
|
|
37
|
+
readonly last: number | null;
|
|
38
|
+
};
|
|
39
|
+
/** `xlink:href` and `xlink:actuate` of a remote element, never fetched. */
|
|
40
|
+
export type DashXlink = {
|
|
41
|
+
readonly href: string;
|
|
42
|
+
readonly actuate: "onLoad" | "onRequest";
|
|
43
|
+
};
|
|
44
|
+
/** A DescriptorType element: Role, EssentialProperty, AudioChannelConfiguration… */
|
|
45
|
+
export type DashDescriptor = DashExtensions & {
|
|
46
|
+
/** `null` only from a lenient parse of an element without it. */
|
|
47
|
+
readonly schemeIdUri: string | null;
|
|
48
|
+
readonly value: string | null;
|
|
49
|
+
readonly id: string | null;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* A ContentProtection descriptor, read as plain data only: nothing here, or
|
|
53
|
+
* anywhere in this package, acquires a license, fetches a key or decrypts.
|
|
54
|
+
*/
|
|
55
|
+
export type DashContentProtection = DashDescriptor & {
|
|
56
|
+
/** `cenc:default_KID` as written. */
|
|
57
|
+
readonly defaultKid: string | null;
|
|
58
|
+
readonly robustness: string | null;
|
|
59
|
+
readonly refId: string | null;
|
|
60
|
+
readonly ref: string | null;
|
|
61
|
+
/** The text of each `cenc:pssh` child, whitespace trimmed, never decoded. */
|
|
62
|
+
readonly pssh: readonly string[];
|
|
63
|
+
/**
|
|
64
|
+
* The text of each DASH-IF `Laurl` child, as written: never resolved against
|
|
65
|
+
* a base URL, never requested.
|
|
66
|
+
*/
|
|
67
|
+
readonly licenseUrls: readonly string[];
|
|
68
|
+
};
|
|
69
|
+
/** A Label or GroupLabel. */
|
|
70
|
+
export type DashLabel = DashExtensions & {
|
|
71
|
+
readonly id: number | null;
|
|
72
|
+
readonly lang: string | null;
|
|
73
|
+
readonly text: string;
|
|
74
|
+
};
|
|
75
|
+
/** Initialization, RepresentationIndex or BitstreamSwitching. */
|
|
76
|
+
export type DashUrl = DashExtensions & {
|
|
77
|
+
readonly sourceUrl: string | null;
|
|
78
|
+
readonly range: DashByteRange | null;
|
|
79
|
+
};
|
|
80
|
+
/** A BaseURL. */
|
|
81
|
+
export type DashBaseUrl = DashExtensions & {
|
|
82
|
+
/** The element's text, whitespace trimmed, unresolved. */
|
|
83
|
+
readonly url: string;
|
|
84
|
+
readonly serviceLocation: string | null;
|
|
85
|
+
/** A byte-range template; {@link resolveDashSegments} refuses it for now. */
|
|
86
|
+
readonly byteRange: string | null;
|
|
87
|
+
/** Seconds; `Infinity` for `INF`. */
|
|
88
|
+
readonly availabilityTimeOffset: number | null;
|
|
89
|
+
readonly availabilityTimeComplete: boolean | null;
|
|
90
|
+
readonly timeShiftBufferDepth: Temporal.Duration | null;
|
|
91
|
+
readonly rangeAccess: boolean | null;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* CommonAttributesElements (§5.3.7), shared by AdaptationSet and
|
|
95
|
+
* Representation.
|
|
96
|
+
*/
|
|
97
|
+
export type DashCommonAttributes = {
|
|
98
|
+
readonly profiles: readonly string[] | null;
|
|
99
|
+
readonly width: number | null;
|
|
100
|
+
readonly height: number | null;
|
|
101
|
+
readonly sar: DashRatio | null;
|
|
102
|
+
readonly frameRate: DashRatio | null;
|
|
103
|
+
/** One rate, or a minimum and a maximum. */
|
|
104
|
+
readonly audioSamplingRate: readonly number[] | null;
|
|
105
|
+
readonly mimeType: string | null;
|
|
106
|
+
readonly segmentProfiles: readonly string[] | null;
|
|
107
|
+
readonly codecs: string | null;
|
|
108
|
+
readonly containerProfiles: readonly string[] | null;
|
|
109
|
+
readonly maximumSAPPeriod: number | null;
|
|
110
|
+
readonly startWithSAP: number | null;
|
|
111
|
+
readonly maxPlayoutRate: number | null;
|
|
112
|
+
readonly codingDependency: boolean | null;
|
|
113
|
+
readonly scanType: "progressive" | "interlaced" | "unknown" | null;
|
|
114
|
+
readonly selectionPriority: number | null;
|
|
115
|
+
readonly tag: string | null;
|
|
116
|
+
readonly framePackings: readonly DashDescriptor[];
|
|
117
|
+
readonly audioChannelConfigurations: readonly DashDescriptor[];
|
|
118
|
+
readonly contentProtections: readonly DashContentProtection[];
|
|
119
|
+
readonly outputProtections: readonly DashDescriptor[];
|
|
120
|
+
readonly essentialProperties: readonly DashDescriptor[];
|
|
121
|
+
readonly supplementalProperties: readonly DashDescriptor[];
|
|
122
|
+
readonly inbandEventStreams: readonly DashDescriptor[];
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=dash-common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dash-common.d.ts","sourceRoot":"","sources":["../../src/model/dash-common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,YAAY,EAAE,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,SAAS,UAAU,EAAE,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,YAAY,EAAE,CAAC;IACpD,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACrB,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,SAAS,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,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IACrC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC;IACnE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,SAAS,cAAc,EAAE,CAAC;IAClD,QAAQ,CAAC,0BAA0B,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9D,QAAQ,CAAC,iBAAiB,EAAE,SAAS,cAAc,EAAE,CAAC;IACtD,QAAQ,CAAC,mBAAmB,EAAE,SAAS,cAAc,EAAE,CAAC;IACxD,QAAQ,CAAC,sBAAsB,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3D,QAAQ,CAAC,kBAAkB,EAAE,SAAS,cAAc,EAAE,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dash-common.js","sourceRoot":"","sources":["../../src/model/dash-common.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { DashBaseUrl, DashCommonAttributes, DashContentProtection, DashDescriptor, DashExtensions, DashLabel, DashRatio, DashXlink } from "./dash-common.js";
|
|
2
|
+
import type { DashSegmentInformation } from "./dash-segment-information.js";
|
|
3
|
+
/** A Representation: one encoding of one media component. */
|
|
4
|
+
export type DashRepresentation = DashExtensions & DashCommonAttributes & DashSegmentInformation & {
|
|
5
|
+
/** `null` only from a lenient parse of a Representation without one. */
|
|
6
|
+
readonly id: string | null;
|
|
7
|
+
/** Bits per second; `null` only from a lenient parse. */
|
|
8
|
+
readonly bandwidth: number | null;
|
|
9
|
+
readonly qualityRanking: number | null;
|
|
10
|
+
readonly dependencyId: readonly string[];
|
|
11
|
+
readonly associationId: readonly string[];
|
|
12
|
+
readonly associationType: readonly string[];
|
|
13
|
+
readonly mediaStreamStructureId: readonly string[];
|
|
14
|
+
readonly baseUrls: readonly DashBaseUrl[];
|
|
15
|
+
};
|
|
16
|
+
/** An AdaptationSet: interchangeable Representations of one component. */
|
|
17
|
+
export type DashAdaptationSet = DashExtensions & DashCommonAttributes & DashSegmentInformation & {
|
|
18
|
+
/** A remote AdaptationSet, never fetched. */
|
|
19
|
+
readonly xlink: DashXlink | null;
|
|
20
|
+
readonly id: number | null;
|
|
21
|
+
readonly group: number | null;
|
|
22
|
+
/** BCP 47 as written. */
|
|
23
|
+
readonly lang: string | null;
|
|
24
|
+
readonly contentType: string | null;
|
|
25
|
+
readonly par: DashRatio | null;
|
|
26
|
+
readonly minBandwidth: number | null;
|
|
27
|
+
readonly maxBandwidth: number | null;
|
|
28
|
+
readonly minWidth: number | null;
|
|
29
|
+
readonly maxWidth: number | null;
|
|
30
|
+
readonly minHeight: number | null;
|
|
31
|
+
readonly maxHeight: number | null;
|
|
32
|
+
readonly minFrameRate: DashRatio | null;
|
|
33
|
+
readonly maxFrameRate: DashRatio | null;
|
|
34
|
+
/** A boolean, or the number of a group of aligned sets. */
|
|
35
|
+
readonly segmentAlignment: boolean | number | null;
|
|
36
|
+
readonly subsegmentAlignment: boolean | number | null;
|
|
37
|
+
readonly subsegmentStartsWithSAP: number | null;
|
|
38
|
+
readonly bitstreamSwitching: boolean | null;
|
|
39
|
+
readonly accessibility: readonly DashDescriptor[];
|
|
40
|
+
readonly roles: readonly DashDescriptor[];
|
|
41
|
+
readonly ratings: readonly DashDescriptor[];
|
|
42
|
+
readonly viewpoints: readonly DashDescriptor[];
|
|
43
|
+
readonly labels: readonly DashLabel[];
|
|
44
|
+
readonly groupLabels: readonly DashLabel[];
|
|
45
|
+
readonly baseUrls: readonly DashBaseUrl[];
|
|
46
|
+
readonly representations: readonly DashRepresentation[];
|
|
47
|
+
};
|
|
48
|
+
/** A Period: a span of the presentation with its own set of components. */
|
|
49
|
+
export type DashPeriod = DashExtensions & DashSegmentInformation & {
|
|
50
|
+
/** A remote Period, never fetched. */
|
|
51
|
+
readonly xlink: DashXlink | null;
|
|
52
|
+
readonly id: string | null;
|
|
53
|
+
readonly start: Temporal.Duration | null;
|
|
54
|
+
readonly duration: Temporal.Duration | null;
|
|
55
|
+
readonly bitstreamSwitching: boolean | null;
|
|
56
|
+
readonly baseUrls: readonly DashBaseUrl[];
|
|
57
|
+
readonly assetIdentifier: DashDescriptor | null;
|
|
58
|
+
readonly adaptationSets: readonly DashAdaptationSet[];
|
|
59
|
+
/** Period-level ContentProtection (5th edition), inert data. */
|
|
60
|
+
readonly contentProtections: readonly DashContentProtection[];
|
|
61
|
+
readonly essentialProperties: readonly DashDescriptor[];
|
|
62
|
+
readonly supplementalProperties: readonly DashDescriptor[];
|
|
63
|
+
};
|
|
64
|
+
/** A ProgramInformation. */
|
|
65
|
+
export type DashProgramInformation = DashExtensions & {
|
|
66
|
+
readonly lang: string | null;
|
|
67
|
+
readonly moreInformationUrl: string | null;
|
|
68
|
+
readonly title: string | null;
|
|
69
|
+
readonly source: string | null;
|
|
70
|
+
readonly copyright: string | null;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A Media Presentation Description, values as written: no inheritance is
|
|
74
|
+
* applied — {@link resolveDashRepresentations} and {@link resolveDashSegments}
|
|
75
|
+
* compute the effective values. Every duration has a fixed length (no years or
|
|
76
|
+
* months) and every date-time is an instant, a value written with no zone being
|
|
77
|
+
* read as UTC.
|
|
78
|
+
*/
|
|
79
|
+
export type DashMpd = DashExtensions & {
|
|
80
|
+
readonly id: string | null;
|
|
81
|
+
readonly profiles: readonly string[];
|
|
82
|
+
/**
|
|
83
|
+
* `"static"` when absent; `null` only from a lenient parse of an unreadable
|
|
84
|
+
* one, which listing segments refuses.
|
|
85
|
+
*/
|
|
86
|
+
readonly type: "static" | "dynamic" | null;
|
|
87
|
+
readonly availabilityStartTime: Temporal.Instant | null;
|
|
88
|
+
readonly availabilityEndTime: Temporal.Instant | null;
|
|
89
|
+
readonly publishTime: Temporal.Instant | null;
|
|
90
|
+
readonly mediaPresentationDuration: Temporal.Duration | null;
|
|
91
|
+
readonly minimumUpdatePeriod: Temporal.Duration | null;
|
|
92
|
+
readonly minBufferTime: Temporal.Duration | null;
|
|
93
|
+
readonly timeShiftBufferDepth: Temporal.Duration | null;
|
|
94
|
+
readonly suggestedPresentationDelay: Temporal.Duration | null;
|
|
95
|
+
readonly maxSegmentDuration: Temporal.Duration | null;
|
|
96
|
+
readonly maxSubsegmentDuration: Temporal.Duration | null;
|
|
97
|
+
readonly programInformation: readonly DashProgramInformation[];
|
|
98
|
+
readonly baseUrls: readonly DashBaseUrl[];
|
|
99
|
+
/** Location elements, as written. */
|
|
100
|
+
readonly locations: readonly string[];
|
|
101
|
+
readonly periods: readonly DashPeriod[];
|
|
102
|
+
readonly utcTimings: readonly DashDescriptor[];
|
|
103
|
+
/**
|
|
104
|
+
* MPD-level ContentProtection (5th edition), inert data; a lower-level
|
|
105
|
+
* ContentProtection may refer to one with `@ref`.
|
|
106
|
+
*/
|
|
107
|
+
readonly contentProtections: readonly DashContentProtection[];
|
|
108
|
+
readonly essentialProperties: readonly DashDescriptor[];
|
|
109
|
+
readonly supplementalProperties: readonly DashDescriptor[];
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=dash-mpd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dash-mpd.d.ts","sourceRoot":"","sources":["../../src/model/dash-mpd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,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