@stinkycomputing/web-live-player 0.1.10 → 0.1.11
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/dist/web-live-player.cjs +1 -1
- package/dist/web-live-player.mjs +484 -420
- package/package.json +2 -2
package/dist/web-live-player.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var cr = Object.defineProperty;
|
|
2
|
+
var Ur = (u, o, l) => o in u ? cr(u, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : u[o] = l;
|
|
3
|
+
var U = (u, o, l) => (Ur(u, typeof o != "symbol" ? o + "" : o, l), l), ir = (u, o, l) => {
|
|
4
4
|
if (!o.has(u))
|
|
5
5
|
throw TypeError("Cannot " + l);
|
|
6
6
|
};
|
|
@@ -28,8 +28,8 @@ const consoleLogger = {
|
|
|
28
28
|
};
|
|
29
29
|
class BaseStreamSource {
|
|
30
30
|
constructor() {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
U(this, "handlers", /* @__PURE__ */ new Map());
|
|
32
|
+
U(this, "_connected", !1);
|
|
33
33
|
}
|
|
34
34
|
get connected() {
|
|
35
35
|
return this._connected;
|
|
@@ -59,9 +59,9 @@ function createLogger(u) {
|
|
|
59
59
|
}
|
|
60
60
|
class BasePlayer {
|
|
61
61
|
constructor(o, l = !1) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
U(this, "eventHandlers", /* @__PURE__ */ new Map());
|
|
63
|
+
U(this, "logger");
|
|
64
|
+
U(this, "_state");
|
|
65
65
|
this._state = o, this.logger = createLogger(l);
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -141,17 +141,17 @@ function getCodecString(u) {
|
|
|
141
141
|
}
|
|
142
142
|
class WebCodecsDecoder {
|
|
143
143
|
constructor(o = {}) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
U(this, "decoder", null);
|
|
145
|
+
U(this, "config");
|
|
146
|
+
U(this, "flushing", !1);
|
|
147
|
+
U(this, "logger");
|
|
148
|
+
U(this, "maxQueueSize");
|
|
149
|
+
U(this, "onFrameDecoded");
|
|
150
|
+
U(this, "onError");
|
|
151
|
+
U(this, "onQueueOverflow");
|
|
152
152
|
// Statistics
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
U(this, "chunksSentToDecoder", 0);
|
|
154
|
+
U(this, "framesDecoded", 0);
|
|
155
155
|
this.logger = o.logger ?? consoleLogger, this.onFrameDecoded = o.onFrameDecoded ?? o.onFrame, this.onError = o.onError, this.onQueueOverflow = o.onQueueOverflow, this.maxQueueSize = o.maxQueueSize ?? 10, this.createDecoder();
|
|
156
156
|
}
|
|
157
157
|
get decodeQueueSize() {
|
|
@@ -229,7 +229,7 @@ class WebCodecsDecoder {
|
|
|
229
229
|
* Decode a binary packet
|
|
230
230
|
*/
|
|
231
231
|
decodeBinary(o) {
|
|
232
|
-
var e, i, a, s, d,
|
|
232
|
+
var e, i, a, s, d, c;
|
|
233
233
|
if (this.flushing) {
|
|
234
234
|
this.logger.warn("Received packet while flushing");
|
|
235
235
|
return;
|
|
@@ -242,7 +242,7 @@ class WebCodecsDecoder {
|
|
|
242
242
|
}
|
|
243
243
|
const l = (i = (e = o.header.media) == null ? void 0 : e.codecData) != null && i.timebaseDen && ((s = (a = o.header.media) == null ? void 0 : a.codecData) != null && s.timebaseNum) ? { num: o.header.media.codecData.timebaseNum, den: o.header.media.codecData.timebaseDen } : { num: 1, den: 1e6 }, n = { num: 1, den: 1e6 }, r = rescaleTime(((d = o.header.media) == null ? void 0 : d.pts) ?? 0, l, n), t = new EncodedVideoChunk({
|
|
244
244
|
timestamp: r,
|
|
245
|
-
type: (
|
|
245
|
+
type: (c = o.header.media) != null && c.keyframe ? "key" : "delta",
|
|
246
246
|
data: o.payload ?? new Uint8Array(0)
|
|
247
247
|
});
|
|
248
248
|
try {
|
|
@@ -324,15 +324,15 @@ function WorkerWrapper() {
|
|
|
324
324
|
}
|
|
325
325
|
class WasmDecoder {
|
|
326
326
|
constructor(o = {}) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
327
|
+
U(this, "worker");
|
|
328
|
+
U(this, "_queueSize", 0);
|
|
329
|
+
U(this, "pendingTimestamps", []);
|
|
330
|
+
U(this, "pendingFrames", []);
|
|
331
|
+
U(this, "onFrameDecoded");
|
|
332
|
+
U(this, "onError");
|
|
333
333
|
// @ts-ignore - kept for future use
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
U(this, "onQueueOverflow");
|
|
335
|
+
U(this, "configured", !1);
|
|
336
336
|
this.onFrameDecoded = o.onFrameDecoded, this.onError = o.onError, this.onQueueOverflow = o.onQueueOverflow;
|
|
337
337
|
}
|
|
338
338
|
get queueSize() {
|
|
@@ -406,10 +406,10 @@ class WasmDecoder {
|
|
|
406
406
|
handlePictureReady(o) {
|
|
407
407
|
var E;
|
|
408
408
|
this._queueSize--;
|
|
409
|
-
const { width: l, height: n, data: r } = o, t = new Uint8Array(r), e = l, i = e * n, a = i >> 2, s = t.subarray(0, i), d = t.subarray(i, i + a),
|
|
409
|
+
const { width: l, height: n, data: r } = o, t = new Uint8Array(r), e = l, i = e * n, a = i >> 2, s = t.subarray(0, i), d = t.subarray(i, i + a), c = t.subarray(i + a, i + 2 * a), F = n >> 1, B = e >> 1, S = this.pendingTimestamps.shift() ?? 0, y = {
|
|
410
410
|
y: s,
|
|
411
411
|
u: d,
|
|
412
|
-
v:
|
|
412
|
+
v: c,
|
|
413
413
|
width: l,
|
|
414
414
|
height: n,
|
|
415
415
|
chromaStride: B,
|
|
@@ -447,38 +447,38 @@ class WasmDecoder {
|
|
|
447
447
|
}
|
|
448
448
|
class FrameScheduler {
|
|
449
449
|
constructor(o = {}) {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
U(this, "buffer", []);
|
|
451
|
+
U(this, "bufferDelayMs");
|
|
452
|
+
U(this, "maxBufferSize");
|
|
453
453
|
// Timing synchronization
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
U(this, "startRealTimeUs", null);
|
|
455
|
+
U(this, "startStreamTimeUs", null);
|
|
456
|
+
U(this, "frameDurationUs", 2e4);
|
|
457
457
|
// Default 50fps
|
|
458
|
-
|
|
458
|
+
U(this, "lastFrameTimestamp", null);
|
|
459
459
|
// Drift correction
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
460
|
+
U(this, "bufferSizeHistory", []);
|
|
461
|
+
U(this, "driftCheckInterval");
|
|
462
|
+
U(this, "driftThresholdMs");
|
|
463
|
+
U(this, "dequeueCount", 0);
|
|
464
464
|
// Latency tracking
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
U(this, "latencyHistory", []);
|
|
466
|
+
U(this, "latencyHistorySize", 60);
|
|
467
467
|
// About 1 second at 60fps
|
|
468
468
|
// Packet timing history for visualization
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
U(this, "packetTimingHistory", []);
|
|
470
|
+
U(this, "packetTimingHistorySize", 300);
|
|
471
471
|
// ~5 seconds at 60fps
|
|
472
|
-
|
|
472
|
+
U(this, "lastPacketArrivalTime", null);
|
|
473
473
|
// Statistics
|
|
474
|
-
|
|
474
|
+
U(this, "stats", {
|
|
475
475
|
dropped: 0,
|
|
476
476
|
enqueued: 0,
|
|
477
477
|
dequeued: 0,
|
|
478
478
|
driftCorrections: 0
|
|
479
479
|
});
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
U(this, "logger");
|
|
481
|
+
U(this, "onFrameDropped");
|
|
482
482
|
this.bufferDelayMs = o.bufferDelayMs ?? 100;
|
|
483
483
|
const l = Math.ceil(this.bufferDelayMs / 1e3 * 60 * 2);
|
|
484
484
|
this.maxBufferSize = o.maxBufferSize ?? Math.max(30, l), this.driftCheckInterval = o.driftCheckInterval ?? 150, this.driftThresholdMs = o.driftCorrectionThresholdMs ?? 30, this.logger = o.logger ?? (() => {
|
|
@@ -655,9 +655,9 @@ function asPromise(u, o) {
|
|
|
655
655
|
if (t = !1, d)
|
|
656
656
|
a(d);
|
|
657
657
|
else {
|
|
658
|
-
for (var
|
|
659
|
-
|
|
660
|
-
i.apply(null,
|
|
658
|
+
for (var c = new Array(arguments.length - 1), F = 0; F < c.length; )
|
|
659
|
+
c[F++] = arguments[F];
|
|
660
|
+
i.apply(null, c);
|
|
661
661
|
}
|
|
662
662
|
};
|
|
663
663
|
try {
|
|
@@ -681,47 +681,47 @@ var base64$1 = {};
|
|
|
681
681
|
for (var l = new Array(64), n = new Array(123), r = 0; r < 64; )
|
|
682
682
|
n[l[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
|
|
683
683
|
o.encode = function(i, a, s) {
|
|
684
|
-
for (var d = null,
|
|
684
|
+
for (var d = null, c = [], F = 0, B = 0, S; a < s; ) {
|
|
685
685
|
var y = i[a++];
|
|
686
686
|
switch (B) {
|
|
687
687
|
case 0:
|
|
688
|
-
|
|
688
|
+
c[F++] = l[y >> 2], S = (y & 3) << 4, B = 1;
|
|
689
689
|
break;
|
|
690
690
|
case 1:
|
|
691
|
-
|
|
691
|
+
c[F++] = l[S | y >> 4], S = (y & 15) << 2, B = 2;
|
|
692
692
|
break;
|
|
693
693
|
case 2:
|
|
694
|
-
|
|
694
|
+
c[F++] = l[S | y >> 6], c[F++] = l[y & 63], B = 0;
|
|
695
695
|
break;
|
|
696
696
|
}
|
|
697
|
-
F > 8191 && ((d || (d = [])).push(String.fromCharCode.apply(String,
|
|
697
|
+
F > 8191 && ((d || (d = [])).push(String.fromCharCode.apply(String, c)), F = 0);
|
|
698
698
|
}
|
|
699
|
-
return B && (
|
|
699
|
+
return B && (c[F++] = l[S], c[F++] = 61, B === 1 && (c[F++] = 61)), d ? (F && d.push(String.fromCharCode.apply(String, c.slice(0, F))), d.join("")) : String.fromCharCode.apply(String, c.slice(0, F));
|
|
700
700
|
};
|
|
701
701
|
var t = "invalid encoding";
|
|
702
702
|
o.decode = function(i, a, s) {
|
|
703
|
-
for (var d = s,
|
|
703
|
+
for (var d = s, c = 0, F, B = 0; B < i.length; ) {
|
|
704
704
|
var S = i.charCodeAt(B++);
|
|
705
|
-
if (S === 61 &&
|
|
705
|
+
if (S === 61 && c > 1)
|
|
706
706
|
break;
|
|
707
707
|
if ((S = n[S]) === void 0)
|
|
708
708
|
throw Error(t);
|
|
709
|
-
switch (
|
|
709
|
+
switch (c) {
|
|
710
710
|
case 0:
|
|
711
|
-
F = S,
|
|
711
|
+
F = S, c = 1;
|
|
712
712
|
break;
|
|
713
713
|
case 1:
|
|
714
|
-
a[s++] = F << 2 | (S & 48) >> 4, F = S,
|
|
714
|
+
a[s++] = F << 2 | (S & 48) >> 4, F = S, c = 2;
|
|
715
715
|
break;
|
|
716
716
|
case 2:
|
|
717
|
-
a[s++] = (F & 15) << 4 | (S & 60) >> 2, F = S,
|
|
717
|
+
a[s++] = (F & 15) << 4 | (S & 60) >> 2, F = S, c = 3;
|
|
718
718
|
break;
|
|
719
719
|
case 3:
|
|
720
|
-
a[s++] = (F & 3) << 6 | S,
|
|
720
|
+
a[s++] = (F & 3) << 6 | S, c = 0;
|
|
721
721
|
break;
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
|
-
if (
|
|
724
|
+
if (c === 1)
|
|
725
725
|
throw Error(t);
|
|
726
726
|
return s - d;
|
|
727
727
|
}, o.test = function(i) {
|
|
@@ -840,15 +840,15 @@ function factory(u) {
|
|
|
840
840
|
if (e < 22250738585072014e-324)
|
|
841
841
|
d = e / 5e-324, n(d >>> 0, i, a + r), n((s << 31 | d / 4294967296) >>> 0, i, a + t);
|
|
842
842
|
else {
|
|
843
|
-
var
|
|
844
|
-
|
|
843
|
+
var c = Math.floor(Math.log(e) / Math.LN2);
|
|
844
|
+
c === 1024 && (c = 1023), d = e * Math.pow(2, -c), n(d * 4503599627370496 >>> 0, i, a + r), n((s << 31 | c + 1023 << 20 | d * 1048576 & 1048575) >>> 0, i, a + t);
|
|
845
845
|
}
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
u.writeDoubleLE = o.bind(null, writeUintLE, 0, 4), u.writeDoubleBE = o.bind(null, writeUintBE, 4, 0);
|
|
849
849
|
function l(n, r, t, e, i) {
|
|
850
|
-
var a = n(e, i + r), s = n(e, i + t), d = (s >> 31) * 2 + 1,
|
|
851
|
-
return
|
|
850
|
+
var a = n(e, i + r), s = n(e, i + t), d = (s >> 31) * 2 + 1, c = s >>> 20 & 2047, F = 4294967296 * (s & 1048575) + a;
|
|
851
|
+
return c === 2047 ? F ? NaN : d * (1 / 0) : c === 0 ? d * 5e-324 * F : d * Math.pow(2, c - 1075) * (F + 4503599627370496);
|
|
852
852
|
}
|
|
853
853
|
u.readDoubleLE = l.bind(null, readUintLE, 0, 4), u.readDoubleBE = l.bind(null, readUintBE, 4, 0);
|
|
854
854
|
}(), u;
|
|
@@ -1610,7 +1610,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
1610
1610
|
n(Z[h], this, f);
|
|
1611
1611
|
return !0;
|
|
1612
1612
|
};
|
|
1613
|
-
function
|
|
1613
|
+
function c(Q, p, f, h) {
|
|
1614
1614
|
var R, J, V;
|
|
1615
1615
|
if (s(f), J = Q._events, J === void 0 ? (J = Q._events = /* @__PURE__ */ Object.create(null), Q._eventsCount = 0) : (J.newListener !== void 0 && (Q.emit(
|
|
1616
1616
|
"newListener",
|
|
@@ -1626,9 +1626,9 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
1626
1626
|
return Q;
|
|
1627
1627
|
}
|
|
1628
1628
|
i.prototype.addListener = function(p, f) {
|
|
1629
|
-
return
|
|
1629
|
+
return c(this, p, f, !1);
|
|
1630
1630
|
}, i.prototype.on = i.prototype.addListener, i.prototype.prependListener = function(p, f) {
|
|
1631
|
-
return
|
|
1631
|
+
return c(this, p, f, !0);
|
|
1632
1632
|
};
|
|
1633
1633
|
function F() {
|
|
1634
1634
|
if (!this.fired)
|
|
@@ -2078,8 +2078,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
2078
2078
|
}
|
|
2079
2079
|
case 4: {
|
|
2080
2080
|
if (s.sourceChannels && s.sourceChannels.length || (s.sourceChannels = []), (d & 7) === 2) {
|
|
2081
|
-
let
|
|
2082
|
-
for (; t.pos <
|
|
2081
|
+
let c = t.uint32() + t.pos;
|
|
2082
|
+
for (; t.pos < c; )
|
|
2083
2083
|
s.sourceChannels.push(t.uint32());
|
|
2084
2084
|
} else
|
|
2085
2085
|
s.sourceChannels.push(t.uint32());
|
|
@@ -2820,8 +2820,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
2820
2820
|
}
|
|
2821
2821
|
case 5: {
|
|
2822
2822
|
if (s.vu && s.vu.length || (s.vu = []), (d & 7) === 2) {
|
|
2823
|
-
let
|
|
2824
|
-
for (; t.pos <
|
|
2823
|
+
let c = t.uint32() + t.pos;
|
|
2824
|
+
for (; t.pos < c; )
|
|
2825
2825
|
s.vu.push(t.float());
|
|
2826
2826
|
} else
|
|
2827
2827
|
s.vu.push(t.float());
|
|
@@ -2998,8 +2998,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
2998
2998
|
}
|
|
2999
2999
|
case 3: {
|
|
3000
3000
|
if (s.vu && s.vu.length || (s.vu = []), (d & 7) === 2) {
|
|
3001
|
-
let
|
|
3002
|
-
for (; t.pos <
|
|
3001
|
+
let c = t.uint32() + t.pos;
|
|
3002
|
+
for (; t.pos < c; )
|
|
3003
3003
|
s.vu.push(t.float());
|
|
3004
3004
|
} else
|
|
3005
3005
|
s.vu.push(t.float());
|
|
@@ -3237,10 +3237,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
3237
3237
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
3238
3238
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.audio.AudioChannelControlRequest();
|
|
3239
3239
|
for (; e.pos < s; ) {
|
|
3240
|
-
let
|
|
3241
|
-
if (
|
|
3240
|
+
let c = e.uint32();
|
|
3241
|
+
if (c === a)
|
|
3242
3242
|
break;
|
|
3243
|
-
switch (
|
|
3243
|
+
switch (c >>> 3) {
|
|
3244
3244
|
case 1: {
|
|
3245
3245
|
d.channelId = e.string();
|
|
3246
3246
|
break;
|
|
@@ -3258,7 +3258,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
3258
3258
|
break;
|
|
3259
3259
|
}
|
|
3260
3260
|
default:
|
|
3261
|
-
e.skipType(
|
|
3261
|
+
e.skipType(c & 7);
|
|
3262
3262
|
break;
|
|
3263
3263
|
}
|
|
3264
3264
|
}
|
|
@@ -3507,10 +3507,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
3507
3507
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
3508
3508
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.commands.CommandListItem();
|
|
3509
3509
|
for (; e.pos < s; ) {
|
|
3510
|
-
let
|
|
3511
|
-
if (
|
|
3510
|
+
let c = e.uint32();
|
|
3511
|
+
if (c === a)
|
|
3512
3512
|
break;
|
|
3513
|
-
switch (
|
|
3513
|
+
switch (c >>> 3) {
|
|
3514
3514
|
case 1: {
|
|
3515
3515
|
d.timeOffsetUs = e.int64();
|
|
3516
3516
|
break;
|
|
@@ -3616,7 +3616,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
3616
3616
|
break;
|
|
3617
3617
|
}
|
|
3618
3618
|
case 26: {
|
|
3619
|
-
if (d.transactionDeps && d.transactionDeps.length || (d.transactionDeps = []), (
|
|
3619
|
+
if (d.transactionDeps && d.transactionDeps.length || (d.transactionDeps = []), (c & 7) === 2) {
|
|
3620
3620
|
let F = e.uint32() + e.pos;
|
|
3621
3621
|
for (; e.pos < F; )
|
|
3622
3622
|
d.transactionDeps.push(e.uint32());
|
|
@@ -3625,7 +3625,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
3625
3625
|
break;
|
|
3626
3626
|
}
|
|
3627
3627
|
default:
|
|
3628
|
-
e.skipType(
|
|
3628
|
+
e.skipType(c & 7);
|
|
3629
3629
|
break;
|
|
3630
3630
|
}
|
|
3631
3631
|
}
|
|
@@ -4541,10 +4541,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
4541
4541
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
4542
4542
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.common.PropValue();
|
|
4543
4543
|
for (; e.pos < s; ) {
|
|
4544
|
-
let
|
|
4545
|
-
if (
|
|
4544
|
+
let c = e.uint32();
|
|
4545
|
+
if (c === a)
|
|
4546
4546
|
break;
|
|
4547
|
-
switch (
|
|
4547
|
+
switch (c >>> 3) {
|
|
4548
4548
|
case 1: {
|
|
4549
4549
|
d.floatValue = e.float();
|
|
4550
4550
|
break;
|
|
@@ -4566,7 +4566,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
4566
4566
|
break;
|
|
4567
4567
|
}
|
|
4568
4568
|
default:
|
|
4569
|
-
e.skipType(
|
|
4569
|
+
e.skipType(c & 7);
|
|
4570
4570
|
break;
|
|
4571
4571
|
}
|
|
4572
4572
|
}
|
|
@@ -4660,10 +4660,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
4660
4660
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
4661
4661
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.common.PropertyDomain();
|
|
4662
4662
|
for (; e.pos < s; ) {
|
|
4663
|
-
let
|
|
4664
|
-
if (
|
|
4663
|
+
let c = e.uint32();
|
|
4664
|
+
if (c === a)
|
|
4665
4665
|
break;
|
|
4666
|
-
switch (
|
|
4666
|
+
switch (c >>> 3) {
|
|
4667
4667
|
case 1: {
|
|
4668
4668
|
d.compositorId = e.string();
|
|
4669
4669
|
break;
|
|
@@ -4681,7 +4681,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
4681
4681
|
break;
|
|
4682
4682
|
}
|
|
4683
4683
|
default:
|
|
4684
|
-
e.skipType(
|
|
4684
|
+
e.skipType(c & 7);
|
|
4685
4685
|
break;
|
|
4686
4686
|
}
|
|
4687
4687
|
}
|
|
@@ -5779,10 +5779,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
5779
5779
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
5780
5780
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.sources.DecklinkSourceConfig();
|
|
5781
5781
|
for (; e.pos < s; ) {
|
|
5782
|
-
let
|
|
5783
|
-
if (
|
|
5782
|
+
let c = e.uint32();
|
|
5783
|
+
if (c === a)
|
|
5784
5784
|
break;
|
|
5785
|
-
switch (
|
|
5785
|
+
switch (c >>> 3) {
|
|
5786
5786
|
case 1: {
|
|
5787
5787
|
d.deviceIndex = e.uint32();
|
|
5788
5788
|
break;
|
|
@@ -5796,7 +5796,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
5796
5796
|
break;
|
|
5797
5797
|
}
|
|
5798
5798
|
default:
|
|
5799
|
-
e.skipType(
|
|
5799
|
+
e.skipType(c & 7);
|
|
5800
5800
|
break;
|
|
5801
5801
|
}
|
|
5802
5802
|
}
|
|
@@ -6268,10 +6268,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
6268
6268
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
6269
6269
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.sources.SourceConfig();
|
|
6270
6270
|
for (; e.pos < s; ) {
|
|
6271
|
-
let
|
|
6272
|
-
if (
|
|
6271
|
+
let c = e.uint32();
|
|
6272
|
+
if (c === a)
|
|
6273
6273
|
break;
|
|
6274
|
-
switch (
|
|
6274
|
+
switch (c >>> 3) {
|
|
6275
6275
|
case 1: {
|
|
6276
6276
|
d.common = $root.sesame.v1.sources.SourceCommonConfig.decode(e, e.uint32());
|
|
6277
6277
|
break;
|
|
@@ -6317,7 +6317,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
6317
6317
|
break;
|
|
6318
6318
|
}
|
|
6319
6319
|
default:
|
|
6320
|
-
e.skipType(
|
|
6320
|
+
e.skipType(c & 7);
|
|
6321
6321
|
break;
|
|
6322
6322
|
}
|
|
6323
6323
|
}
|
|
@@ -6783,10 +6783,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
6783
6783
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
6784
6784
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.sources.SourceStatus();
|
|
6785
6785
|
for (; e.pos < s; ) {
|
|
6786
|
-
let
|
|
6787
|
-
if (
|
|
6786
|
+
let c = e.uint32();
|
|
6787
|
+
if (c === a)
|
|
6788
6788
|
break;
|
|
6789
|
-
switch (
|
|
6789
|
+
switch (c >>> 3) {
|
|
6790
6790
|
case 1: {
|
|
6791
6791
|
d.id = e.string();
|
|
6792
6792
|
break;
|
|
@@ -6872,7 +6872,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
6872
6872
|
break;
|
|
6873
6873
|
}
|
|
6874
6874
|
default:
|
|
6875
|
-
e.skipType(
|
|
6875
|
+
e.skipType(c & 7);
|
|
6876
6876
|
break;
|
|
6877
6877
|
}
|
|
6878
6878
|
}
|
|
@@ -7489,10 +7489,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
7489
7489
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
7490
7490
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.sources.LoadPlaylistRequest();
|
|
7491
7491
|
for (; e.pos < s; ) {
|
|
7492
|
-
let
|
|
7493
|
-
if (
|
|
7492
|
+
let c = e.uint32();
|
|
7493
|
+
if (c === a)
|
|
7494
7494
|
break;
|
|
7495
|
-
switch (
|
|
7495
|
+
switch (c >>> 3) {
|
|
7496
7496
|
case 1: {
|
|
7497
7497
|
d.sourceId = e.string();
|
|
7498
7498
|
break;
|
|
@@ -7518,7 +7518,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
7518
7518
|
break;
|
|
7519
7519
|
}
|
|
7520
7520
|
default:
|
|
7521
|
-
e.skipType(
|
|
7521
|
+
e.skipType(c & 7);
|
|
7522
7522
|
break;
|
|
7523
7523
|
}
|
|
7524
7524
|
}
|
|
@@ -8002,10 +8002,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
8002
8002
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
8003
8003
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.recorder.PlaylistItem();
|
|
8004
8004
|
for (; e.pos < s; ) {
|
|
8005
|
-
let
|
|
8006
|
-
if (
|
|
8005
|
+
let c = e.uint32();
|
|
8006
|
+
if (c === a)
|
|
8007
8007
|
break;
|
|
8008
|
-
switch (
|
|
8008
|
+
switch (c >>> 3) {
|
|
8009
8009
|
case 1: {
|
|
8010
8010
|
d.recorderId = e.string();
|
|
8011
8011
|
break;
|
|
@@ -8031,7 +8031,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
8031
8031
|
break;
|
|
8032
8032
|
}
|
|
8033
8033
|
case 7: {
|
|
8034
|
-
if (d.audioRouting && d.audioRouting.length || (d.audioRouting = []), (
|
|
8034
|
+
if (d.audioRouting && d.audioRouting.length || (d.audioRouting = []), (c & 7) === 2) {
|
|
8035
8035
|
let F = e.uint32() + e.pos;
|
|
8036
8036
|
for (; e.pos < F; )
|
|
8037
8037
|
d.audioRouting.push(e.uint32());
|
|
@@ -8048,7 +8048,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
8048
8048
|
break;
|
|
8049
8049
|
}
|
|
8050
8050
|
case 10: {
|
|
8051
|
-
if (d.audioLevels && d.audioLevels.length || (d.audioLevels = []), (
|
|
8051
|
+
if (d.audioLevels && d.audioLevels.length || (d.audioLevels = []), (c & 7) === 2) {
|
|
8052
8052
|
let F = e.uint32() + e.pos;
|
|
8053
8053
|
for (; e.pos < F; )
|
|
8054
8054
|
d.audioLevels.push(e.float());
|
|
@@ -8057,7 +8057,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
8057
8057
|
break;
|
|
8058
8058
|
}
|
|
8059
8059
|
default:
|
|
8060
|
-
e.skipType(
|
|
8060
|
+
e.skipType(c & 7);
|
|
8061
8061
|
break;
|
|
8062
8062
|
}
|
|
8063
8063
|
}
|
|
@@ -9070,10 +9070,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9070
9070
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
9071
9071
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.recorder.RecorderRequest();
|
|
9072
9072
|
for (; e.pos < s; ) {
|
|
9073
|
-
let
|
|
9074
|
-
if (
|
|
9073
|
+
let c = e.uint32();
|
|
9074
|
+
if (c === a)
|
|
9075
9075
|
break;
|
|
9076
|
-
switch (
|
|
9076
|
+
switch (c >>> 3) {
|
|
9077
9077
|
case 1: {
|
|
9078
9078
|
d.recorderId = e.string();
|
|
9079
9079
|
break;
|
|
@@ -9115,7 +9115,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9115
9115
|
break;
|
|
9116
9116
|
}
|
|
9117
9117
|
default:
|
|
9118
|
-
e.skipType(
|
|
9118
|
+
e.skipType(c & 7);
|
|
9119
9119
|
break;
|
|
9120
9120
|
}
|
|
9121
9121
|
}
|
|
@@ -9306,10 +9306,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9306
9306
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
9307
9307
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.recorder.RecorderResponse();
|
|
9308
9308
|
for (; e.pos < s; ) {
|
|
9309
|
-
let
|
|
9310
|
-
if (
|
|
9309
|
+
let c = e.uint32();
|
|
9310
|
+
if (c === a)
|
|
9311
9311
|
break;
|
|
9312
|
-
switch (
|
|
9312
|
+
switch (c >>> 3) {
|
|
9313
9313
|
case 1: {
|
|
9314
9314
|
d.getClipsResponse = $root.sesame.v1.recorder.RecorderClipsGetResponse.decode(e, e.uint32());
|
|
9315
9315
|
break;
|
|
@@ -9323,7 +9323,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9323
9323
|
break;
|
|
9324
9324
|
}
|
|
9325
9325
|
default:
|
|
9326
|
-
e.skipType(
|
|
9326
|
+
e.skipType(c & 7);
|
|
9327
9327
|
break;
|
|
9328
9328
|
}
|
|
9329
9329
|
}
|
|
@@ -9473,10 +9473,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9473
9473
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
9474
9474
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.recorder.RecorderEvent();
|
|
9475
9475
|
for (; e.pos < s; ) {
|
|
9476
|
-
let
|
|
9477
|
-
if (
|
|
9476
|
+
let c = e.uint32();
|
|
9477
|
+
if (c === a)
|
|
9478
9478
|
break;
|
|
9479
|
-
switch (
|
|
9479
|
+
switch (c >>> 3) {
|
|
9480
9480
|
case 1: {
|
|
9481
9481
|
d.id = e.string();
|
|
9482
9482
|
break;
|
|
@@ -9490,7 +9490,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
9490
9490
|
break;
|
|
9491
9491
|
}
|
|
9492
9492
|
default:
|
|
9493
|
-
e.skipType(
|
|
9493
|
+
e.skipType(c & 7);
|
|
9494
9494
|
break;
|
|
9495
9495
|
}
|
|
9496
9496
|
}
|
|
@@ -11159,10 +11159,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
11159
11159
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
11160
11160
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.status.Event();
|
|
11161
11161
|
for (; e.pos < s; ) {
|
|
11162
|
-
let
|
|
11163
|
-
if (
|
|
11162
|
+
let c = e.uint32();
|
|
11163
|
+
if (c === a)
|
|
11164
11164
|
break;
|
|
11165
|
-
switch (
|
|
11165
|
+
switch (c >>> 3) {
|
|
11166
11166
|
case 1: {
|
|
11167
11167
|
d.errorEvent = $root.sesame.v1.status.ErrorEvent.decode(e, e.uint32());
|
|
11168
11168
|
break;
|
|
@@ -11188,7 +11188,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
11188
11188
|
break;
|
|
11189
11189
|
}
|
|
11190
11190
|
default:
|
|
11191
|
-
e.skipType(
|
|
11191
|
+
e.skipType(c & 7);
|
|
11192
11192
|
break;
|
|
11193
11193
|
}
|
|
11194
11194
|
}
|
|
@@ -11339,8 +11339,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
11339
11339
|
switch (d >>> 3) {
|
|
11340
11340
|
case 1: {
|
|
11341
11341
|
if (s.eventTopics && s.eventTopics.length || (s.eventTopics = []), (d & 7) === 2) {
|
|
11342
|
-
let
|
|
11343
|
-
for (; t.pos <
|
|
11342
|
+
let c = t.uint32() + t.pos;
|
|
11343
|
+
for (; t.pos < c; )
|
|
11344
11344
|
s.eventTopics.push(t.int32());
|
|
11345
11345
|
} else
|
|
11346
11346
|
s.eventTopics.push(t.int32());
|
|
@@ -12491,10 +12491,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
12491
12491
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
12492
12492
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.outputs.OutputAddRequest();
|
|
12493
12493
|
for (; e.pos < s; ) {
|
|
12494
|
-
let
|
|
12495
|
-
if (
|
|
12494
|
+
let c = e.uint32();
|
|
12495
|
+
if (c === a)
|
|
12496
12496
|
break;
|
|
12497
|
-
switch (
|
|
12497
|
+
switch (c >>> 3) {
|
|
12498
12498
|
case 1: {
|
|
12499
12499
|
d.id = e.string();
|
|
12500
12500
|
break;
|
|
@@ -12540,7 +12540,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
12540
12540
|
break;
|
|
12541
12541
|
}
|
|
12542
12542
|
default:
|
|
12543
|
-
e.skipType(
|
|
12543
|
+
e.skipType(c & 7);
|
|
12544
12544
|
break;
|
|
12545
12545
|
}
|
|
12546
12546
|
}
|
|
@@ -12751,10 +12751,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
12751
12751
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
12752
12752
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.outputs.OutputUpdateRequest();
|
|
12753
12753
|
for (; e.pos < s; ) {
|
|
12754
|
-
let
|
|
12755
|
-
if (
|
|
12754
|
+
let c = e.uint32();
|
|
12755
|
+
if (c === a)
|
|
12756
12756
|
break;
|
|
12757
|
-
switch (
|
|
12757
|
+
switch (c >>> 3) {
|
|
12758
12758
|
case 1: {
|
|
12759
12759
|
d.id = e.string();
|
|
12760
12760
|
break;
|
|
@@ -12800,7 +12800,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
12800
12800
|
break;
|
|
12801
12801
|
}
|
|
12802
12802
|
default:
|
|
12803
|
-
e.skipType(
|
|
12803
|
+
e.skipType(c & 7);
|
|
12804
12804
|
break;
|
|
12805
12805
|
}
|
|
12806
12806
|
}
|
|
@@ -13101,10 +13101,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
13101
13101
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
13102
13102
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.outputs.OutputStatus();
|
|
13103
13103
|
for (; e.pos < s; ) {
|
|
13104
|
-
let
|
|
13105
|
-
if (
|
|
13104
|
+
let c = e.uint32();
|
|
13105
|
+
if (c === a)
|
|
13106
13106
|
break;
|
|
13107
|
-
switch (
|
|
13107
|
+
switch (c >>> 3) {
|
|
13108
13108
|
case 1: {
|
|
13109
13109
|
d.id = e.string();
|
|
13110
13110
|
break;
|
|
@@ -13134,7 +13134,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
13134
13134
|
break;
|
|
13135
13135
|
}
|
|
13136
13136
|
default:
|
|
13137
|
-
e.skipType(
|
|
13137
|
+
e.skipType(c & 7);
|
|
13138
13138
|
break;
|
|
13139
13139
|
}
|
|
13140
13140
|
}
|
|
@@ -14180,10 +14180,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
14180
14180
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
14181
14181
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.jobs.Job();
|
|
14182
14182
|
for (; e.pos < s; ) {
|
|
14183
|
-
let
|
|
14184
|
-
if (
|
|
14183
|
+
let c = e.uint32();
|
|
14184
|
+
if (c === a)
|
|
14185
14185
|
break;
|
|
14186
|
-
switch (
|
|
14186
|
+
switch (c >>> 3) {
|
|
14187
14187
|
case 1: {
|
|
14188
14188
|
d.id = e.uint32();
|
|
14189
14189
|
break;
|
|
@@ -14221,7 +14221,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
14221
14221
|
break;
|
|
14222
14222
|
}
|
|
14223
14223
|
default:
|
|
14224
|
-
e.skipType(
|
|
14224
|
+
e.skipType(c & 7);
|
|
14225
14225
|
break;
|
|
14226
14226
|
}
|
|
14227
14227
|
}
|
|
@@ -14460,10 +14460,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
14460
14460
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
14461
14461
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.jobs.JobStartRequest();
|
|
14462
14462
|
for (; e.pos < s; ) {
|
|
14463
|
-
let
|
|
14464
|
-
if (
|
|
14463
|
+
let c = e.uint32();
|
|
14464
|
+
if (c === a)
|
|
14465
14465
|
break;
|
|
14466
|
-
switch (
|
|
14466
|
+
switch (c >>> 3) {
|
|
14467
14467
|
case 1: {
|
|
14468
14468
|
d.exportRequest = $root.sesame.v1.jobs.ExportStartRequest.decode(e, e.uint32());
|
|
14469
14469
|
break;
|
|
@@ -14473,7 +14473,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
14473
14473
|
break;
|
|
14474
14474
|
}
|
|
14475
14475
|
default:
|
|
14476
|
-
e.skipType(
|
|
14476
|
+
e.skipType(c & 7);
|
|
14477
14477
|
break;
|
|
14478
14478
|
}
|
|
14479
14479
|
}
|
|
@@ -14860,8 +14860,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
14860
14860
|
}
|
|
14861
14861
|
case 24: {
|
|
14862
14862
|
if (s.audioRouting && s.audioRouting.length || (s.audioRouting = []), (d & 7) === 2) {
|
|
14863
|
-
let
|
|
14864
|
-
for (; t.pos <
|
|
14863
|
+
let c = t.uint32() + t.pos;
|
|
14864
|
+
for (; t.pos < c; )
|
|
14865
14865
|
s.audioRouting.push(t.uint32());
|
|
14866
14866
|
} else
|
|
14867
14867
|
s.audioRouting.push(t.uint32());
|
|
@@ -15318,8 +15318,8 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15318
15318
|
}
|
|
15319
15319
|
case 2: {
|
|
15320
15320
|
if (s.audioRouting && s.audioRouting.length || (s.audioRouting = []), (d & 7) === 2) {
|
|
15321
|
-
let
|
|
15322
|
-
for (; t.pos <
|
|
15321
|
+
let c = t.uint32() + t.pos;
|
|
15322
|
+
for (; t.pos < c; )
|
|
15323
15323
|
s.audioRouting.push(t.uint32());
|
|
15324
15324
|
} else
|
|
15325
15325
|
s.audioRouting.push(t.uint32());
|
|
@@ -15492,10 +15492,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15492
15492
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
15493
15493
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.rpc.Message();
|
|
15494
15494
|
for (; e.pos < s; ) {
|
|
15495
|
-
let
|
|
15496
|
-
if (
|
|
15495
|
+
let c = e.uint32();
|
|
15496
|
+
if (c === a)
|
|
15497
15497
|
break;
|
|
15498
|
-
switch (
|
|
15498
|
+
switch (c >>> 3) {
|
|
15499
15499
|
case 1: {
|
|
15500
15500
|
d.request = $root.sesame.v1.rpc.Request.decode(e, e.uint32());
|
|
15501
15501
|
break;
|
|
@@ -15509,7 +15509,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15509
15509
|
break;
|
|
15510
15510
|
}
|
|
15511
15511
|
default:
|
|
15512
|
-
e.skipType(
|
|
15512
|
+
e.skipType(c & 7);
|
|
15513
15513
|
break;
|
|
15514
15514
|
}
|
|
15515
15515
|
}
|
|
@@ -15830,7 +15830,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15830
15830
|
for (let t = Object.keys(r), e = 0; e < t.length; ++e)
|
|
15831
15831
|
r[t[e]] != null && (this[t[e]] = r[t[e]]);
|
|
15832
15832
|
}
|
|
15833
|
-
return n.prototype.nodeId = "", n.prototype.metadataId = "", n.prototype.payload = $util.newBuffer([]), n.create = function(t) {
|
|
15833
|
+
return n.prototype.nodeId = "", n.prototype.metadataId = "", n.prototype.payload = $util.newBuffer([]), n.prototype.dataType = 0, n.create = function(t) {
|
|
15834
15834
|
return new n(t);
|
|
15835
15835
|
}, n.encode = function(t, e) {
|
|
15836
15836
|
return e || (e = $Writer.create()), t.nodeId != null && Object.hasOwnProperty.call(t, "nodeId") && e.uint32(
|
|
@@ -15842,7 +15842,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15842
15842
|
).string(t.metadataId), t.payload != null && Object.hasOwnProperty.call(t, "payload") && e.uint32(
|
|
15843
15843
|
/* id 3, wireType 2 =*/
|
|
15844
15844
|
26
|
|
15845
|
-
).bytes(t.payload), e
|
|
15845
|
+
).bytes(t.payload), t.dataType != null && Object.hasOwnProperty.call(t, "dataType") && e.uint32(
|
|
15846
|
+
/* id 4, wireType 0 =*/
|
|
15847
|
+
32
|
|
15848
|
+
).int32(t.dataType), e;
|
|
15846
15849
|
}, n.encodeDelimited = function(t, e) {
|
|
15847
15850
|
return this.encode(t, e).ldelim();
|
|
15848
15851
|
}, n.decode = function(t, e, i) {
|
|
@@ -15865,6 +15868,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15865
15868
|
s.payload = t.bytes();
|
|
15866
15869
|
break;
|
|
15867
15870
|
}
|
|
15871
|
+
case 4: {
|
|
15872
|
+
s.dataType = t.int32();
|
|
15873
|
+
break;
|
|
15874
|
+
}
|
|
15868
15875
|
default:
|
|
15869
15876
|
t.skipType(d & 7);
|
|
15870
15877
|
break;
|
|
@@ -15874,16 +15881,73 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
15874
15881
|
}, n.decodeDelimited = function(t) {
|
|
15875
15882
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
15876
15883
|
}, n.verify = function(t) {
|
|
15877
|
-
|
|
15884
|
+
if (typeof t != "object" || t === null)
|
|
15885
|
+
return "object expected";
|
|
15886
|
+
if (t.nodeId != null && t.hasOwnProperty("nodeId") && !$util.isString(t.nodeId))
|
|
15887
|
+
return "nodeId: string expected";
|
|
15888
|
+
if (t.metadataId != null && t.hasOwnProperty("metadataId") && !$util.isString(t.metadataId))
|
|
15889
|
+
return "metadataId: string expected";
|
|
15890
|
+
if (t.payload != null && t.hasOwnProperty("payload") && !(t.payload && typeof t.payload.length == "number" || $util.isString(t.payload)))
|
|
15891
|
+
return "payload: buffer expected";
|
|
15892
|
+
if (t.dataType != null && t.hasOwnProperty("dataType"))
|
|
15893
|
+
switch (t.dataType) {
|
|
15894
|
+
default:
|
|
15895
|
+
return "dataType: enum value expected";
|
|
15896
|
+
case 0:
|
|
15897
|
+
case 1:
|
|
15898
|
+
case 2:
|
|
15899
|
+
case 3:
|
|
15900
|
+
case 4:
|
|
15901
|
+
case 5:
|
|
15902
|
+
case 6:
|
|
15903
|
+
break;
|
|
15904
|
+
}
|
|
15905
|
+
return null;
|
|
15878
15906
|
}, n.fromObject = function(t) {
|
|
15879
15907
|
if (t instanceof $root.sesame.v1.rpc.PublishMetadataRequest)
|
|
15880
15908
|
return t;
|
|
15881
15909
|
let e = new $root.sesame.v1.rpc.PublishMetadataRequest();
|
|
15882
|
-
|
|
15910
|
+
switch (t.nodeId != null && (e.nodeId = String(t.nodeId)), t.metadataId != null && (e.metadataId = String(t.metadataId)), t.payload != null && (typeof t.payload == "string" ? $util.base64.decode(t.payload, e.payload = $util.newBuffer($util.base64.length(t.payload)), 0) : t.payload.length >= 0 && (e.payload = t.payload)), t.dataType) {
|
|
15911
|
+
default:
|
|
15912
|
+
if (typeof t.dataType == "number") {
|
|
15913
|
+
e.dataType = t.dataType;
|
|
15914
|
+
break;
|
|
15915
|
+
}
|
|
15916
|
+
break;
|
|
15917
|
+
case "DATA_TYPE_UNSPECIFIED":
|
|
15918
|
+
case 0:
|
|
15919
|
+
e.dataType = 0;
|
|
15920
|
+
break;
|
|
15921
|
+
case "DATA_TYPE_JSON":
|
|
15922
|
+
case 1:
|
|
15923
|
+
e.dataType = 1;
|
|
15924
|
+
break;
|
|
15925
|
+
case "DATA_TYPE_TRANSPORT_STATUS":
|
|
15926
|
+
case 2:
|
|
15927
|
+
e.dataType = 2;
|
|
15928
|
+
break;
|
|
15929
|
+
case "DATA_TYPE_AUDIO_STATE":
|
|
15930
|
+
case 3:
|
|
15931
|
+
e.dataType = 3;
|
|
15932
|
+
break;
|
|
15933
|
+
case "DATA_TYPE_TRANSPORT_CONTROL":
|
|
15934
|
+
case 4:
|
|
15935
|
+
e.dataType = 4;
|
|
15936
|
+
break;
|
|
15937
|
+
case "DATA_TYPE_AUDIO_CONTROL":
|
|
15938
|
+
case 5:
|
|
15939
|
+
e.dataType = 5;
|
|
15940
|
+
break;
|
|
15941
|
+
case "DATA_TYPE_BINARY":
|
|
15942
|
+
case 6:
|
|
15943
|
+
e.dataType = 6;
|
|
15944
|
+
break;
|
|
15945
|
+
}
|
|
15946
|
+
return e;
|
|
15883
15947
|
}, n.toObject = function(t, e) {
|
|
15884
15948
|
e || (e = {});
|
|
15885
15949
|
let i = {};
|
|
15886
|
-
return e.defaults && (i.nodeId = "", i.metadataId = "", e.bytes === String ? i.payload = "" : (i.payload = [], e.bytes !== Array && (i.payload = $util.newBuffer(i.payload)))), t.nodeId != null && t.hasOwnProperty("nodeId") && (i.nodeId = t.nodeId), t.metadataId != null && t.hasOwnProperty("metadataId") && (i.metadataId = t.metadataId), t.payload != null && t.hasOwnProperty("payload") && (i.payload = e.bytes === String ? $util.base64.encode(t.payload, 0, t.payload.length) : e.bytes === Array ? Array.prototype.slice.call(t.payload) : t.payload), i;
|
|
15950
|
+
return e.defaults && (i.nodeId = "", i.metadataId = "", e.bytes === String ? i.payload = "" : (i.payload = [], e.bytes !== Array && (i.payload = $util.newBuffer(i.payload))), i.dataType = e.enums === String ? "DATA_TYPE_UNSPECIFIED" : 0), t.nodeId != null && t.hasOwnProperty("nodeId") && (i.nodeId = t.nodeId), t.metadataId != null && t.hasOwnProperty("metadataId") && (i.metadataId = t.metadataId), t.payload != null && t.hasOwnProperty("payload") && (i.payload = e.bytes === String ? $util.base64.encode(t.payload, 0, t.payload.length) : e.bytes === Array ? Array.prototype.slice.call(t.payload) : t.payload), t.dataType != null && t.hasOwnProperty("dataType") && (i.dataType = e.enums === String ? $root.sesame.v1.wire.DataType[t.dataType] === void 0 ? t.dataType : $root.sesame.v1.wire.DataType[t.dataType] : t.dataType), i;
|
|
15887
15951
|
}, n.prototype.toJSON = function() {
|
|
15888
15952
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
15889
15953
|
}, n.getTypeUrl = function(t) {
|
|
@@ -16352,10 +16416,10 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
16352
16416
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
16353
16417
|
let s = i === void 0 ? e.len : e.pos + i, d = new $root.sesame.v1.wire.FrameHeader();
|
|
16354
16418
|
for (; e.pos < s; ) {
|
|
16355
|
-
let
|
|
16356
|
-
if (
|
|
16419
|
+
let c = e.uint32();
|
|
16420
|
+
if (c === a)
|
|
16357
16421
|
break;
|
|
16358
|
-
switch (
|
|
16422
|
+
switch (c >>> 3) {
|
|
16359
16423
|
case 1: {
|
|
16360
16424
|
d.type = e.int32();
|
|
16361
16425
|
break;
|
|
@@ -16373,7 +16437,7 @@ var __create = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropD
|
|
|
16373
16437
|
break;
|
|
16374
16438
|
}
|
|
16375
16439
|
default:
|
|
16376
|
-
e.skipType(
|
|
16440
|
+
e.skipType(c & 7);
|
|
16377
16441
|
break;
|
|
16378
16442
|
}
|
|
16379
16443
|
}
|
|
@@ -17086,15 +17150,15 @@ registerProcessor('live-audio-processor', LiveAudioProcessor);
|
|
|
17086
17150
|
`;
|
|
17087
17151
|
class LiveAudioPlayer {
|
|
17088
17152
|
constructor(o, l = {}) {
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17153
|
+
U(this, "ctx");
|
|
17154
|
+
U(this, "decoder", null);
|
|
17155
|
+
U(this, "workletNode", null);
|
|
17156
|
+
U(this, "gainNode");
|
|
17157
|
+
U(this, "initialized", !1);
|
|
17158
|
+
U(this, "targetSampleRate");
|
|
17095
17159
|
// Timing for live streams
|
|
17096
|
-
|
|
17097
|
-
|
|
17160
|
+
U(this, "startTime", 0);
|
|
17161
|
+
U(this, "bufferDelayMs");
|
|
17098
17162
|
this.ctx = o, this.targetSampleRate = o.sampleRate, this.bufferDelayMs = l.bufferDelayMs ?? 100, this.gainNode = this.ctx.createGain(), this.startTime = performance.now() * 1e3;
|
|
17099
17163
|
}
|
|
17100
17164
|
/**
|
|
@@ -17189,12 +17253,12 @@ class LiveAudioPlayer {
|
|
|
17189
17253
|
frameOffset: 0,
|
|
17190
17254
|
frameCount: o.numberOfFrames
|
|
17191
17255
|
});
|
|
17192
|
-
const
|
|
17256
|
+
const c = new Float32Array(d);
|
|
17193
17257
|
if (o.numberOfChannels === 1)
|
|
17194
|
-
r.set(
|
|
17258
|
+
r.set(c), t.set(c);
|
|
17195
17259
|
else
|
|
17196
17260
|
for (let F = 0; F < l; F++)
|
|
17197
|
-
r[F] =
|
|
17261
|
+
r[F] = c[F * 2], t[F] = c[F * 2 + 1];
|
|
17198
17262
|
} else {
|
|
17199
17263
|
const s = new ArrayBuffer(o.allocationSize({
|
|
17200
17264
|
planeIndex: 0,
|
|
@@ -17232,8 +17296,8 @@ class LiveAudioPlayer {
|
|
|
17232
17296
|
return o;
|
|
17233
17297
|
const r = l / n, t = Math.floor(o.length / r), e = new Float32Array(t);
|
|
17234
17298
|
for (let i = 0; i < t; i++) {
|
|
17235
|
-
const a = i * r, s = Math.floor(a), d = Math.min(s + 1, o.length - 1),
|
|
17236
|
-
e[i] = o[s] * (1 -
|
|
17299
|
+
const a = i * r, s = Math.floor(a), d = Math.min(s + 1, o.length - 1), c = a - s;
|
|
17300
|
+
e[i] = o[s] * (1 - c) + o[d] * c;
|
|
17237
17301
|
}
|
|
17238
17302
|
return e;
|
|
17239
17303
|
}
|
|
@@ -17329,53 +17393,53 @@ function createPlayer(u = {}) {
|
|
|
17329
17393
|
const Ko = class Ko extends BasePlayer {
|
|
17330
17394
|
constructor(l = {}) {
|
|
17331
17395
|
super("idle", l.debugLogging ?? !1);
|
|
17332
|
-
|
|
17396
|
+
U(this, "config");
|
|
17333
17397
|
// Stream source
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17398
|
+
U(this, "streamSource", null);
|
|
17399
|
+
U(this, "trackFilter", null);
|
|
17400
|
+
U(this, "boundDataHandler", null);
|
|
17337
17401
|
// Decoder
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17402
|
+
U(this, "decoder", null);
|
|
17403
|
+
U(this, "currentCodecData");
|
|
17404
|
+
U(this, "useWasmDecoder", !1);
|
|
17405
|
+
U(this, "waitingForKeyframe", !0);
|
|
17406
|
+
U(this, "lastWaitingForKeyframeLog", 0);
|
|
17407
|
+
U(this, "lastKeyframeRequest", 0);
|
|
17408
|
+
U(this, "statusLogCounter", 0);
|
|
17409
|
+
U(this, "isConfiguring", !1);
|
|
17410
|
+
U(this, "pendingDuringConfig", []);
|
|
17347
17411
|
// Queue frames during configuration
|
|
17348
17412
|
// Frame scheduling
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17413
|
+
U(this, "frameScheduler");
|
|
17414
|
+
U(this, "lastVideoFrame", null);
|
|
17415
|
+
U(this, "consecutiveDrops", 0);
|
|
17416
|
+
U(this, "totalDrops", 0);
|
|
17417
|
+
U(this, "lastDropLogTime", 0);
|
|
17354
17418
|
// Metadata
|
|
17355
|
-
|
|
17356
|
-
|
|
17357
|
-
|
|
17419
|
+
U(this, "streamWidth", 0);
|
|
17420
|
+
U(this, "streamHeight", 0);
|
|
17421
|
+
U(this, "estimatedFrameRate", 30);
|
|
17358
17422
|
// Default, will be estimated from timestamps
|
|
17359
17423
|
// FPS estimation from video timestamps
|
|
17360
|
-
|
|
17361
|
-
|
|
17424
|
+
U(this, "lastVideoTimestampUs", -1);
|
|
17425
|
+
U(this, "fpsEstimateSamples", []);
|
|
17362
17426
|
// Number of samples for averaging
|
|
17363
17427
|
// Audio
|
|
17364
|
-
|
|
17365
|
-
|
|
17366
|
-
|
|
17367
|
-
|
|
17428
|
+
U(this, "audioContext", null);
|
|
17429
|
+
U(this, "audioPlayer", null);
|
|
17430
|
+
U(this, "ownsAudioContext", !1);
|
|
17431
|
+
U(this, "audioCodecData", null);
|
|
17368
17432
|
// Timing tracking: maps frame timestamp to arrival time
|
|
17369
|
-
|
|
17433
|
+
U(this, "arrivalTimes", /* @__PURE__ */ new Map());
|
|
17370
17434
|
// Track keyframe status per timestamp
|
|
17371
|
-
|
|
17435
|
+
U(this, "keyframeStatus", /* @__PURE__ */ new Map());
|
|
17372
17436
|
// Bandwidth tracking
|
|
17373
|
-
|
|
17374
|
-
|
|
17375
|
-
|
|
17376
|
-
|
|
17377
|
-
|
|
17378
|
-
|
|
17437
|
+
U(this, "videoBytesReceived", 0);
|
|
17438
|
+
U(this, "audioBytesReceived", 0);
|
|
17439
|
+
U(this, "lastBandwidthUpdateTime", 0);
|
|
17440
|
+
U(this, "lastVideoBytesReceived", 0);
|
|
17441
|
+
U(this, "lastAudioBytesReceived", 0);
|
|
17442
|
+
U(this, "currentBandwidth", {
|
|
17379
17443
|
videoBytesPerSecond: 0,
|
|
17380
17444
|
audioBytesPerSecond: 0,
|
|
17381
17445
|
totalBytesPerSecond: 0
|
|
@@ -17575,7 +17639,7 @@ const Ko = class Ko extends BasePlayer {
|
|
|
17575
17639
|
* Handle incoming stream data
|
|
17576
17640
|
*/
|
|
17577
17641
|
async handleStreamData(l) {
|
|
17578
|
-
var a, s, d,
|
|
17642
|
+
var a, s, d, c, F, B, S, y, E, v, N, T, C, m, Q, p, f;
|
|
17579
17643
|
const n = l.data;
|
|
17580
17644
|
if (!n.valid || !n.header)
|
|
17581
17645
|
return;
|
|
@@ -17593,7 +17657,7 @@ const Ko = class Ko extends BasePlayer {
|
|
|
17593
17657
|
if (e != null && l.trackName !== e || l.streamType !== "video" || !((s = n.header.media) != null && s.codecData))
|
|
17594
17658
|
return;
|
|
17595
17659
|
const i = !!((d = n.header.media) != null && d.keyframe);
|
|
17596
|
-
if (codecDataChanged(this.currentCodecData, (
|
|
17660
|
+
if (codecDataChanged(this.currentCodecData, (c = n.header.media) == null ? void 0 : c.codecData)) {
|
|
17597
17661
|
if (!i) {
|
|
17598
17662
|
this.logger.debug("Waiting for keyframe (codec change)");
|
|
17599
17663
|
return;
|
|
@@ -17649,13 +17713,13 @@ const Ko = class Ko extends BasePlayer {
|
|
|
17649
17713
|
* Handle incoming audio frame data
|
|
17650
17714
|
*/
|
|
17651
17715
|
async handleAudioData(l) {
|
|
17652
|
-
var r, t, e, i, a, s, d,
|
|
17716
|
+
var r, t, e, i, a, s, d, c, F, B;
|
|
17653
17717
|
if (!this.config.enableAudio)
|
|
17654
17718
|
return;
|
|
17655
17719
|
const n = this.audioCodecData ?? void 0;
|
|
17656
17720
|
(t = (r = l.header) == null ? void 0 : r.media) != null && t.codecData && codecDataChanged(n, l.header.media.codecData) && (this.audioCodecData = l.header.media.codecData, this.audioPlayer && (this.audioPlayer.dispose(), this.audioPlayer = null), this.audioContext || (this.audioContext = new AudioContext(), this.ownsAudioContext = !0), this.audioPlayer = new LiveAudioPlayer(this.audioContext, {
|
|
17657
17721
|
bufferDelayMs: this.config.bufferDelayMs ?? 100
|
|
17658
|
-
}), await this.audioPlayer.init((e = l.header.media) == null ? void 0 : e.codecData), this.audioPlayer.start(), this.logger.info(`Audio player started: ${(a = (i = l.header.media) == null ? void 0 : i.codecData) == null ? void 0 : a.codecType}, ${(d = (s = l.header.media) == null ? void 0 : s.codecData) == null ? void 0 : d.sampleRate}Hz, ${(F = (
|
|
17722
|
+
}), await this.audioPlayer.init((e = l.header.media) == null ? void 0 : e.codecData), this.audioPlayer.start(), this.logger.info(`Audio player started: ${(a = (i = l.header.media) == null ? void 0 : i.codecData) == null ? void 0 : a.codecType}, ${(d = (s = l.header.media) == null ? void 0 : s.codecData) == null ? void 0 : d.sampleRate}Hz, ${(F = (c = l.header.media) == null ? void 0 : c.codecData) == null ? void 0 : F.channels}ch`)), this.audioPlayer && l.payload && l.header && this.audioPlayer.decode(l.payload, (B = l.header.media) == null ? void 0 : B.pts);
|
|
17659
17723
|
}
|
|
17660
17724
|
/**
|
|
17661
17725
|
* Configure the decoder for a specific codec
|
|
@@ -17730,19 +17794,19 @@ const Ko = class Ko extends BasePlayer {
|
|
|
17730
17794
|
*/
|
|
17731
17795
|
convertYUVToVideoFrame(l, n, r) {
|
|
17732
17796
|
try {
|
|
17733
|
-
const { y: t, u: e, v: i, width: a, height: s, chromaStride: d, chromaHeight:
|
|
17797
|
+
const { y: t, u: e, v: i, width: a, height: s, chromaStride: d, chromaHeight: c } = l, F = n > 0 ? n : a, B = r > 0 ? r : s, y = a * s, E = d * c, v = y + E * 2, N = new Uint8Array(v);
|
|
17734
17798
|
N.set(t.subarray(0, y), 0);
|
|
17735
17799
|
const T = a / 2, C = y;
|
|
17736
17800
|
if (d === T)
|
|
17737
17801
|
N.set(e.subarray(0, E), C);
|
|
17738
17802
|
else
|
|
17739
|
-
for (let Q = 0; Q <
|
|
17803
|
+
for (let Q = 0; Q < c; Q++)
|
|
17740
17804
|
N.set(e.subarray(Q * d, Q * d + T), C + Q * T);
|
|
17741
|
-
const m = C + T *
|
|
17805
|
+
const m = C + T * c;
|
|
17742
17806
|
if (d === T)
|
|
17743
17807
|
N.set(i.subarray(0, E), m);
|
|
17744
17808
|
else
|
|
17745
|
-
for (let Q = 0; Q <
|
|
17809
|
+
for (let Q = 0; Q < c; Q++)
|
|
17746
17810
|
N.set(i.subarray(Q * d, Q * d + T), m + Q * T);
|
|
17747
17811
|
return new VideoFrame(N, {
|
|
17748
17812
|
format: "I420",
|
|
@@ -17781,7 +17845,7 @@ const Ko = class Ko extends BasePlayer {
|
|
|
17781
17845
|
}
|
|
17782
17846
|
};
|
|
17783
17847
|
// Recent frame duration samples
|
|
17784
|
-
|
|
17848
|
+
U(Ko, "FPS_SAMPLE_COUNT", 10);
|
|
17785
17849
|
let LiveVideoPlayer = Ko;
|
|
17786
17850
|
var __defProp = Object.defineProperty, __export = (u, o) => {
|
|
17787
17851
|
for (var l in o)
|
|
@@ -19081,9 +19145,9 @@ var __defProp = Object.defineProperty, __export = (u, o) => {
|
|
|
19081
19145
|
parseInt(l[s])
|
|
19082
19146
|
) : typeof s == "number" ? s : s === "*" ? void 0 : parseInt(s);
|
|
19083
19147
|
if (typeof a == "string") {
|
|
19084
|
-
const
|
|
19148
|
+
const c = a.replace(/(le|be)$/, "");
|
|
19085
19149
|
let F;
|
|
19086
|
-
switch (/le$/.test(a) ? F = 2 : /be$/.test(a) && (F = 1),
|
|
19150
|
+
switch (/le$/.test(a) ? F = 2 : /be$/.test(a) && (F = 1), c) {
|
|
19087
19151
|
case "uint8":
|
|
19088
19152
|
n = this.readUint8Array(d);
|
|
19089
19153
|
break;
|
|
@@ -19126,24 +19190,24 @@ var __defProp = Object.defineProperty, __export = (u, o) => {
|
|
|
19126
19190
|
}
|
|
19127
19191
|
} else if (d) {
|
|
19128
19192
|
n = new Array(d);
|
|
19129
|
-
for (let
|
|
19193
|
+
for (let c = 0; c < d; c++) {
|
|
19130
19194
|
const F = this.readType(a, l);
|
|
19131
19195
|
if (!F)
|
|
19132
19196
|
return;
|
|
19133
|
-
n[
|
|
19197
|
+
n[c] = F;
|
|
19134
19198
|
}
|
|
19135
19199
|
} else
|
|
19136
19200
|
for (n = []; ; ) {
|
|
19137
|
-
const
|
|
19201
|
+
const c = this.position;
|
|
19138
19202
|
try {
|
|
19139
19203
|
const F = this.readType(a, l);
|
|
19140
19204
|
if (!F) {
|
|
19141
|
-
this.position =
|
|
19205
|
+
this.position = c;
|
|
19142
19206
|
break;
|
|
19143
19207
|
}
|
|
19144
19208
|
n.push(F);
|
|
19145
19209
|
} catch {
|
|
19146
|
-
this.position =
|
|
19210
|
+
this.position = c;
|
|
19147
19211
|
break;
|
|
19148
19212
|
}
|
|
19149
19213
|
}
|
|
@@ -19973,13 +20037,13 @@ function parseOneBox(u, o, l) {
|
|
|
19973
20037
|
"BoxParser",
|
|
19974
20038
|
"'" + d + "' box writing not yet implemented, keeping unparsed data in memory for later write"
|
|
19975
20039
|
), n.parseDataAndRewind(u)), n.parse(u);
|
|
19976
|
-
const
|
|
19977
|
-
return
|
|
20040
|
+
const c = u.getPosition() - (n.start + n.size);
|
|
20041
|
+
return c < 0 ? (Log.warn(
|
|
19978
20042
|
"BoxParser",
|
|
19979
|
-
"Parsing of box '" + d + "' did not read the entire indicated box data size (missing " + -
|
|
19980
|
-
), u.seek(n.start + n.size)) :
|
|
20043
|
+
"Parsing of box '" + d + "' did not read the entire indicated box data size (missing " + -c + " bytes), seeking forward"
|
|
20044
|
+
), u.seek(n.start + n.size)) : c > 0 && n.size !== 0 && (Log.error(
|
|
19981
20045
|
"BoxParser",
|
|
19982
|
-
"Parsing of box '" + d + "' read " +
|
|
20046
|
+
"Parsing of box '" + d + "' read " + c + " more bytes than the indicated box data size, seeking backwards"
|
|
19983
20047
|
), u.seek(n.start + n.size)), { code: OK, box: n, size: n.size };
|
|
19984
20048
|
}
|
|
19985
20049
|
var ContainerBox = class extends Box {
|
|
@@ -20281,15 +20345,15 @@ var ContainerBox = class extends Box {
|
|
|
20281
20345
|
constructor() {
|
|
20282
20346
|
super(...arguments), this.box_name = "SampleTableBox", this.sgpds = [], this.sbgps = [], this.subBoxNames = ["sgpd", "sbgp"];
|
|
20283
20347
|
}
|
|
20284
|
-
}, ut.fourcc = "stbl", ut),
|
|
20348
|
+
}, ut.fourcc = "stbl", ut), ct, mvexBox = (ct = class extends ContainerBox {
|
|
20285
20349
|
constructor() {
|
|
20286
20350
|
super(...arguments), this.box_name = "MovieExtendsBox", this.trexs = [], this.subBoxNames = ["trex"];
|
|
20287
20351
|
}
|
|
20288
|
-
},
|
|
20352
|
+
}, ct.fourcc = "mvex", ct), Ut, moofBox = (Ut = class extends ContainerBox {
|
|
20289
20353
|
constructor() {
|
|
20290
20354
|
super(...arguments), this.box_name = "MovieFragmentBox", this.trafs = [], this.subBoxNames = ["traf"];
|
|
20291
20355
|
}
|
|
20292
|
-
},
|
|
20356
|
+
}, Ut.fourcc = "moof", Ut), Ft, trafBox = (Ft = class extends ContainerBox {
|
|
20293
20357
|
constructor() {
|
|
20294
20358
|
super(...arguments), this.box_name = "TrackFragmentBox", this.truns = [], this.sgpds = [], this.sbgps = [], this.subBoxNames = ["trun", "sgpd", "sbgp"];
|
|
20295
20359
|
}
|
|
@@ -20564,7 +20628,7 @@ var ContainerBox = class extends Box {
|
|
|
20564
20628
|
throw new Error("Error reading base offset size");
|
|
20565
20629
|
}
|
|
20566
20630
|
const s = [], d = o.readUint16();
|
|
20567
|
-
for (let
|
|
20631
|
+
for (let c = 0; c < d; c++) {
|
|
20568
20632
|
let F = 0, B = 0, S = 0;
|
|
20569
20633
|
if (this.version === 1 || this.version === 2)
|
|
20570
20634
|
switch (this.index_size) {
|
|
@@ -20968,12 +21032,12 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
20968
21032
|
constructor() {
|
|
20969
21033
|
super(...arguments), this.box_name = "LHEVCSampleEntry";
|
|
20970
21034
|
}
|
|
20971
|
-
}, ue.fourcc = "lhe1", ue),
|
|
21035
|
+
}, ue.fourcc = "lhe1", ue), ce, lhv1SampleEntry = (ce = class extends VisualSampleEntry {
|
|
20972
21036
|
constructor() {
|
|
20973
21037
|
super(...arguments), this.box_name = "LHEVCSampleEntry";
|
|
20974
21038
|
}
|
|
20975
|
-
},
|
|
20976
|
-
},
|
|
21039
|
+
}, ce.fourcc = "lhv1", ce), Ue, dvh1SampleEntry = (Ue = class extends VisualSampleEntry {
|
|
21040
|
+
}, Ue.fourcc = "dvh1", Ue), Fe, dvheSampleEntry = (Fe = class extends VisualSampleEntry {
|
|
20977
21041
|
}, Fe.fourcc = "dvhe", Fe), vvcCSampleEntryBase = class extends VisualSampleEntry {
|
|
20978
21042
|
getCodec() {
|
|
20979
21043
|
let u = super.getCodec();
|
|
@@ -21401,7 +21465,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21401
21465
|
print(o) {
|
|
21402
21466
|
super.printHeader(o), o.log(o.indent + "creation_time: " + this.creation_time), o.log(o.indent + "modification_time: " + this.modification_time), o.log(o.indent + "track_id: " + this.track_id), o.log(o.indent + "duration: " + this.duration), o.log(o.indent + "volume: " + (this.volume >> 8)), o.log(o.indent + "matrix: " + this.matrix.join(", ")), o.log(o.indent + "layer: " + this.layer), o.log(o.indent + "alternate_group: " + this.alternate_group), o.log(o.indent + "width: " + this.width), o.log(o.indent + "height: " + this.height);
|
|
21403
21467
|
}
|
|
21404
|
-
}, un.fourcc = "tkhd", un),
|
|
21468
|
+
}, un.fourcc = "tkhd", un), cn, trexBox = (cn = class extends FullBox {
|
|
21405
21469
|
constructor() {
|
|
21406
21470
|
super(...arguments), this.box_name = "TrackExtendsBox";
|
|
21407
21471
|
}
|
|
@@ -21411,7 +21475,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21411
21475
|
write(o) {
|
|
21412
21476
|
this.version = 0, this.flags = 0, this.size = 4 * 5, this.writeHeader(o), o.writeUint32(this.track_id), o.writeUint32(this.default_sample_description_index), o.writeUint32(this.default_sample_duration), o.writeUint32(this.default_sample_size), o.writeUint32(this.default_sample_flags);
|
|
21413
21477
|
}
|
|
21414
|
-
},
|
|
21478
|
+
}, cn.fourcc = "trex", cn), Un, trunBox = (Un = class extends FullBox {
|
|
21415
21479
|
constructor() {
|
|
21416
21480
|
super(...arguments), this.box_name = "TrackRunBox", this.sample_duration = [], this.sample_size = [], this.sample_flags = [], this.sample_composition_time_offset = [];
|
|
21417
21481
|
}
|
|
@@ -21428,7 +21492,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21428
21492
|
for (let l = 0; l < this.sample_count; l++)
|
|
21429
21493
|
this.flags & TRUN_FLAGS_DURATION && o.writeUint32(this.sample_duration[l]), this.flags & TRUN_FLAGS_SIZE && o.writeUint32(this.sample_size[l]), this.flags & TRUN_FLAGS_FLAGS && o.writeUint32(this.sample_flags[l]), this.flags & TRUN_FLAGS_CTS_OFFSET && (this.version === 0 ? o.writeUint32(this.sample_composition_time_offset[l]) : o.writeInt32(this.sample_composition_time_offset[l]));
|
|
21430
21494
|
}
|
|
21431
|
-
},
|
|
21495
|
+
}, Un.fourcc = "trun", Un), Fn, urlBox = (Fn = class extends FullBox {
|
|
21432
21496
|
constructor() {
|
|
21433
21497
|
super(...arguments), this.box_name = "DataEntryUrlBox";
|
|
21434
21498
|
}
|
|
@@ -21647,7 +21711,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21647
21711
|
mime: ""
|
|
21648
21712
|
};
|
|
21649
21713
|
for (let r = 0; r < this.moov.traks.length; r++) {
|
|
21650
|
-
const t = this.moov.traks[r], e = t.mdia.minf.stbl.stsd.entries[0], i = t.samples_size, a = t.mdia.mdhd.timescale, s = t.samples_duration, d = i * 8 * a / s,
|
|
21714
|
+
const t = this.moov.traks[r], e = t.mdia.minf.stbl.stsd.entries[0], i = t.samples_size, a = t.mdia.mdhd.timescale, s = t.samples_duration, d = i * 8 * a / s, c = {
|
|
21651
21715
|
samples_duration: s,
|
|
21652
21716
|
bitrate: d,
|
|
21653
21717
|
size: i,
|
|
@@ -21673,20 +21737,20 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21673
21737
|
track_width: t.tkhd.width / 65536,
|
|
21674
21738
|
volume: t.tkhd.volume
|
|
21675
21739
|
};
|
|
21676
|
-
if (n.tracks.push(
|
|
21740
|
+
if (n.tracks.push(c), t.tref)
|
|
21677
21741
|
for (let F = 0; F < t.tref.references.length; F++)
|
|
21678
|
-
|
|
21742
|
+
c.references.push({
|
|
21679
21743
|
type: t.tref.references[F].type,
|
|
21680
21744
|
track_ids: t.tref.references[F].track_ids
|
|
21681
21745
|
});
|
|
21682
|
-
t.edts !== void 0 && t.edts.elst !== void 0 && (
|
|
21746
|
+
t.edts !== void 0 && t.edts.elst !== void 0 && (c.edits = t.edts.elst.entries), e instanceof AudioSampleEntry ? (c.type = "audio", n.audioTracks.push(c), c.audio = {
|
|
21683
21747
|
sample_rate: e.getSampleRate(),
|
|
21684
21748
|
channel_count: e.getChannelCount(),
|
|
21685
21749
|
sample_size: e.getSampleSize()
|
|
21686
|
-
}) : e instanceof VisualSampleEntry ? (
|
|
21750
|
+
}) : e instanceof VisualSampleEntry ? (c.type = "video", n.videoTracks.push(c), c.video = {
|
|
21687
21751
|
width: e.getWidth(),
|
|
21688
21752
|
height: e.getHeight()
|
|
21689
|
-
}) : e instanceof SubtitleSampleEntry ? (
|
|
21753
|
+
}) : e instanceof SubtitleSampleEntry ? (c.type = "subtitles", n.subtitleTracks.push(c)) : e instanceof HintSampleEntry ? (c.type = "metadata", n.hintTracks.push(c)) : e instanceof MetadataSampleEntry ? (c.type = "metadata", n.metadataTracks.push(c)) : (c.type = "metadata", n.otherTracks.push(c));
|
|
21690
21754
|
}
|
|
21691
21755
|
n.videoTracks && n.videoTracks.length > 0 ? n.mime += 'video/mp4; codecs="' : n.audioTracks && n.audioTracks.length > 0 ? n.mime += 'audio/mp4; codecs="' : n.mime += 'application/mp4; codecs="';
|
|
21692
21756
|
for (let r = 0; r < n.tracks.length; r++)
|
|
@@ -21711,12 +21775,12 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21711
21775
|
}
|
|
21712
21776
|
n.state.accumulatedSize += t.size;
|
|
21713
21777
|
const e = r.nextSample + 1, i = e - n.state.lastFragmentSampleNumber > n.nb_samples_per_fragment, a = e - n.state.lastSegmentSampleNumber > n.nb_samples;
|
|
21714
|
-
let s = i || e % n.nb_samples_per_fragment === 0, d = a || e % n.nb_samples === 0,
|
|
21778
|
+
let s = i || e % n.nb_samples_per_fragment === 0, d = a || e % n.nb_samples === 0, c = n.state.accumulatedSize >= n.size_per_segment;
|
|
21715
21779
|
const F = !n.rapAlignement || t.is_sync, B = o || r.nextSample + 1 >= r.samples.length;
|
|
21716
21780
|
if (B && !F && Log.warn(
|
|
21717
21781
|
"ISOFile",
|
|
21718
21782
|
"Flushing track #" + n.id + " at sample #" + r.nextSample + " which is not a RAP, this may lead to playback issues"
|
|
21719
|
-
), s = s && F, d = d && F,
|
|
21783
|
+
), s = s && F, d = d && F, c = c && F, s || c || B) {
|
|
21720
21784
|
i ? Log.warn(
|
|
21721
21785
|
"ISOFile",
|
|
21722
21786
|
"Fragment on track #" + n.id + " is overdue, creating it with samples [" + n.state.lastFragmentSampleNumber + ", " + r.nextSample + "]"
|
|
@@ -21737,7 +21801,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21737
21801
|
continue;
|
|
21738
21802
|
}
|
|
21739
21803
|
}
|
|
21740
|
-
(d ||
|
|
21804
|
+
(d || c || B) && (a ? Log.warn(
|
|
21741
21805
|
"ISOFile",
|
|
21742
21806
|
"Segment on track #" + n.id + " is overdue, sending it with samples [" + Math.max(0, r.nextSample - n.nb_samples) + ", " + (r.nextSample - 1) + "]"
|
|
21743
21807
|
) : Log.info(
|
|
@@ -21906,9 +21970,9 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21906
21970
|
createFragment(o, l, n, r) {
|
|
21907
21971
|
const t = [];
|
|
21908
21972
|
for (let d = l; d <= n; d++) {
|
|
21909
|
-
const
|
|
21973
|
+
const c = this.getTrackById(o), F = this.getSample(c, d);
|
|
21910
21974
|
if (!F) {
|
|
21911
|
-
this.setNextSeekPositionFromSample(
|
|
21975
|
+
this.setNextSeekPositionFromSample(c.samples[d]);
|
|
21912
21976
|
return;
|
|
21913
21977
|
}
|
|
21914
21978
|
t.push(F);
|
|
@@ -21926,8 +21990,8 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
21926
21990
|
let s = 0;
|
|
21927
21991
|
for (const d of t)
|
|
21928
21992
|
if (d.data) {
|
|
21929
|
-
const
|
|
21930
|
-
a.stream.insertBuffer(
|
|
21993
|
+
const c = MP4BoxBuffer.fromArrayBuffer(d.data.buffer, s);
|
|
21994
|
+
a.stream.insertBuffer(c), s += d.data.byteLength;
|
|
21931
21995
|
}
|
|
21932
21996
|
return a.write(e), e;
|
|
21933
21997
|
}
|
|
@@ -22072,7 +22136,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22072
22136
|
buildTrakSampleLists(o) {
|
|
22073
22137
|
let l, n, r, t, e, i;
|
|
22074
22138
|
o.samples = [], o.samples_duration = 0, o.samples_size = 0;
|
|
22075
|
-
const a = o.mdia.minf.stbl.stco || o.mdia.minf.stbl.co64, s = o.mdia.minf.stbl.stsc, d = o.mdia.minf.stbl.stsz || o.mdia.minf.stbl.stz2,
|
|
22139
|
+
const a = o.mdia.minf.stbl.stco || o.mdia.minf.stbl.co64, s = o.mdia.minf.stbl.stsc, d = o.mdia.minf.stbl.stsz || o.mdia.minf.stbl.stz2, c = o.mdia.minf.stbl.stts, F = o.mdia.minf.stbl.ctts, B = o.mdia.minf.stbl.stss, S = o.mdia.minf.stbl.stsd, y = o.mdia.minf.stbl.subs, E = o.mdia.minf.stbl.stdp, v = o.mdia.minf.stbl.sbgps, N = o.mdia.minf.stbl.sgpds;
|
|
22076
22140
|
let T = -1, C = -1, m = -1, Q = -1, p = 0, f = 0, h = 0;
|
|
22077
22141
|
if (w.initSampleGroups(o, void 0, v, N), !(typeof d > "u")) {
|
|
22078
22142
|
for (l = 0; l < d.sample_sizes.length; l++) {
|
|
@@ -22083,7 +22147,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22083
22147
|
alreadyRead: 0,
|
|
22084
22148
|
size: d.sample_sizes[l]
|
|
22085
22149
|
};
|
|
22086
|
-
o.samples[l] = R, o.samples_size += R.size, l === 0 ? (r = 1, n = 0, R.chunk_index = r, R.chunk_run_index = n, i = s.samples_per_chunk[n], e = 0, n + 1 < s.first_chunk.length ? t = s.first_chunk[n + 1] - 1 : t = 1 / 0) : l < i ? (R.chunk_index = r, R.chunk_run_index = n) : (r++, R.chunk_index = r, e = 0, r <= t || (n++, n + 1 < s.first_chunk.length ? t = s.first_chunk[n + 1] - 1 : t = 1 / 0), R.chunk_run_index = n, i += s.samples_per_chunk[n]), R.description_index = s.sample_description_index[R.chunk_run_index] - 1, R.description = S.entries[R.description_index], R.offset = a.chunk_offsets[R.chunk_index - 1] + e, e += R.size, l > T && (C++, T < 0 && (T = 0), T +=
|
|
22150
|
+
o.samples[l] = R, o.samples_size += R.size, l === 0 ? (r = 1, n = 0, R.chunk_index = r, R.chunk_run_index = n, i = s.samples_per_chunk[n], e = 0, n + 1 < s.first_chunk.length ? t = s.first_chunk[n + 1] - 1 : t = 1 / 0) : l < i ? (R.chunk_index = r, R.chunk_run_index = n) : (r++, R.chunk_index = r, e = 0, r <= t || (n++, n + 1 < s.first_chunk.length ? t = s.first_chunk[n + 1] - 1 : t = 1 / 0), R.chunk_run_index = n, i += s.samples_per_chunk[n]), R.description_index = s.sample_description_index[R.chunk_run_index] - 1, R.description = S.entries[R.description_index], R.offset = a.chunk_offsets[R.chunk_index - 1] + e, e += R.size, l > T && (C++, T < 0 && (T = 0), T += c.sample_counts[C]), l > 0 ? (o.samples[l - 1].duration = c.sample_deltas[C], o.samples_duration += o.samples[l - 1].duration, R.dts = o.samples[l - 1].dts + o.samples[l - 1].duration) : R.dts = 0, F ? (l >= m && (Q++, m < 0 && (m = 0), m += F.sample_counts[Q]), R.cts = o.samples[l].dts + F.sample_offsets[Q]) : R.cts = R.dts, B ? (l === B.sample_numbers[p] - 1 ? (R.is_sync = !0, p++) : (R.is_sync = !1, R.degradation_priority = 0), y && y.entries[f].sample_delta + h === l + 1 && (R.subsamples = y.entries[f].subsamples, h += y.entries[f].sample_delta, f++)) : R.is_sync = !0, w.process_sdtp(o.mdia.minf.stbl.sdtp, R, R.number), E ? R.degradation_priority = E.priority[l] : R.degradation_priority = 0, y && y.entries[f].sample_delta + h === l && (R.subsamples = y.entries[f].subsamples, h += y.entries[f].sample_delta), (v.length > 0 || N.length > 0) && w.setSampleGroupProperties(o, R, l, o.sample_groups_info);
|
|
22087
22151
|
}
|
|
22088
22152
|
l > 0 && (o.samples[l - 1].duration = Math.max(o.mdia.mdhd.duration - o.samples[l - 1].dts, 0), o.samples_duration += o.samples[l - 1].duration);
|
|
22089
22153
|
}
|
|
@@ -22100,8 +22164,8 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22100
22164
|
if (this.lastMoofIndex++, e.type === "moof") {
|
|
22101
22165
|
const i = e;
|
|
22102
22166
|
for (let a = 0; a < i.trafs.length; a++) {
|
|
22103
|
-
const s = i.trafs[a], d = this.getTrackById(s.tfhd.track_id),
|
|
22104
|
-
s.tfhd.flags & TFHD_FLAG_SAMPLE_DESC ? o = s.tfhd.default_sample_description_index : o =
|
|
22167
|
+
const s = i.trafs[a], d = this.getTrackById(s.tfhd.track_id), c = this.getTrexById(s.tfhd.track_id);
|
|
22168
|
+
s.tfhd.flags & TFHD_FLAG_SAMPLE_DESC ? o = s.tfhd.default_sample_description_index : o = c ? c.default_sample_description_index : 1, s.tfhd.flags & TFHD_FLAG_SAMPLE_DUR ? l = s.tfhd.default_sample_duration : l = c ? c.default_sample_duration : 0, s.tfhd.flags & TFHD_FLAG_SAMPLE_SIZE ? n = s.tfhd.default_sample_size : n = c ? c.default_sample_size : 0, s.tfhd.flags & TFHD_FLAG_SAMPLE_FLAGS ? r = s.tfhd.default_sample_flags : r = c ? c.default_sample_flags : 0, s.sample_number = 0, s.sbgps.length > 0 && w.initSampleGroups(d, s, s.sbgps, d.mdia.minf.stbl.sgpds, s.sgpds);
|
|
22105
22169
|
for (let F = 0; F < s.truns.length; F++) {
|
|
22106
22170
|
const B = s.truns[F];
|
|
22107
22171
|
for (let S = 0; S < B.sample_count; S++) {
|
|
@@ -22346,8 +22410,8 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22346
22410
|
for (let s = 0; s < i.props.length; s++) {
|
|
22347
22411
|
const d = i.props[s];
|
|
22348
22412
|
if (d.property_index > 0 && d.property_index - 1 < n.iprp.ipco.boxes.length) {
|
|
22349
|
-
const
|
|
22350
|
-
a.properties[
|
|
22413
|
+
const c = n.iprp.ipco.boxes[d.property_index - 1];
|
|
22414
|
+
a.properties[c.type] = c, a.properties.boxes.push(c);
|
|
22351
22415
|
}
|
|
22352
22416
|
}
|
|
22353
22417
|
}
|
|
@@ -22502,8 +22566,8 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22502
22566
|
"ISOFile",
|
|
22503
22567
|
"Transferring 'mdat' data from buffer #" + t + " (" + i + " to " + a + ")"
|
|
22504
22568
|
);
|
|
22505
|
-
const s = a - i, d = new MP4BoxBuffer(s),
|
|
22506
|
-
DataStream.memcpy(d, 0, e, i, s), d.fileStart =
|
|
22569
|
+
const s = a - i, d = new MP4BoxBuffer(s), c = l.stream.getAbsoluteEndPosition();
|
|
22570
|
+
DataStream.memcpy(d, 0, e, i, s), d.fileStart = c, l.stream.insertBuffer(d), e.usedBytes += s;
|
|
22507
22571
|
}
|
|
22508
22572
|
}
|
|
22509
22573
|
}
|
|
@@ -22555,25 +22619,25 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22555
22619
|
const s = t.addBox(new minfBox()), d = BoxRegistry.sampleEntry[l.type];
|
|
22556
22620
|
if (!d)
|
|
22557
22621
|
return;
|
|
22558
|
-
const
|
|
22559
|
-
if (
|
|
22560
|
-
const Q =
|
|
22622
|
+
const c = new d();
|
|
22623
|
+
if (c.data_reference_index = 1, c instanceof VisualSampleEntry) {
|
|
22624
|
+
const Q = c, p = s.addBox(new vmhdBox());
|
|
22561
22625
|
p.graphicsmode = 0, p.opcolor = [0, 0, 0], Q.width = l.width, Q.height = l.height, Q.horizresolution = 72 << 16, Q.vertresolution = 72 << 16, Q.frame_count = 1, Q.compressorname = l.type + " Compressor", Q.depth = 24, l.avcDecoderConfigRecord ? Q.addBox(new avcCBox(l.avcDecoderConfigRecord.byteLength)).parse(new DataStream(l.avcDecoderConfigRecord)) : l.hevcDecoderConfigRecord && Q.addBox(new hvcCBox(l.hevcDecoderConfigRecord.byteLength)).parse(new DataStream(l.hevcDecoderConfigRecord));
|
|
22562
|
-
} else if (
|
|
22563
|
-
const Q =
|
|
22626
|
+
} else if (c instanceof AudioSampleEntry) {
|
|
22627
|
+
const Q = c, p = s.addBox(new smhdBox());
|
|
22564
22628
|
p.balance = l.balance || 0, Q.channel_count = l.channel_count || 2, Q.samplesize = l.samplesize || 16, Q.samplerate = l.samplerate || 65536;
|
|
22565
22629
|
} else
|
|
22566
|
-
|
|
22567
|
-
l.description &&
|
|
22568
|
-
|
|
22630
|
+
c instanceof HintSampleEntry ? s.addBox(new hmhdBox()) : c instanceof SubtitleSampleEntry ? (s.addBox(new sthdBox()), c instanceof stppSampleEntry && (c.namespace = l.namespace || "nonamespace", c.schema_location = l.schema_location || "", c.auxiliary_mime_types = l.auxiliary_mime_types || "")) : c instanceof MetadataSampleEntry ? s.addBox(new nmhdBox()) : c instanceof SystemSampleEntry ? s.addBox(new nmhdBox()) : s.addBox(new nmhdBox());
|
|
22631
|
+
l.description && c.addBox.call(
|
|
22632
|
+
c,
|
|
22569
22633
|
l.description
|
|
22570
22634
|
), l.description_boxes && l.description_boxes.forEach(function(Q) {
|
|
22571
|
-
|
|
22635
|
+
c.addBox.call(c, Q);
|
|
22572
22636
|
});
|
|
22573
22637
|
const B = s.addBox(new dinfBox()).addBox(new drefBox()), S = new urlBox();
|
|
22574
22638
|
S.flags = 1, B.addEntry(S);
|
|
22575
22639
|
const y = s.addBox(new stblBox());
|
|
22576
|
-
y.addBox(new stsdBox()).addEntry(
|
|
22640
|
+
y.addBox(new stsdBox()).addEntry(c);
|
|
22577
22641
|
const v = y.addBox(new sttsBox());
|
|
22578
22642
|
v.sample_counts = [], v.sample_deltas = [];
|
|
22579
22643
|
const N = y.addBox(new stscBox());
|
|
@@ -22595,7 +22659,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22595
22659
|
is_leading: a = 0,
|
|
22596
22660
|
depends_on: s = 0,
|
|
22597
22661
|
is_depended_on: d = 0,
|
|
22598
|
-
has_redundancy:
|
|
22662
|
+
has_redundancy: c = 0,
|
|
22599
22663
|
degradation_priority: F = 0,
|
|
22600
22664
|
subsamples: B,
|
|
22601
22665
|
offset: S = 0
|
|
@@ -22619,7 +22683,7 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22619
22683
|
is_leading: a,
|
|
22620
22684
|
depends_on: s,
|
|
22621
22685
|
is_depended_on: d,
|
|
22622
|
-
has_redundancy:
|
|
22686
|
+
has_redundancy: c,
|
|
22623
22687
|
degradation_priority: F,
|
|
22624
22688
|
offset: S,
|
|
22625
22689
|
subsamples: B
|
|
@@ -22650,8 +22714,8 @@ var avcCSampleEntryBase = class extends VisualSampleEntry {
|
|
|
22650
22714
|
const s = e.addBox(new trunBox());
|
|
22651
22715
|
s.flags = TRUN_FLAGS_DATA_OFFSET | TRUN_FLAGS_DURATION | TRUN_FLAGS_SIZE | TRUN_FLAGS_FLAGS | TRUN_FLAGS_CTS_OFFSET, s.data_offset = 0, s.first_sample_flags = 0, s.sample_count = o.length;
|
|
22652
22716
|
for (const d of o) {
|
|
22653
|
-
let
|
|
22654
|
-
d.is_sync ?
|
|
22717
|
+
let c = 0;
|
|
22718
|
+
d.is_sync ? c = 1 << 25 : c = 65536, s.sample_duration.push(d.duration), s.sample_size.push(d.size), s.sample_flags.push(c), s.sample_composition_time_offset.push(d.cts - d.dts);
|
|
22655
22719
|
}
|
|
22656
22720
|
return r;
|
|
22657
22721
|
}
|
|
@@ -23516,14 +23580,14 @@ var pn, a1lxBox = (pn = class extends Box {
|
|
|
23516
23580
|
parse(o) {
|
|
23517
23581
|
this.angle = o.readUint8() & 3;
|
|
23518
23582
|
}
|
|
23519
|
-
}, ui.fourcc = "irot", ui),
|
|
23583
|
+
}, ui.fourcc = "irot", ui), ci, ispeBox = (ci = class extends FullBox {
|
|
23520
23584
|
constructor() {
|
|
23521
23585
|
super(...arguments), this.box_name = "ImageSpatialExtentsProperty";
|
|
23522
23586
|
}
|
|
23523
23587
|
parse(o) {
|
|
23524
23588
|
this.parseFullHeader(o), this.image_width = o.readUint32(), this.image_height = o.readUint32();
|
|
23525
23589
|
}
|
|
23526
|
-
},
|
|
23590
|
+
}, ci.fourcc = "ispe", ci), Ui, itaiBox = (Ui = class extends FullBox {
|
|
23527
23591
|
constructor() {
|
|
23528
23592
|
super(...arguments), this.box_name = "TAITimestampBox";
|
|
23529
23593
|
}
|
|
@@ -23532,7 +23596,7 @@ var pn, a1lxBox = (pn = class extends Box {
|
|
|
23532
23596
|
const l = o.readUint8();
|
|
23533
23597
|
this.sychronization_state = l >> 7 & 1, this.timestamp_generation_failure = l >> 6 & 1, this.timestamp_is_modified = l >> 5 & 1;
|
|
23534
23598
|
}
|
|
23535
|
-
},
|
|
23599
|
+
}, Ui.fourcc = "itai", Ui), Fi, kindBox = (Fi = class extends FullBox {
|
|
23536
23600
|
constructor() {
|
|
23537
23601
|
super(...arguments), this.box_name = "KindBox";
|
|
23538
23602
|
}
|
|
@@ -24173,21 +24237,21 @@ var _, dataBox = (_ = class extends Box {
|
|
|
24173
24237
|
parse(o) {
|
|
24174
24238
|
this.time = o.readUint32();
|
|
24175
24239
|
}
|
|
24176
|
-
}, uo.fourcc = "tmax", uo),
|
|
24240
|
+
}, uo.fourcc = "tmax", uo), co, tminBox = (co = class extends Box {
|
|
24177
24241
|
constructor() {
|
|
24178
24242
|
super(...arguments), this.box_name = "hintminrelativetime";
|
|
24179
24243
|
}
|
|
24180
24244
|
parse(o) {
|
|
24181
24245
|
this.time = o.readUint32();
|
|
24182
24246
|
}
|
|
24183
|
-
},
|
|
24247
|
+
}, co.fourcc = "tmin", co), Uo, totlBox = (Uo = class extends Box {
|
|
24184
24248
|
constructor() {
|
|
24185
24249
|
super(...arguments), this.box_name = "hintBytesSent";
|
|
24186
24250
|
}
|
|
24187
24251
|
parse(o) {
|
|
24188
24252
|
this.bytessent = o.readUint32();
|
|
24189
24253
|
}
|
|
24190
|
-
},
|
|
24254
|
+
}, Uo.fourcc = "totl", Uo), Fo, tpayBox = (Fo = class extends Box {
|
|
24191
24255
|
constructor() {
|
|
24192
24256
|
super(...arguments), this.box_name = "hintBytesSent";
|
|
24193
24257
|
}
|
|
@@ -24498,27 +24562,27 @@ registerBoxes(all_boxes_exports);
|
|
|
24498
24562
|
registerDescriptors(descriptor_exports);
|
|
24499
24563
|
class MP4FileSource {
|
|
24500
24564
|
constructor(o = {}) {
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
|
|
24505
|
-
|
|
24506
|
-
|
|
24565
|
+
U(this, "mp4File", null);
|
|
24566
|
+
U(this, "fileInfo", null);
|
|
24567
|
+
U(this, "videoTrackId", null);
|
|
24568
|
+
U(this, "audioTrackId", null);
|
|
24569
|
+
U(this, "videoTrack", null);
|
|
24570
|
+
U(this, "audioTrack", null);
|
|
24507
24571
|
// Sample extraction state
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24572
|
+
U(this, "nextVideoSampleIndex", 0);
|
|
24573
|
+
U(this, "nextAudioSampleIndex", 0);
|
|
24574
|
+
U(this, "totalVideoSamples", 0);
|
|
24575
|
+
U(this, "totalAudioSamples", 0);
|
|
24576
|
+
U(this, "samplesRequested", !1);
|
|
24577
|
+
U(this, "isProgressiveLoading", !1);
|
|
24514
24578
|
// File loading state
|
|
24515
|
-
|
|
24516
|
-
|
|
24579
|
+
U(this, "fileSize", 0);
|
|
24580
|
+
U(this, "loadedBytes", 0);
|
|
24517
24581
|
// Codec config data (needed for decoder configuration)
|
|
24518
|
-
|
|
24519
|
-
|
|
24582
|
+
U(this, "videoDescription", null);
|
|
24583
|
+
U(this, "audioDescription", null);
|
|
24520
24584
|
// Event handlers
|
|
24521
|
-
|
|
24585
|
+
U(this, "events", {});
|
|
24522
24586
|
this.events = o;
|
|
24523
24587
|
}
|
|
24524
24588
|
/**
|
|
@@ -24558,14 +24622,14 @@ class MP4FileSource {
|
|
|
24558
24622
|
return new Promise((t, e) => {
|
|
24559
24623
|
let i = !1;
|
|
24560
24624
|
const a = this.mp4File.onSamples;
|
|
24561
|
-
this.mp4File.onSamples = (
|
|
24562
|
-
!i &&
|
|
24625
|
+
this.mp4File.onSamples = (c, F, B) => {
|
|
24626
|
+
!i && c === this.videoTrackId && B.length > 0 && (i = !0), a == null || a.call(this.mp4File, c, F, B);
|
|
24563
24627
|
};
|
|
24564
24628
|
const s = this.mp4File.onReady;
|
|
24565
|
-
this.mp4File.onReady = (
|
|
24566
|
-
s == null || s.call(this.mp4File,
|
|
24629
|
+
this.mp4File.onReady = (c) => {
|
|
24630
|
+
s == null || s.call(this.mp4File, c), this.fileInfo && !r && (r = !0);
|
|
24567
24631
|
}, (async () => {
|
|
24568
|
-
var
|
|
24632
|
+
var c, F, B, S, y, E, v, N, T, C;
|
|
24569
24633
|
try {
|
|
24570
24634
|
const m = await fetch(o, {
|
|
24571
24635
|
headers: { Range: `bytes=0-${l - 1}` }
|
|
@@ -24577,7 +24641,7 @@ class MP4FileSource {
|
|
|
24577
24641
|
const f = await m.arrayBuffer();
|
|
24578
24642
|
this.fileSize = f.byteLength, this.loadedBytes = f.byteLength;
|
|
24579
24643
|
const h = f;
|
|
24580
|
-
h.fileStart = 0, (
|
|
24644
|
+
h.fileStart = 0, (c = this.mp4File) == null || c.appendBuffer(h), (F = this.mp4File) == null || F.flush(), this.fileInfo ? t(this.fileInfo) : e(new Error("File loaded but no video track found"));
|
|
24581
24645
|
return;
|
|
24582
24646
|
}
|
|
24583
24647
|
if (this.isProgressiveLoading = !0, !this.fileSize) {
|
|
@@ -24616,7 +24680,7 @@ class MP4FileSource {
|
|
|
24616
24680
|
*/
|
|
24617
24681
|
continueLoadingInBackground(o, l, n) {
|
|
24618
24682
|
(async () => {
|
|
24619
|
-
var t, e, i, a, s, d,
|
|
24683
|
+
var t, e, i, a, s, d, c, F;
|
|
24620
24684
|
let r = l;
|
|
24621
24685
|
try {
|
|
24622
24686
|
for (; r < this.fileSize; ) {
|
|
@@ -24634,7 +24698,7 @@ class MP4FileSource {
|
|
|
24634
24698
|
}
|
|
24635
24699
|
(d = this.mp4File) == null || d.flush();
|
|
24636
24700
|
} catch (B) {
|
|
24637
|
-
(F = (
|
|
24701
|
+
(F = (c = this.events).onError) == null || F.call(c, B);
|
|
24638
24702
|
}
|
|
24639
24703
|
})();
|
|
24640
24704
|
}
|
|
@@ -24656,9 +24720,9 @@ class MP4FileSource {
|
|
|
24656
24720
|
let l = 0;
|
|
24657
24721
|
return new Promise((n, r) => {
|
|
24658
24722
|
const t = (i) => {
|
|
24659
|
-
var s, d,
|
|
24723
|
+
var s, d, c;
|
|
24660
24724
|
const a = new ArrayBuffer(i.byteLength);
|
|
24661
|
-
new Uint8Array(a).set(i), a.fileStart = l, l += a.byteLength, this.loadedBytes = l, (d = (s = this.events).onProgress) == null || d.call(s, this.loadedBytes, this.fileSize), (
|
|
24725
|
+
new Uint8Array(a).set(i), a.fileStart = l, l += a.byteLength, this.loadedBytes = l, (d = (s = this.events).onProgress) == null || d.call(s, this.loadedBytes, this.fileSize), (c = this.mp4File) == null || c.appendBuffer(a);
|
|
24662
24726
|
}, e = async () => {
|
|
24663
24727
|
var i;
|
|
24664
24728
|
try {
|
|
@@ -24711,7 +24775,7 @@ class MP4FileSource {
|
|
|
24711
24775
|
* Handle file ready event
|
|
24712
24776
|
*/
|
|
24713
24777
|
handleFileReady(o) {
|
|
24714
|
-
var l, n, r, t, e, i, a, s, d,
|
|
24778
|
+
var l, n, r, t, e, i, a, s, d, c, F, B, S, y, E, v, N, T, C, m, Q, p, f, h, R, J, V, W, b, g;
|
|
24715
24779
|
if (o.videoTracks.length > 0) {
|
|
24716
24780
|
this.videoTrack = o.videoTracks[0], this.videoTrackId = this.videoTrack.id, this.totalVideoSamples = this.videoTrack.nb_samples;
|
|
24717
24781
|
const Z = (l = this.mp4File) == null ? void 0 : l.getTrackById(this.videoTrackId);
|
|
@@ -24727,7 +24791,7 @@ class MP4FileSource {
|
|
|
24727
24791
|
this.audioTrack = o.audioTracks[0], this.audioTrackId = this.audioTrack.id, this.totalAudioSamples = this.audioTrack.nb_samples;
|
|
24728
24792
|
const Z = (a = this.mp4File) == null ? void 0 : a.getTrackById(this.audioTrackId);
|
|
24729
24793
|
if (Z) {
|
|
24730
|
-
const M = (B = (F = (
|
|
24794
|
+
const M = (B = (F = (c = (d = (s = Z.mdia) == null ? void 0 : s.minf) == null ? void 0 : d.stbl) == null ? void 0 : c.stsd) == null ? void 0 : F.entries) == null ? void 0 : B[0];
|
|
24731
24795
|
if (M) {
|
|
24732
24796
|
const O = M.esds;
|
|
24733
24797
|
if (O) {
|
|
@@ -24792,10 +24856,10 @@ class MP4FileSource {
|
|
|
24792
24856
|
if (!(n ? this.videoTrack : this.audioTrack))
|
|
24793
24857
|
return;
|
|
24794
24858
|
const t = l.filter((d) => d.data != null).map((d) => {
|
|
24795
|
-
const
|
|
24859
|
+
const c = d.cts / d.timescale * 1e6, F = d.duration / d.timescale * 1e6;
|
|
24796
24860
|
return {
|
|
24797
24861
|
data: d.data,
|
|
24798
|
-
timestamp:
|
|
24862
|
+
timestamp: c,
|
|
24799
24863
|
duration: F,
|
|
24800
24864
|
isKeyframe: d.is_sync,
|
|
24801
24865
|
type: n ? "video" : "audio"
|
|
@@ -24969,14 +25033,14 @@ registerProcessor('audio-play-processor', AudioPlayProcessor);
|
|
|
24969
25033
|
`;
|
|
24970
25034
|
class FileAudioPlayer {
|
|
24971
25035
|
constructor(o, l = {}) {
|
|
24972
|
-
|
|
24973
|
-
|
|
24974
|
-
|
|
24975
|
-
|
|
24976
|
-
|
|
24977
|
-
|
|
25036
|
+
U(this, "ctx");
|
|
25037
|
+
U(this, "decoder", null);
|
|
25038
|
+
U(this, "workletNode", null);
|
|
25039
|
+
U(this, "gainNode");
|
|
25040
|
+
U(this, "initialized", !1);
|
|
25041
|
+
U(this, "targetSampleRate");
|
|
24978
25042
|
// Audio codec config from MP4
|
|
24979
|
-
|
|
25043
|
+
U(this, "codecConfig", null);
|
|
24980
25044
|
this.ctx = o, this.targetSampleRate = l.sampleRate ?? o.sampleRate, this.gainNode = this.ctx.createGain();
|
|
24981
25045
|
}
|
|
24982
25046
|
/**
|
|
@@ -25045,8 +25109,8 @@ class FileAudioPlayer {
|
|
|
25045
25109
|
if (o.numberOfChannels === 1)
|
|
25046
25110
|
r.set(d), t.set(d);
|
|
25047
25111
|
else
|
|
25048
|
-
for (let
|
|
25049
|
-
r[
|
|
25112
|
+
for (let c = 0; c < l; c++)
|
|
25113
|
+
r[c] = d[c * 2], t[c] = d[c * 2 + 1];
|
|
25050
25114
|
} else {
|
|
25051
25115
|
const a = o.allocationSize({
|
|
25052
25116
|
planeIndex: 0,
|
|
@@ -25062,12 +25126,12 @@ class FileAudioPlayer {
|
|
|
25062
25126
|
planeIndex: 1,
|
|
25063
25127
|
frameOffset: 0,
|
|
25064
25128
|
frameCount: o.numberOfFrames
|
|
25065
|
-
}),
|
|
25066
|
-
o.copyTo(
|
|
25129
|
+
}), c = new ArrayBuffer(d);
|
|
25130
|
+
o.copyTo(c, {
|
|
25067
25131
|
planeIndex: 1,
|
|
25068
25132
|
frameOffset: 0,
|
|
25069
25133
|
frameCount: o.numberOfFrames
|
|
25070
|
-
}), t.set(new Float32Array(
|
|
25134
|
+
}), t.set(new Float32Array(c));
|
|
25071
25135
|
} else
|
|
25072
25136
|
t.set(r);
|
|
25073
25137
|
}
|
|
@@ -25091,8 +25155,8 @@ class FileAudioPlayer {
|
|
|
25091
25155
|
return o;
|
|
25092
25156
|
const r = l / n, t = Math.floor(o.length / r), e = new Float32Array(t);
|
|
25093
25157
|
for (let i = 0; i < t; i++) {
|
|
25094
|
-
const a = i * r, s = Math.floor(a), d = Math.min(s + 1, o.length - 1),
|
|
25095
|
-
e[i] = o[s] * (1 -
|
|
25158
|
+
const a = i * r, s = Math.floor(a), d = Math.min(s + 1, o.length - 1), c = a - s;
|
|
25159
|
+
e[i] = o[s] * (1 - c) + o[d] * c;
|
|
25096
25160
|
}
|
|
25097
25161
|
return e;
|
|
25098
25162
|
}
|
|
@@ -25171,41 +25235,41 @@ class FileAudioPlayer {
|
|
|
25171
25235
|
class FileVideoPlayer extends BasePlayer {
|
|
25172
25236
|
constructor(l = {}) {
|
|
25173
25237
|
super("idle", l.debugLogging ?? !1);
|
|
25174
|
-
|
|
25238
|
+
U(this, "config");
|
|
25175
25239
|
// Source and decoder
|
|
25176
|
-
|
|
25177
|
-
|
|
25240
|
+
U(this, "fileSource", null);
|
|
25241
|
+
U(this, "decoder", null);
|
|
25178
25242
|
// Audio
|
|
25179
|
-
|
|
25180
|
-
|
|
25181
|
-
|
|
25182
|
-
|
|
25243
|
+
U(this, "audioContext", null);
|
|
25244
|
+
U(this, "audioPlayer", null);
|
|
25245
|
+
U(this, "ownsAudioContext", !1);
|
|
25246
|
+
U(this, "audioInitialized", !1);
|
|
25183
25247
|
// File info
|
|
25184
|
-
|
|
25248
|
+
U(this, "fileInfo", null);
|
|
25185
25249
|
// Frame buffer - sorted by timestamp
|
|
25186
|
-
|
|
25187
|
-
|
|
25250
|
+
U(this, "frameBuffer", []);
|
|
25251
|
+
U(this, "minBufferSize", 3);
|
|
25188
25252
|
// Minimum frames before starting playback (100ms at 30fps)
|
|
25189
25253
|
// Sample queues - video and audio samples waiting to be decoded
|
|
25190
|
-
|
|
25191
|
-
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25254
|
+
U(this, "sampleQueue", []);
|
|
25255
|
+
U(this, "audioSampleQueue", []);
|
|
25256
|
+
U(this, "nextSampleIndex", 0);
|
|
25257
|
+
U(this, "nextAudioSampleIndex", 0);
|
|
25258
|
+
U(this, "maxDecoderQueue", 10);
|
|
25195
25259
|
// Max chunks to keep in decoder queue
|
|
25196
25260
|
// Buffer ready promise - resolves when enough frames are buffered
|
|
25197
|
-
|
|
25261
|
+
U(this, "bufferReadyResolve", null);
|
|
25198
25262
|
// Playback state
|
|
25199
|
-
|
|
25263
|
+
U(this, "playStartTime", 0);
|
|
25200
25264
|
// performance.now() when play started
|
|
25201
|
-
|
|
25265
|
+
U(this, "playStartPosition", 0);
|
|
25202
25266
|
// Video position when play started (ms)
|
|
25203
|
-
|
|
25267
|
+
U(this, "currentPosition", 0);
|
|
25204
25268
|
// Current position in video (ms)
|
|
25205
|
-
|
|
25269
|
+
U(this, "lastVideoFrame", null);
|
|
25206
25270
|
// Seeking state
|
|
25207
|
-
|
|
25208
|
-
|
|
25271
|
+
U(this, "isSeeking", !1);
|
|
25272
|
+
U(this, "maxAudioBufferMs", 2e3);
|
|
25209
25273
|
const n = l.playMode ?? (l.loop ? "loop" : "once");
|
|
25210
25274
|
this.config = {
|
|
25211
25275
|
preferredDecoder: l.preferredDecoder ?? "webcodecs-sw",
|
|
@@ -25574,10 +25638,10 @@ function createMoQSource(u) {
|
|
|
25574
25638
|
class MoQSource extends BaseStreamSource {
|
|
25575
25639
|
constructor(l) {
|
|
25576
25640
|
super();
|
|
25577
|
-
|
|
25578
|
-
|
|
25579
|
-
|
|
25580
|
-
|
|
25641
|
+
U(this, "config");
|
|
25642
|
+
U(this, "session", null);
|
|
25643
|
+
U(this, "trackTypeMap", /* @__PURE__ */ new Map());
|
|
25644
|
+
U(this, "connecting", !1);
|
|
25581
25645
|
this.config = l;
|
|
25582
25646
|
for (const n of l.subscriptions)
|
|
25583
25647
|
this.trackTypeMap.set(n.trackName, n.streamType);
|
|
@@ -25666,15 +25730,15 @@ const moqSource = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
25666
25730
|
class WebSocketSource extends BaseStreamSource {
|
|
25667
25731
|
constructor(l = {}) {
|
|
25668
25732
|
super();
|
|
25669
|
-
|
|
25670
|
-
|
|
25671
|
-
|
|
25672
|
-
|
|
25673
|
-
|
|
25674
|
-
|
|
25675
|
-
|
|
25676
|
-
|
|
25677
|
-
|
|
25733
|
+
U(this, "webSocket", null);
|
|
25734
|
+
U(this, "messageWaiters", []);
|
|
25735
|
+
U(this, "requestId", 0);
|
|
25736
|
+
U(this, "timeoutCheckInterval", null);
|
|
25737
|
+
U(this, "config");
|
|
25738
|
+
U(this, "lastKeyframeRequest", 0);
|
|
25739
|
+
U(this, "currentTrackName", "default");
|
|
25740
|
+
U(this, "reconnectTimeout", null);
|
|
25741
|
+
U(this, "disposed", !1);
|
|
25678
25742
|
this.config = {
|
|
25679
25743
|
url: l.url || "",
|
|
25680
25744
|
useCurrentHost: l.useCurrentHost ?? !0,
|
|
@@ -25902,23 +25966,23 @@ function isAudioCodec(u) {
|
|
|
25902
25966
|
}
|
|
25903
25967
|
class MediaStreamEncoder {
|
|
25904
25968
|
constructor(o, l, n, r) {
|
|
25905
|
-
|
|
25906
|
-
|
|
25907
|
-
|
|
25908
|
-
|
|
25909
|
-
|
|
25910
|
-
|
|
25969
|
+
U(this, "audioWorker");
|
|
25970
|
+
U(this, "videoWorker");
|
|
25971
|
+
U(this, "audioProcessor");
|
|
25972
|
+
U(this, "videoProcessor");
|
|
25973
|
+
U(this, "disposed", !1);
|
|
25974
|
+
U(this, "handlers", {
|
|
25911
25975
|
chunk: /* @__PURE__ */ new Set(),
|
|
25912
25976
|
"audio-levels": /* @__PURE__ */ new Set(),
|
|
25913
25977
|
error: /* @__PURE__ */ new Set(),
|
|
25914
25978
|
ready: /* @__PURE__ */ new Set()
|
|
25915
25979
|
});
|
|
25916
|
-
|
|
25917
|
-
|
|
25918
|
-
|
|
25919
|
-
|
|
25920
|
-
|
|
25921
|
-
|
|
25980
|
+
U(this, "audioReady", !1);
|
|
25981
|
+
U(this, "videoReady", !1);
|
|
25982
|
+
U(this, "hasAudio", !1);
|
|
25983
|
+
U(this, "hasVideo", !1);
|
|
25984
|
+
U(this, "audioMetadata");
|
|
25985
|
+
U(this, "videoMetadata");
|
|
25922
25986
|
const t = o.getAudioTracks(), e = o.getVideoTracks();
|
|
25923
25987
|
this.hasAudio = t.length > 0 && !!n, this.hasVideo = e.length > 0 && !!l, this.hasAudio && n && this.createAudioEncoder(t[0], n, r), this.hasVideo && l && this.createVideoEncoder(e[0], l);
|
|
25924
25988
|
}
|
|
@@ -25955,15 +26019,15 @@ class MediaStreamEncoder {
|
|
|
25955
26019
|
new URL("/assets/audio-encoder.worker-c5c829bb.js", self.location),
|
|
25956
26020
|
{ type: "module" }
|
|
25957
26021
|
), this.audioWorker.onmessage = (s) => {
|
|
25958
|
-
const { type: d, data:
|
|
26022
|
+
const { type: d, data: c, metadata: F } = s.data;
|
|
25959
26023
|
switch (d) {
|
|
25960
26024
|
case "chunk":
|
|
25961
26025
|
this.emit("chunk", {
|
|
25962
26026
|
type: "audio",
|
|
25963
|
-
chunk:
|
|
26027
|
+
chunk: c,
|
|
25964
26028
|
keyframe: !1,
|
|
25965
26029
|
// Audio doesn't have keyframes
|
|
25966
|
-
timestamp:
|
|
26030
|
+
timestamp: c.timestamp,
|
|
25967
26031
|
metadata: {
|
|
25968
26032
|
...this.audioMetadata,
|
|
25969
26033
|
decoderConfig: F == null ? void 0 : F.decoderConfig
|
|
@@ -25971,13 +26035,13 @@ class MediaStreamEncoder {
|
|
|
25971
26035
|
});
|
|
25972
26036
|
break;
|
|
25973
26037
|
case "error":
|
|
25974
|
-
this.emit("error", new Error(`Audio encoding error: ${
|
|
26038
|
+
this.emit("error", new Error(`Audio encoding error: ${c}`));
|
|
25975
26039
|
break;
|
|
25976
26040
|
case "ready":
|
|
25977
26041
|
this.audioReady = !0, this.startProcessingAudio(o), this.checkReady();
|
|
25978
26042
|
break;
|
|
25979
26043
|
case "audio-levels":
|
|
25980
|
-
this.emit("audio-levels",
|
|
26044
|
+
this.emit("audio-levels", c);
|
|
25981
26045
|
break;
|
|
25982
26046
|
}
|
|
25983
26047
|
}, this.audioWorker.onerror = (s) => {
|
|
@@ -26007,14 +26071,14 @@ class MediaStreamEncoder {
|
|
|
26007
26071
|
new URL("/assets/video-encoder.worker-a613b1f0.js", self.location),
|
|
26008
26072
|
{ type: "module" }
|
|
26009
26073
|
), this.videoWorker.onmessage = (s) => {
|
|
26010
|
-
const { type: d, data:
|
|
26074
|
+
const { type: d, data: c, metadata: F } = s.data;
|
|
26011
26075
|
switch (d) {
|
|
26012
26076
|
case "chunk":
|
|
26013
26077
|
this.emit("chunk", {
|
|
26014
26078
|
type: "video",
|
|
26015
|
-
chunk:
|
|
26016
|
-
keyframe:
|
|
26017
|
-
timestamp:
|
|
26079
|
+
chunk: c,
|
|
26080
|
+
keyframe: c.type === "key",
|
|
26081
|
+
timestamp: c.timestamp,
|
|
26018
26082
|
metadata: {
|
|
26019
26083
|
...this.videoMetadata,
|
|
26020
26084
|
decoderConfig: F == null ? void 0 : F.decoderConfig
|
|
@@ -26022,7 +26086,7 @@ class MediaStreamEncoder {
|
|
|
26022
26086
|
});
|
|
26023
26087
|
break;
|
|
26024
26088
|
case "error":
|
|
26025
|
-
this.emit("error", new Error(`Video encoding error: ${
|
|
26089
|
+
this.emit("error", new Error(`Video encoding error: ${c}`));
|
|
26026
26090
|
break;
|
|
26027
26091
|
case "ready":
|
|
26028
26092
|
this.videoReady = !0, this.startProcessingVideo(o), this.checkReady();
|
|
@@ -26077,9 +26141,9 @@ class MediaStreamEncoder {
|
|
|
26077
26141
|
}
|
|
26078
26142
|
class BaseCaptureSink {
|
|
26079
26143
|
constructor(o) {
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26144
|
+
U(this, "config");
|
|
26145
|
+
U(this, "keyframeCallback");
|
|
26146
|
+
U(this, "_connected", !1);
|
|
26083
26147
|
this.config = o;
|
|
26084
26148
|
}
|
|
26085
26149
|
get connected() {
|
|
@@ -26101,10 +26165,10 @@ class BaseCaptureSink {
|
|
|
26101
26165
|
class WebSocketCaptureSink extends BaseCaptureSink {
|
|
26102
26166
|
constructor(l) {
|
|
26103
26167
|
super(l);
|
|
26104
|
-
|
|
26105
|
-
|
|
26106
|
-
|
|
26107
|
-
|
|
26168
|
+
U(this, "websocket");
|
|
26169
|
+
U(this, "wsConfig");
|
|
26170
|
+
U(this, "reconnectTimer");
|
|
26171
|
+
U(this, "disposed", !1);
|
|
26108
26172
|
this.wsConfig = l;
|
|
26109
26173
|
}
|
|
26110
26174
|
async connect() {
|
|
@@ -26172,17 +26236,17 @@ function createWebSocketSink(u) {
|
|
|
26172
26236
|
const tr = class tr extends BaseCaptureSink {
|
|
26173
26237
|
constructor(l) {
|
|
26174
26238
|
super(l);
|
|
26175
|
-
|
|
26176
|
-
|
|
26177
|
-
|
|
26178
|
-
|
|
26179
|
-
|
|
26239
|
+
U(this, "moqConfig");
|
|
26240
|
+
U(this, "session", null);
|
|
26241
|
+
U(this, "connecting", !1);
|
|
26242
|
+
U(this, "disposed", !1);
|
|
26243
|
+
U(this, "sessionOwned", !1);
|
|
26180
26244
|
// Track if we own the session
|
|
26181
26245
|
// Track current group for video (multiple frames can be in a group)
|
|
26182
|
-
|
|
26246
|
+
U(this, "currentVideoGroup", !0);
|
|
26183
26247
|
// Start with needing a new group
|
|
26184
26248
|
// Audio grouping: bundle 50 audio frames per group
|
|
26185
|
-
|
|
26249
|
+
U(this, "audioFrameCount", 0);
|
|
26186
26250
|
this.moqConfig = l, l.session && (this.session = l.session, this.sessionOwned = !1, this._connected = !0);
|
|
26187
26251
|
}
|
|
26188
26252
|
async connect() {
|
|
@@ -26284,21 +26348,21 @@ const tr = class tr extends BaseCaptureSink {
|
|
|
26284
26348
|
}
|
|
26285
26349
|
}
|
|
26286
26350
|
};
|
|
26287
|
-
|
|
26351
|
+
U(tr, "AUDIO_FRAMES_PER_GROUP", 50);
|
|
26288
26352
|
let MoQCaptureSink = tr;
|
|
26289
26353
|
function createMoQSink(u) {
|
|
26290
26354
|
return new MoQCaptureSink(u);
|
|
26291
26355
|
}
|
|
26292
26356
|
class MediaCapture {
|
|
26293
26357
|
constructor(o) {
|
|
26294
|
-
|
|
26295
|
-
|
|
26296
|
-
|
|
26297
|
-
|
|
26298
|
-
|
|
26299
|
-
|
|
26358
|
+
U(this, "config");
|
|
26359
|
+
U(this, "sink");
|
|
26360
|
+
U(this, "encoder");
|
|
26361
|
+
U(this, "mediaStream");
|
|
26362
|
+
U(this, "state", "idle");
|
|
26363
|
+
U(this, "disposed", !1);
|
|
26300
26364
|
// Stats tracking
|
|
26301
|
-
|
|
26365
|
+
U(this, "stats", {
|
|
26302
26366
|
videoFramesEncoded: 0,
|
|
26303
26367
|
audioFramesEncoded: 0,
|
|
26304
26368
|
bytesSent: 0,
|
|
@@ -26309,10 +26373,10 @@ class MediaCapture {
|
|
|
26309
26373
|
duration: 0
|
|
26310
26374
|
});
|
|
26311
26375
|
// Captured stream metadata
|
|
26312
|
-
|
|
26313
|
-
|
|
26376
|
+
U(this, "videoMetadata");
|
|
26377
|
+
U(this, "audioMetadata");
|
|
26314
26378
|
// Event handlers
|
|
26315
|
-
|
|
26379
|
+
U(this, "handlers", {
|
|
26316
26380
|
"state-change": /* @__PURE__ */ new Set(),
|
|
26317
26381
|
"audio-levels": /* @__PURE__ */ new Set(),
|
|
26318
26382
|
stats: /* @__PURE__ */ new Set(),
|