mattebox 0.19.0 → 0.20.0
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 +17 -0
- package/dist/cdn/mattebox.dash-drm.min.js +3 -3
- package/dist/cdn/mattebox.dash-ll.min.js +2 -2
- package/dist/cdn/mattebox.dash.min.js +2 -2
- package/dist/cdn/mattebox.dual-drm.min.js +2 -2
- package/dist/cdn/mattebox.dual-ll.min.js +2 -2
- package/dist/cdn/mattebox.dual-ts-drm.min.js +2 -2
- package/dist/cdn/mattebox.dual-ts.min.js +2 -2
- package/dist/cdn/mattebox.dual.min.js +2 -2
- package/dist/cdn/mattebox.hls-drm.min.js +1 -1
- package/dist/cdn/mattebox.hls-ll.min.js +1 -1
- package/dist/cdn/mattebox.hls-ts-drm.min.js +2 -2
- package/dist/cdn/mattebox.hls-ts.min.js +2 -2
- package/dist/cdn/mattebox.hls.min.js +1 -1
- package/dist/cdn/mattebox.kernel.min.js +1 -1
- package/dist/cdn/mattebox.min.js +5 -5
- package/dist/containers/projection.d.ts +20 -0
- package/dist/containers/projection.d.ts.map +1 -1
- package/dist/containers/projection.js +43 -6
- package/dist/containers/projection.js.map +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/objectWithoutProperties.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.159.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/containers/emsg.js +2 -2
- package/dist/es2015/containers/fmp4/fit.js +1 -1
- package/dist/es2015/containers/fmp4/writer.js +1 -1
- package/dist/es2015/containers/id3.js +1 -1
- package/dist/es2015/containers/mp4-box/index.js +2 -2
- package/dist/es2015/containers/projection.js +50 -11
- package/dist/es2015/containers/scte35.js +1 -1
- package/dist/es2015/containers/sei.js +1 -1
- package/dist/es2015/containers/ts-transmux/demux.js +1 -1
- package/dist/es2015/containers/ts-transmux/h264.js +1 -1
- package/dist/es2015/containers/ts-transmux/h265.js +1 -1
- package/dist/es2015/containers/ts-transmux/index.js +1 -1
- package/dist/es2015/containers/ts-transmux/runner.js +2 -2
- package/dist/es2015/containers/ts-transmux/transmux.js +1 -1
- package/dist/es2015/containers/webm/index.js +2 -5
- package/dist/es2015/containers/webvtt.js +1 -1
- package/dist/es2015/containers/wvtt.js +1 -1
- package/dist/es2015/eme/index.js +3 -3
- package/dist/es2015/index.js +2 -2
- package/dist/es2015/kernel/append-queue.js +1 -1
- package/dist/es2015/kernel/dry-run.js +1 -1
- package/dist/es2015/kernel/mse.js +1 -1
- package/dist/es2015/kernel/prepare.js +2 -2
- package/dist/es2015/kernel/reducer.js +32 -12
- package/dist/es2015/kernel/refresh.js +1 -1
- package/dist/es2015/kernel/rendition-select.js +2 -2
- package/dist/es2015/kernel/scheduler.js +1 -1
- package/dist/es2015/kernel/timeline.js +1 -1
- package/dist/es2015/kernel/trace.js +2 -2
- package/dist/es2015/kernel/transport.js +2 -2
- package/dist/es2015/presets/define.js +2 -2
- package/dist/es2015/protocols/dash-cmaf/index.js +1 -1
- package/dist/es2015/protocols/dash-cmaf/parse.js +68 -44
- package/dist/es2015/protocols/dash-cmaf/periods-runtime.js +1 -1
- package/dist/es2015/protocols/dash-cmaf/periods.js +1 -1
- package/dist/es2015/protocols/dash-live/index.js +2 -2
- package/dist/es2015/protocols/hls-cmaf/index.js +1 -1
- package/dist/es2015/protocols/hls-cmaf/parse.js +1 -1
- package/dist/es2015/protocols/hls-cmaf/unavailable.js +1 -1
- package/dist/es2015/protocols/hls-live/index.js +1 -1
- package/dist/es2015/protocols/hls-ll/parse.js +1 -1
- package/dist/es2015/stages/abr/index.js +1 -1
- package/dist/es2015/stages/aes-128/index.js +1 -1
- package/dist/es2015/stages/chapters/index.js +2 -2
- package/dist/es2015/stages/chapters/parse.js +2 -2
- package/dist/es2015/stages/cmcd/index.js +1 -2
- package/dist/es2015/stages/codec-probe/index.js +1 -1
- package/dist/es2015/stages/content-steering/index.js +1 -1
- package/dist/es2015/stages/eme-core/index.js +2 -2
- package/dist/es2015/stages/eme-fairplay/index.js +1 -1
- package/dist/es2015/stages/hdr/index.js +1 -1
- package/dist/es2015/stages/interstitials/breaks.js +1 -1
- package/dist/es2015/stages/interstitials/index.js +2 -2
- package/dist/es2015/stages/projection/index.js +13 -3
- package/dist/es2015/stages/qoe/index.js +1 -1
- package/dist/es2015/stages/recovery/index.js +1 -1
- package/dist/es2015/stages/rendition-names/index.js +1 -1
- package/dist/es2015/stages/text-cea608/decode.js +1 -1
- package/dist/es2015/stages/text-cea708/decode.js +2 -2
- package/dist/es2015/stages/text-cea708/index.js +1 -1
- package/dist/es2015/stages/text-ttml/index.js +1 -1
- package/dist/es2015/stages/text-ttml/parse.js +1 -1
- package/dist/es2015/stages/thumbnails/index.js +1 -1
- package/dist/es2015/stages/timed-metadata/index.js +1 -1
- package/dist/es2015/stages/trick-play/index.js +1 -1
- package/dist/kernel/reducer.d.ts.map +1 -1
- package/dist/kernel/reducer.js +36 -11
- package/dist/kernel/reducer.js.map +1 -1
- package/dist/protocols/dash-cmaf/parse.d.ts.map +1 -1
- package/dist/protocols/dash-cmaf/parse.js +33 -0
- package/dist/protocols/dash-cmaf/parse.js.map +1 -1
- package/dist/stages/projection/index.d.ts.map +1 -1
- package/dist/stages/projection/index.js +15 -3
- package/dist/stages/projection/index.js.map +1 -1
- package/dist/types/ir.d.ts +9 -0
- package/dist/types/ir.d.ts.map +1 -1
- package/dist/types/kernel.d.ts +2 -0
- package/dist/types/kernel.d.ts.map +1 -1
- package/dist/types/messages.d.ts +10 -0
- package/dist/types/messages.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -22,15 +22,35 @@
|
|
|
22
22
|
* A cube map, a mesh, a fisheye, or bounds that crop anything else read as
|
|
23
23
|
* no projection: the engine names only what a player can draw from these
|
|
24
24
|
* two kinds.
|
|
25
|
+
*
|
|
26
|
+
* The same two families say how one frame holds a picture for each eye:
|
|
27
|
+
*
|
|
28
|
+
* - Apple's `vexu/pack/pkin` holds `view_packing_kind`, a fourcc: `side`
|
|
29
|
+
* for side by side, `over` for over and under. The left eye comes first
|
|
30
|
+
* unless `vexu/eyes/stri` sets `eye_views_reversed`.
|
|
31
|
+
* - Google's `st3d`, beside `sv3d`, holds `stereo_mode`: 1 is top and
|
|
32
|
+
* bottom, 2 left and right, both with the left eye first. 4 is right and
|
|
33
|
+
* left.
|
|
34
|
+
*
|
|
35
|
+
* A packing with the right eye first reads as none: the IR names the two
|
|
36
|
+
* with the left eye first.
|
|
25
37
|
*/
|
|
26
38
|
import type { Rendition } from '../types/ir.js';
|
|
27
39
|
/** A projection the IR names. */
|
|
28
40
|
type Projection = NonNullable<Rendition['projection']>;
|
|
41
|
+
/** A frame packing the IR names. */
|
|
42
|
+
type FramePacking = NonNullable<Rendition['framePacking']>;
|
|
29
43
|
/**
|
|
30
44
|
* The projection the first video track's sample entry states, or null for
|
|
31
45
|
* a flat picture, another projection, or bytes that are not an init
|
|
32
46
|
* segment. Never throws.
|
|
33
47
|
*/
|
|
34
48
|
export declare function readProjection(init: Uint8Array): Projection | null;
|
|
49
|
+
/**
|
|
50
|
+
* The frame packing the first video track's sample entry states, or null
|
|
51
|
+
* for one picture a frame, a packing with the right eye first, or bytes
|
|
52
|
+
* that are not an init segment. Never throws.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readFramePacking(init: Uint8Array): FramePacking | null;
|
|
35
55
|
export {};
|
|
36
56
|
//# sourceMappingURL=projection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/containers/projection.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../src/containers/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAWhD,iCAAiC;AACjC,KAAK,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;AAEvD,oCAAoC;AACpC,KAAK,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC;AAqF3D;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAElE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAEtE"}
|
|
@@ -38,12 +38,34 @@ function google(children) {
|
|
|
38
38
|
return 'equirectangular';
|
|
39
39
|
return left === QUARTER && right === QUARTER ? 'half-equirectangular' : null;
|
|
40
40
|
}
|
|
41
|
+
/** Apple's `pkin` kind, with the left eye first: `side` is side by side, `over` top and bottom. */
|
|
42
|
+
function applePacking(children) {
|
|
43
|
+
const pkin = under(children, 'vexu', 'pack', 'pkin');
|
|
44
|
+
const body = pkin === null ? undefined : fullBox(pkin)?.body;
|
|
45
|
+
if (body === undefined || body.byteLength < 4)
|
|
46
|
+
return null;
|
|
47
|
+
const stri = under(children, 'vexu', 'eyes', 'stri');
|
|
48
|
+
const flags = stri === null ? undefined : fullBox(stri)?.body;
|
|
49
|
+
// `eye_views_reversed` is the fifth bit of the one byte: the right eye comes first.
|
|
50
|
+
if (flags !== undefined && flags.byteLength > 0 && (flags[0] & 0x08) !== 0) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const kind = fourcc(body, 0);
|
|
54
|
+
return kind === 'side' ? 'side-by-side' : kind === 'over' ? 'top-bottom' : null;
|
|
55
|
+
}
|
|
56
|
+
/** Google's `stereo_mode`: 1 is top and bottom, 2 left and right. */
|
|
57
|
+
function googlePacking(children) {
|
|
58
|
+
const st3d = findBox(children, 'st3d')?.payload;
|
|
59
|
+
const body = st3d === undefined ? undefined : fullBox(st3d)?.body;
|
|
60
|
+
if (body === undefined || body.byteLength < 1)
|
|
61
|
+
return null;
|
|
62
|
+
return body[0] === 1 ? 'top-bottom' : body[0] === 2 ? 'side-by-side' : null;
|
|
63
|
+
}
|
|
41
64
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* segment. Never throws.
|
|
65
|
+
* What `read` finds in the first video track's sample entries, given the
|
|
66
|
+
* boxes after each entry's fixed header, or null. Never throws.
|
|
45
67
|
*/
|
|
46
|
-
|
|
68
|
+
function inVideoEntry(init, read) {
|
|
47
69
|
for (const trak of findBoxes(init, 'moov/trak')) {
|
|
48
70
|
// ISO/IEC 14496-12 §8.4.3: hdlr is a FullBox, then pre_defined(32), then handler_type.
|
|
49
71
|
const hdlr = findBox(trak.payload, 'mdia/hdlr');
|
|
@@ -57,12 +79,27 @@ export function readProjection(init) {
|
|
|
57
79
|
if (entry.body.byteLength < VISUAL_ENTRY_HEADER)
|
|
58
80
|
continue;
|
|
59
81
|
// An encrypted entry (encv) keeps these boxes too, beside its sinf.
|
|
60
|
-
const
|
|
61
|
-
const found = apple(children) ?? google(children);
|
|
82
|
+
const found = read(entry.body.subarray(VISUAL_ENTRY_HEADER));
|
|
62
83
|
if (found !== null)
|
|
63
84
|
return found;
|
|
64
85
|
}
|
|
65
86
|
}
|
|
66
87
|
return null;
|
|
67
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* The projection the first video track's sample entry states, or null for
|
|
91
|
+
* a flat picture, another projection, or bytes that are not an init
|
|
92
|
+
* segment. Never throws.
|
|
93
|
+
*/
|
|
94
|
+
export function readProjection(init) {
|
|
95
|
+
return inVideoEntry(init, (children) => apple(children) ?? google(children));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The frame packing the first video track's sample entry states, or null
|
|
99
|
+
* for one picture a frame, a packing with the right eye first, or bytes
|
|
100
|
+
* that are not an init segment. Never throws.
|
|
101
|
+
*/
|
|
102
|
+
export function readFramePacking(init) {
|
|
103
|
+
return inVideoEntry(init, (children) => applePacking(children) ?? googlePacking(children));
|
|
104
|
+
}
|
|
68
105
|
//# sourceMappingURL=projection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../src/containers/projection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../src/containers/projection.ts"],"names":[],"mappings":"AAsCA,OAAO,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,MAAM,GACP,MAAM,oBAAoB,CAAC;AAQ5B,uEAAuE;AACvE,MAAM,OAAO,GAAG,UAAU,CAAC;AAE3B,wFAAwF;AACxF,SAAS,KAAK,CAAC,MAAkB,EAAE,GAAG,IAAc;IAClD,IAAI,EAAE,GAAsB,MAAM,CAAC;IACnC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC7B,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,IAAI,C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,IAAI,IAAI,KAAK,IAAI;YAAE,SAAS;QAC5B,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,GAAG,mBAAmB;gBAAE,SAAS;YAC1D,oEAAoE;YACpE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;YAC7D,IAAI,KAAK,KAAK,IAAI;gBAAE,OAAO,KAAK,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAgB;IAC7C,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import toPropertyKey from "./toPropertyKey.js";
|
|
2
|
-
// \0@oxc-project+runtime@0.
|
|
2
|
+
// \0@oxc-project+runtime@0.159.0/helpers/esm/defineProperty.js
|
|
3
3
|
function _defineProperty(e, r, t) {
|
|
4
4
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
5
5
|
value: t,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "./defineProperty.js";
|
|
2
|
-
// \0@oxc-project+runtime@0.
|
|
2
|
+
// \0@oxc-project+runtime@0.159.0/helpers/esm/objectSpread2.js
|
|
3
3
|
function ownKeys(e, r) {
|
|
4
4
|
var t = Object.keys(e);
|
|
5
5
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose.js";
|
|
2
|
-
// \0@oxc-project+runtime@0.
|
|
2
|
+
// \0@oxc-project+runtime@0.159.0/helpers/esm/objectWithoutProperties.js
|
|
3
3
|
function _objectWithoutProperties(e, t) {
|
|
4
4
|
if (null == e) return {};
|
|
5
5
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _typeof from "./typeof.js";
|
|
2
2
|
import toPrimitive from "./toPrimitive.js";
|
|
3
|
-
// \0@oxc-project+runtime@0.
|
|
3
|
+
// \0@oxc-project+runtime@0.159.0/helpers/esm/toPropertyKey.js
|
|
4
4
|
function toPropertyKey(t) {
|
|
5
5
|
var i = toPrimitive(t, "string");
|
|
6
6
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -30,7 +30,7 @@ function parseEmsg(payload) {
|
|
|
30
30
|
value: value[0],
|
|
31
31
|
timescale: view.getUint32(cursor),
|
|
32
32
|
time: view.getUint32(cursor + 4),
|
|
33
|
-
duration: duration ===
|
|
33
|
+
duration: duration === 0xffffffff ? null : duration,
|
|
34
34
|
id: view.getUint32(cursor + 12),
|
|
35
35
|
data: payload.subarray(cursor + 16)
|
|
36
36
|
};
|
|
@@ -50,7 +50,7 @@ function parseEmsg(payload) {
|
|
|
50
50
|
value: value[0],
|
|
51
51
|
timescale,
|
|
52
52
|
time,
|
|
53
|
-
duration: duration ===
|
|
53
|
+
duration: duration === 0xffffffff ? null : duration,
|
|
54
54
|
id,
|
|
55
55
|
data: payload.subarray(value[1])
|
|
56
56
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findBox, fragmentSamples, fullBox, viewOf } from "../mp4-box/index.js";
|
|
2
2
|
import { writeMediaSegment } from "./writer.js";
|
|
3
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
// src/containers/fmp4/fit.ts
|
|
5
5
|
/**
|
|
6
6
|
* The first traf's per-sample encryption entries, null for a clear
|
|
@@ -50,7 +50,7 @@ function concat(...parts) {
|
|
|
50
50
|
}
|
|
51
51
|
return out;
|
|
52
52
|
}
|
|
53
|
-
const UNITY_MATRIX = concat(u32(65536), u32(0), u32(0), u32(0), u32(65536), u32(0), u32(0), u32(0), u32(
|
|
53
|
+
const UNITY_MATRIX = concat(u32(65536), u32(0), u32(0), u32(0), u32(65536), u32(0), u32(0), u32(0), u32(0x40000000));
|
|
54
54
|
function ftyp() {
|
|
55
55
|
return box("ftyp", u8(...fourcc("isom")), u32(512), u8(...fourcc("isom")), u8(...fourcc("iso6")), u8(...fourcc("mp41")));
|
|
56
56
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fourcc } from "./mp4-box/index.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
// src/containers/id3.ts
|
|
4
4
|
const HEADER_SIZE = 10;
|
|
5
5
|
function isId3(data, offset) {
|
|
@@ -171,9 +171,9 @@ function parseSidx(payload) {
|
|
|
171
171
|
for (let i = 0; i < count; i += 1) {
|
|
172
172
|
const word = view.getUint32(at);
|
|
173
173
|
references.push({
|
|
174
|
-
referencedSize: word &
|
|
174
|
+
referencedSize: word & 0x7fffffff,
|
|
175
175
|
subsegmentDuration: view.getUint32(at + 4),
|
|
176
|
-
startsWithSap: (view.getUint32(at + 8) &
|
|
176
|
+
startsWithSap: (view.getUint32(at + 8) & 0x80000000) !== 0
|
|
177
177
|
});
|
|
178
178
|
at += 12;
|
|
179
179
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findBox, findBoxes, fourcc, fullBox, sampleEntries, viewOf } from "./mp4-box/index.js";
|
|
2
2
|
// src/containers/projection.ts
|
|
3
3
|
/** A quarter of the sphere's width in 0.32 fixed point: 0.25 × 2³². */
|
|
4
|
-
const QUARTER =
|
|
4
|
+
const QUARTER = 0x40000000;
|
|
5
5
|
/** The box `type` under `parent`, or null. Each step searches one level of children. */
|
|
6
6
|
function under(parent, ...path) {
|
|
7
7
|
let at = parent;
|
|
@@ -42,27 +42,66 @@ function google(children) {
|
|
|
42
42
|
if (left === 0 && right === 0) return "equirectangular";
|
|
43
43
|
return left === QUARTER && right === QUARTER ? "half-equirectangular" : null;
|
|
44
44
|
}
|
|
45
|
+
/** Apple's `pkin` kind, with the left eye first: `side` is side by side, `over` top and bottom. */
|
|
46
|
+
function applePacking(children) {
|
|
47
|
+
var _fullBox3, _fullBox4;
|
|
48
|
+
const pkin = under(children, "vexu", "pack", "pkin");
|
|
49
|
+
const body = pkin === null ? void 0 : (_fullBox3 = fullBox(pkin)) === null || _fullBox3 === void 0 ? void 0 : _fullBox3.body;
|
|
50
|
+
if (body === void 0 || body.byteLength < 4) return null;
|
|
51
|
+
const stri = under(children, "vexu", "eyes", "stri");
|
|
52
|
+
const flags = stri === null ? void 0 : (_fullBox4 = fullBox(stri)) === null || _fullBox4 === void 0 ? void 0 : _fullBox4.body;
|
|
53
|
+
if (flags !== void 0 && flags.byteLength > 0 && (flags[0] & 8) !== 0) return null;
|
|
54
|
+
const kind = fourcc(body, 0);
|
|
55
|
+
return kind === "side" ? "side-by-side" : kind === "over" ? "top-bottom" : null;
|
|
56
|
+
}
|
|
57
|
+
/** Google's `stereo_mode`: 1 is top and bottom, 2 left and right. */
|
|
58
|
+
function googlePacking(children) {
|
|
59
|
+
var _findBox2, _fullBox5;
|
|
60
|
+
const st3d = (_findBox2 = findBox(children, "st3d")) === null || _findBox2 === void 0 ? void 0 : _findBox2.payload;
|
|
61
|
+
const body = st3d === void 0 ? void 0 : (_fullBox5 = fullBox(st3d)) === null || _fullBox5 === void 0 ? void 0 : _fullBox5.body;
|
|
62
|
+
if (body === void 0 || body.byteLength < 1) return null;
|
|
63
|
+
return body[0] === 1 ? "top-bottom" : body[0] === 2 ? "side-by-side" : null;
|
|
64
|
+
}
|
|
45
65
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* segment. Never throws.
|
|
66
|
+
* What `read` finds in the first video track's sample entries, given the
|
|
67
|
+
* boxes after each entry's fixed header, or null. Never throws.
|
|
49
68
|
*/
|
|
50
|
-
function
|
|
69
|
+
function inVideoEntry(init, read) {
|
|
51
70
|
for (const trak of findBoxes(init, "moov/trak")) {
|
|
52
|
-
var
|
|
71
|
+
var _fullBox6;
|
|
53
72
|
const hdlr = findBox(trak.payload, "mdia/hdlr");
|
|
54
|
-
const handler = hdlr === null ? void 0 : (
|
|
73
|
+
const handler = hdlr === null ? void 0 : (_fullBox6 = fullBox(hdlr.payload)) === null || _fullBox6 === void 0 ? void 0 : _fullBox6.body;
|
|
55
74
|
if (handler === void 0 || handler.byteLength < 8 || fourcc(handler, 4) !== "vide") continue;
|
|
56
75
|
const stsd = findBox(trak.payload, "mdia/minf/stbl/stsd");
|
|
57
76
|
if (stsd === null) continue;
|
|
58
77
|
for (const entry of sampleEntries(stsd.payload)) {
|
|
59
|
-
var _apple;
|
|
60
78
|
if (entry.body.byteLength < 78) continue;
|
|
61
|
-
const
|
|
62
|
-
const found = (_apple = apple(children)) !== null && _apple !== void 0 ? _apple : google(children);
|
|
79
|
+
const found = read(entry.body.subarray(78));
|
|
63
80
|
if (found !== null) return found;
|
|
64
81
|
}
|
|
65
82
|
}
|
|
66
83
|
return null;
|
|
67
84
|
}
|
|
68
|
-
|
|
85
|
+
/**
|
|
86
|
+
* The projection the first video track's sample entry states, or null for
|
|
87
|
+
* a flat picture, another projection, or bytes that are not an init
|
|
88
|
+
* segment. Never throws.
|
|
89
|
+
*/
|
|
90
|
+
function readProjection(init) {
|
|
91
|
+
return inVideoEntry(init, (children) => {
|
|
92
|
+
var _apple;
|
|
93
|
+
return (_apple = apple(children)) !== null && _apple !== void 0 ? _apple : google(children);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The frame packing the first video track's sample entry states, or null
|
|
98
|
+
* for one picture a frame, a packing with the right eye first, or bytes
|
|
99
|
+
* that are not an init segment. Never throws.
|
|
100
|
+
*/
|
|
101
|
+
function readFramePacking(init) {
|
|
102
|
+
return inVideoEntry(init, (children) => {
|
|
103
|
+
var _applePacking;
|
|
104
|
+
return (_applePacking = applePacking(children)) !== null && _applePacking !== void 0 ? _applePacking : googlePacking(children);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export { readFramePacking, readProjection };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
// src/containers/scte35.ts
|
|
3
3
|
const TABLE_ID = 252;
|
|
4
4
|
const SPLICE_INSERT = 5;
|
|
@@ -54,7 +54,7 @@ function ccTriplesFromSei(seiNal, headerLength = 1) {
|
|
|
54
54
|
}
|
|
55
55
|
return triples;
|
|
56
56
|
}
|
|
57
|
-
const GA94 =
|
|
57
|
+
const GA94 = 0x47413934;
|
|
58
58
|
function appendAtscCc(payload, out) {
|
|
59
59
|
if (payload.byteLength < 10) return;
|
|
60
60
|
const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
@@ -38,7 +38,7 @@ function readTimestamp(data, offset) {
|
|
|
38
38
|
const high = b0 >> 1 & 7;
|
|
39
39
|
const mid = (b1 << 7 | b2 >> 1) & 32767;
|
|
40
40
|
const low = (b3 << 7 | b4 >> 1) & 32767;
|
|
41
|
-
return high *
|
|
41
|
+
return high * 0x40000000 + mid * 32768 + low;
|
|
42
42
|
}
|
|
43
43
|
/** Parses one completed PES accumulator into a packet with timestamps. */
|
|
44
44
|
function finishPes(acc) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toRbsp } from "../sei.js";
|
|
2
|
-
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/defineProperty.js";
|
|
3
3
|
// src/containers/ts-transmux/h264.ts
|
|
4
4
|
/**
|
|
5
5
|
* H.264 Annex B to AVCC. The elementary stream separates NAL units with
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toRbsp } from "../sei.js";
|
|
2
|
-
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/defineProperty.js";
|
|
3
3
|
// src/containers/ts-transmux/h265.ts
|
|
4
4
|
/**
|
|
5
5
|
* H.265 Annex B to the hvc1 sample format. The NAL units split on start
|
|
@@ -4,7 +4,7 @@ import { deliverMetadata, metadataWanted } from "../metadata.js";
|
|
|
4
4
|
import { createTransmuxRunner } from "./runner.js";
|
|
5
5
|
import { looksLikeTransportStream } from "./sniff.js";
|
|
6
6
|
import { transmuxSource } from "./source.js";
|
|
7
|
-
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.
|
|
7
|
+
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
|
|
8
8
|
// src/containers/ts-transmux/index.ts
|
|
9
9
|
/** Runs after decrypt-class steps (lower order) and before caption extraction. */
|
|
10
10
|
const TRANSMUX_ORDER = 100;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
|
|
2
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
// src/containers/ts-transmux/runner.ts
|
|
4
4
|
function createTransmuxRunner(options, source) {
|
|
5
5
|
let worker = null;
|
|
@@ -4,7 +4,7 @@ import { ccTriplesFromSei } from "../sei.js";
|
|
|
4
4
|
import { STREAM_TYPE, demux, unrollTimestamps } from "./demux.js";
|
|
5
5
|
import { NAL_TYPE, accessUnitFromNals, nalType, splitNalUnits, spsDimensions, toAccessUnit } from "./h264.js";
|
|
6
6
|
import { HEVC_NAL_TYPE, hevcAccessUnitFromNals, hevcDecoderConfiguration, hevcNalType, hevcSpsInfo } from "./h265.js";
|
|
7
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
7
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
8
8
|
// src/containers/ts-transmux/transmux.ts
|
|
9
9
|
/**
|
|
10
10
|
* The transmux core: MPEG-TS bytes to a self-contained fragmented MP4. Each
|
|
@@ -3,7 +3,7 @@ import { findRendition } from "../../kernel/presentation.js";
|
|
|
3
3
|
import { activeRenditions } from "../../kernel/rendition-select.js";
|
|
4
4
|
import { isUnresolved } from "../../kernel/timeline.js";
|
|
5
5
|
import { cuesToSegments, readCues, readInit } from "./cues.js";
|
|
6
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
6
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
7
7
|
// src/containers/webm/index.ts
|
|
8
8
|
/**
|
|
9
9
|
* WebM segments in DASH. MSE takes `video/webm` and `audio/webm` as they
|
|
@@ -191,10 +191,7 @@ const createReduceWebm = (retryMs) => (slice, msg, kernel) => {
|
|
|
191
191
|
if (msg.renditionId in state.asked) return [forget(state, msg.renditionId), []];
|
|
192
192
|
}
|
|
193
193
|
if (msg.type === "SEGMENT_LOADED" && msg.trackId in state.pending) return received(state, kernel, msg.trackId, msg.bytes, retryMs);
|
|
194
|
-
if (msg.type === "SEGMENT_FAILED" && msg.trackId in state.pending)
|
|
195
|
-
const renditionId = state.pending[msg.trackId];
|
|
196
|
-
return unavailable(state, kernel, renditionId, msg.error, retryMs);
|
|
197
|
-
}
|
|
194
|
+
if (msg.type === "SEGMENT_FAILED" && msg.trackId in state.pending) return unavailable(state, kernel, state.pending[msg.trackId], msg.error, retryMs);
|
|
198
195
|
if (kernel.lifecycle.phase !== "ready" || kernel.presentation === null) return [state, []];
|
|
199
196
|
const key = `${kernel.quality.version}:${kernel.quality.active}`;
|
|
200
197
|
if (key === state.seen && msg.type !== "RESUME") return [state, []];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
// src/containers/webvtt.ts
|
|
3
3
|
/** `HH:MM:SS.mmm` or `MM:SS.mmm` to seconds, or null. */
|
|
4
4
|
function parseTimestamp(text) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fourcc, viewOf } from "./mp4-box/index.js";
|
|
2
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
3
3
|
// src/containers/wvtt.ts
|
|
4
4
|
/** The child boxes of `bytes`, as type and payload. */
|
|
5
5
|
function boxes(bytes) {
|
package/dist/es2015/eme/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fetchWithin } from "../kernel/transport.js";
|
|
2
2
|
import emeCore from "../stages/eme-core/index.js";
|
|
3
|
-
import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
5
|
-
import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
|
|
4
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
5
|
+
import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
|
|
6
6
|
// src/eme/index.ts
|
|
7
7
|
/**
|
|
8
8
|
* The engine's DRM on an element the engine does not drive. On Safari a
|
package/dist/es2015/index.js
CHANGED
|
@@ -12,8 +12,8 @@ import { activeAudio, availableGroups, canSwitchTo, createArbiter, exclusionsOf
|
|
|
12
12
|
import { createMseSink } from "./kernel/sinks/mse-sink.js";
|
|
13
13
|
import { createTrackRegistry } from "./kernel/track-registry.js";
|
|
14
14
|
import { createTransport } from "./kernel/transport.js";
|
|
15
|
-
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.
|
|
16
|
-
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.
|
|
15
|
+
import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
16
|
+
import _asyncToGenerator from "./_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
|
|
17
17
|
import { isAudioDescription, isEnhancedSpeech, isOriginal, isSdh, videoKind } from "./kernel/characteristics.js";
|
|
18
18
|
import { exportTrace, replay } from "./kernel/trace.js";
|
|
19
19
|
// src/index.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
// src/kernel/append-queue.ts
|
|
3
3
|
function isQuotaError(err) {
|
|
4
4
|
return err instanceof DOMException && err.name === "QuotaExceededError";
|
|
@@ -2,7 +2,7 @@ import { createBus } from "./bus.js";
|
|
|
2
2
|
import { createEffectRunner } from "./effects.js";
|
|
3
3
|
import { createSegmentPreparer } from "./prepare.js";
|
|
4
4
|
import { createReducer, initialState } from "./reducer.js";
|
|
5
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
5
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
6
6
|
// src/kernel/dry-run.ts
|
|
7
7
|
/** The whole run ends here, whatever it has fetched: a preload must not outlive its use. */
|
|
8
8
|
const LIMIT_MS = 1e4;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAppendQueue } from "./append-queue.js";
|
|
2
2
|
import { createEvictor } from "./evictor.js";
|
|
3
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
4
4
|
// src/kernel/mse.ts
|
|
5
5
|
function managedMediaSource() {
|
|
6
6
|
return globalThis.ManagedMediaSource;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
2
|
-
import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import _asyncToGenerator from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/asyncToGenerator.js";
|
|
3
3
|
// src/kernel/prepare.ts
|
|
4
4
|
/**
|
|
5
5
|
* The boundary meta a transform and the probe receive. The content type
|
|
@@ -6,8 +6,8 @@ import { activeAudio, audioGroup, audioInGroup, availableGroups, canSwitchTo, co
|
|
|
6
6
|
import { bufferedEndFrom, reachesEnd, schedule } from "./scheduler.js";
|
|
7
7
|
import { sbIdFor } from "./sinks/mse-sink.js";
|
|
8
8
|
import { reconciledOffset, segmentAtTime } from "./timeline.js";
|
|
9
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
10
|
-
import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.
|
|
9
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
10
|
+
import _objectWithoutProperties from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectWithoutProperties.js";
|
|
11
11
|
// src/kernel/reducer.ts
|
|
12
12
|
const _excluded = ["pendingInit"];
|
|
13
13
|
const _excluded2 = ["repeat"];
|
|
@@ -648,7 +648,7 @@ function reduceCommand(state, msg, cfg, hooks) {
|
|
|
648
648
|
if (site === null) return reject(state, msg.type, `unknown rendition: ${msg.renditionId}`);
|
|
649
649
|
if (site.rendition.projection !== void 0) return reject(state, msg.type, `projection exists: ${msg.renditionId}`);
|
|
650
650
|
const projections = new Map(state.tracks.projections).set(msg.renditionId, msg.projection);
|
|
651
|
-
const presentation =
|
|
651
|
+
const presentation = withStated(state.presentation, projections, void 0);
|
|
652
652
|
return [_objectSpread2(_objectSpread2({}, state), {}, {
|
|
653
653
|
presentation,
|
|
654
654
|
tracks: _objectSpread2(_objectSpread2({}, state.tracks), {}, { projections })
|
|
@@ -658,18 +658,37 @@ function reduceCommand(state, msg, cfg, hooks) {
|
|
|
658
658
|
payload: { id: presentation.id }
|
|
659
659
|
}]];
|
|
660
660
|
}
|
|
661
|
+
case "SET_FRAME_PACKING": {
|
|
662
|
+
if (state.presentation === null) return reject(state, msg.type, "no source");
|
|
663
|
+
const site = findRendition(state.presentation, msg.renditionId);
|
|
664
|
+
if (site === null) return reject(state, msg.type, `unknown rendition: ${msg.renditionId}`);
|
|
665
|
+
if (site.rendition.framePacking !== void 0) return reject(state, msg.type, `frame packing exists: ${msg.renditionId}`);
|
|
666
|
+
const framePackings = new Map(state.tracks.framePackings).set(msg.renditionId, msg.framePacking);
|
|
667
|
+
const presentation = withStated(state.presentation, void 0, framePackings);
|
|
668
|
+
return [_objectSpread2(_objectSpread2({}, state), {}, {
|
|
669
|
+
presentation,
|
|
670
|
+
tracks: _objectSpread2(_objectSpread2({}, state.tracks), {}, { framePackings })
|
|
671
|
+
}), [{
|
|
672
|
+
kind: "emit",
|
|
673
|
+
event: "presentation:changed",
|
|
674
|
+
payload: { id: presentation.id }
|
|
675
|
+
}]];
|
|
676
|
+
}
|
|
661
677
|
}
|
|
662
678
|
}
|
|
663
679
|
/**
|
|
664
|
-
* Gives every rendition SET_PROJECTION
|
|
665
|
-
* presentation states none. A playlist merge
|
|
666
|
-
* adapter's presentation, which knows nothing of them.
|
|
680
|
+
* Gives every rendition SET_PROJECTION or SET_FRAME_PACKING named what the
|
|
681
|
+
* command stated, where the presentation states none. A playlist merge
|
|
682
|
+
* hands the reducer the adapter's presentation, which knows nothing of them.
|
|
667
683
|
*/
|
|
668
|
-
function
|
|
669
|
-
if (projections === void 0
|
|
684
|
+
function withStated(presentation, projections, framePackings) {
|
|
685
|
+
if (!(projections === null || projections === void 0 ? void 0 : projections.size) && !(framePackings === null || framePackings === void 0 ? void 0 : framePackings.size)) return presentation;
|
|
670
686
|
return _objectSpread2(_objectSpread2({}, presentation), {}, { periods: presentation.periods.map((period) => _objectSpread2(_objectSpread2({}, period), {}, { tracks: period.tracks.map((track) => _objectSpread2(_objectSpread2({}, track), {}, { renditions: track.renditions.map((rendition) => {
|
|
671
|
-
|
|
672
|
-
|
|
687
|
+
var _rendition$projection, _rendition$framePacki;
|
|
688
|
+
const projection = (_rendition$projection = rendition.projection) !== null && _rendition$projection !== void 0 ? _rendition$projection : projections === null || projections === void 0 ? void 0 : projections.get(rendition.id);
|
|
689
|
+
const framePacking = (_rendition$framePacki = rendition.framePacking) !== null && _rendition$framePacki !== void 0 ? _rendition$framePacki : framePackings === null || framePackings === void 0 ? void 0 : framePackings.get(rendition.id);
|
|
690
|
+
if (projection === rendition.projection && framePacking === rendition.framePacking) return rendition;
|
|
691
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, rendition), projection === void 0 ? {} : { projection }), framePacking === void 0 ? {} : { framePacking });
|
|
673
692
|
}) })) })) });
|
|
674
693
|
}
|
|
675
694
|
/**
|
|
@@ -724,7 +743,7 @@ function behindTrick(tracks, track, previous) {
|
|
|
724
743
|
* merged into it. Activates default tracks and reports what changed.
|
|
725
744
|
*/
|
|
726
745
|
function loadPresentation(state, merged, undecodableIds = /* @__PURE__ */ new Set()) {
|
|
727
|
-
const presentation =
|
|
746
|
+
const presentation = withStated(withAdded(merged, state.tracks.added), state.tracks.projections, state.tracks.framePackings);
|
|
728
747
|
const available = [];
|
|
729
748
|
for (const period of presentation.periods) for (const track of period.tracks) available.push(track.id);
|
|
730
749
|
const inflight = new Map(state.scheduling.inflight);
|
|
@@ -1470,7 +1489,8 @@ const COMMAND_TYPES = {
|
|
|
1470
1489
|
RESOLVE_RENDITION: true,
|
|
1471
1490
|
ABORT_INFLIGHT: true,
|
|
1472
1491
|
ADD_TRACK: true,
|
|
1473
|
-
SET_PROJECTION: true
|
|
1492
|
+
SET_PROJECTION: true,
|
|
1493
|
+
SET_FRAME_PACKING: true
|
|
1474
1494
|
};
|
|
1475
1495
|
function isCommand(msg) {
|
|
1476
1496
|
return msg.type in COMMAND_TYPES;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.159.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
// src/kernel/refresh.ts
|
|
3
3
|
/** The presentation with the refresh merged, or null when it names no rendition the presentation holds. */
|
|
4
4
|
function applyRefresh(presentation, refresh) {
|