@supraio/client-daemon-js 0.0.0-mznacl.298 → 0.0.0-mznacl.302
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/daemon.html +1 -1
- package/daemon.js +62 -28
- package/daemon.js.map +2 -2
- package/package.json +2 -2
- package/screen/nacldecoder.d.ts +2 -2
- package/screen.html +1 -1
- package/screen.js +63 -29
- package/screen.js.map +2 -2
- package/sdk.js +65 -31
- package/sdk.js.map +2 -2
- package/supra-client-daemon.js +90 -75
- package/supra-client-daemon.js.map +1 -1
- package/supra-client-daemon.wasm +0 -0
- package/supra-client-screen.js +300 -244
- package/supra-client-screen.js.map +1 -1
- package/supra-client-screen.wasm +0 -0
package/sdk.js
CHANGED
|
@@ -17044,27 +17044,25 @@ var require_messageSender = __commonJS({
|
|
|
17044
17044
|
var MessageSender = (
|
|
17045
17045
|
/** @class */
|
|
17046
17046
|
function() {
|
|
17047
|
-
function MessageSender2(naclModuleEl, messageListeners) {
|
|
17047
|
+
function MessageSender2(naclModuleEl, messageListeners, timeoutMs) {
|
|
17048
17048
|
this.naclModuleEl = naclModuleEl;
|
|
17049
17049
|
this.messageListeners = messageListeners;
|
|
17050
|
+
this.timeoutMs = timeoutMs;
|
|
17050
17051
|
}
|
|
17051
17052
|
MessageSender2.prototype.sendWithoutResult = function(message) {
|
|
17052
17053
|
this.naclModuleEl.postMessage((0, messageConvertor_1.convertMessageToArrayBuffer)(message));
|
|
17053
17054
|
};
|
|
17054
|
-
MessageSender2.prototype.sendWithResult = function(
|
|
17055
|
-
return __awaiter(this,
|
|
17055
|
+
MessageSender2.prototype.sendWithResult = function(message, resultMessageType) {
|
|
17056
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
17056
17057
|
var arrayBuffer;
|
|
17057
17058
|
var _this = this;
|
|
17058
|
-
if (timeoutMs === void 0) {
|
|
17059
|
-
timeoutMs = 500;
|
|
17060
|
-
}
|
|
17061
17059
|
return __generator(this, function(_a) {
|
|
17062
17060
|
arrayBuffer = (0, messageConvertor_1.convertMessageToArrayBuffer)(message);
|
|
17063
17061
|
return [2, new Promise(function(resolve, reject) {
|
|
17064
17062
|
var timeoutHandler = setTimeout(function() {
|
|
17065
17063
|
_this.messageListeners.delete(listener);
|
|
17066
17064
|
reject(new Error("Timeout of message ".concat(messages_1.JSToNaClMessageType[message.type])));
|
|
17067
|
-
}, timeoutMs);
|
|
17065
|
+
}, _this.timeoutMs);
|
|
17068
17066
|
var listener = function(message2) {
|
|
17069
17067
|
if (message2.type !== resultMessageType) {
|
|
17070
17068
|
return;
|
|
@@ -17092,6 +17090,7 @@ var require_module = __commonJS({
|
|
|
17092
17090
|
"use strict";
|
|
17093
17091
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17094
17092
|
exports.createNaClModule = createNaClModule;
|
|
17093
|
+
exports.removeNaClModule = removeNaClModule;
|
|
17095
17094
|
function handleLoad(event) {
|
|
17096
17095
|
console.log("nacl load", event);
|
|
17097
17096
|
}
|
|
@@ -17117,6 +17116,16 @@ var require_module = __commonJS({
|
|
|
17117
17116
|
listenerEl.appendChild(naclModuleEl);
|
|
17118
17117
|
return naclModuleEl;
|
|
17119
17118
|
}
|
|
17119
|
+
function removeNaClModule(naclModuleEl) {
|
|
17120
|
+
var listenerEl = naclModuleEl.parentElement;
|
|
17121
|
+
if (listenerEl) {
|
|
17122
|
+
listenerEl.removeEventListener("message", handleLoad, true);
|
|
17123
|
+
listenerEl.removeEventListener("load", handleLoad, true);
|
|
17124
|
+
listenerEl.removeEventListener("crash", handleCrash, true);
|
|
17125
|
+
listenerEl.remove();
|
|
17126
|
+
}
|
|
17127
|
+
naclModuleEl.remove();
|
|
17128
|
+
}
|
|
17120
17129
|
}
|
|
17121
17130
|
});
|
|
17122
17131
|
|
|
@@ -17249,13 +17258,26 @@ var require_naclDecoder = __commonJS({
|
|
|
17249
17258
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17250
17259
|
exports.NaClDecoder = void 0;
|
|
17251
17260
|
var messages_1 = require_messages();
|
|
17252
|
-
var
|
|
17261
|
+
var module_1 = require_module();
|
|
17262
|
+
var NaClDecoder = (
|
|
17253
17263
|
/** @class */
|
|
17254
17264
|
function() {
|
|
17255
|
-
function
|
|
17265
|
+
function NaClDecoder2(messageSender, naclModuleEl) {
|
|
17256
17266
|
this.messageSender = messageSender;
|
|
17267
|
+
this.naclModuleEl = naclModuleEl;
|
|
17257
17268
|
}
|
|
17258
|
-
|
|
17269
|
+
NaClDecoder2.prototype.destroy = function() {
|
|
17270
|
+
return __awaiter(this, void 0, void 0, function() {
|
|
17271
|
+
return __generator(this, function(_a) {
|
|
17272
|
+
(0, module_1.removeNaClModule)(this.naclModuleEl);
|
|
17273
|
+
return [
|
|
17274
|
+
2
|
|
17275
|
+
/*return*/
|
|
17276
|
+
];
|
|
17277
|
+
});
|
|
17278
|
+
});
|
|
17279
|
+
};
|
|
17280
|
+
NaClDecoder2.prototype.initialize = function(args) {
|
|
17259
17281
|
return __awaiter(this, void 0, void 0, function() {
|
|
17260
17282
|
var width, height, message, resultMessage, resultStatus;
|
|
17261
17283
|
var _a, _b;
|
|
@@ -17269,10 +17291,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17269
17291
|
payload: new Uint8Array(__spreadArray(__spreadArray([
|
|
17270
17292
|
args.profile,
|
|
17271
17293
|
args.acceleration
|
|
17272
|
-
], __read(new Uint8Array(new Uint32Array([args.minPictureCount]).buffer)), false), __read(new Uint8Array(new Int32Array([
|
|
17273
|
-
width,
|
|
17274
|
-
height
|
|
17275
|
-
]).buffer)), false)).buffer
|
|
17294
|
+
], __read(new Uint8Array(new Uint32Array([args.minPictureCount]).buffer)), false), __read(new Uint8Array(new Int32Array([width, height]).buffer)), false)).buffer
|
|
17276
17295
|
};
|
|
17277
17296
|
return [4, this.messageSender.sendWithResult(message, messages_1.NaClToJSMessageType.InitializeResult)];
|
|
17278
17297
|
case 1:
|
|
@@ -17283,7 +17302,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17283
17302
|
});
|
|
17284
17303
|
});
|
|
17285
17304
|
};
|
|
17286
|
-
|
|
17305
|
+
NaClDecoder2.prototype.decodeAndRender = function(data) {
|
|
17287
17306
|
return __awaiter(this, void 0, void 0, function() {
|
|
17288
17307
|
var message, resultMessage, resultStatus;
|
|
17289
17308
|
return __generator(this, function(_a) {
|
|
@@ -17305,7 +17324,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17305
17324
|
});
|
|
17306
17325
|
});
|
|
17307
17326
|
};
|
|
17308
|
-
|
|
17327
|
+
NaClDecoder2.prototype.decode = function(args) {
|
|
17309
17328
|
return __awaiter(this, void 0, void 0, function() {
|
|
17310
17329
|
var message, resultMessage, resultStatus;
|
|
17311
17330
|
return __generator(this, function(_a) {
|
|
@@ -17328,7 +17347,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17328
17347
|
});
|
|
17329
17348
|
});
|
|
17330
17349
|
};
|
|
17331
|
-
|
|
17350
|
+
NaClDecoder2.prototype.getPicture = function() {
|
|
17332
17351
|
return __awaiter(this, void 0, void 0, function() {
|
|
17333
17352
|
var message, resultMessage, resultFirstUInt32Array, resultSecondInt32Array, picture;
|
|
17334
17353
|
return __generator(this, function(_a) {
|
|
@@ -17362,7 +17381,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17362
17381
|
});
|
|
17363
17382
|
});
|
|
17364
17383
|
};
|
|
17365
|
-
|
|
17384
|
+
NaClDecoder2.prototype.recyclePicture = function(picture) {
|
|
17366
17385
|
var firstUint32Array = new Uint32Array([
|
|
17367
17386
|
picture.decodeId,
|
|
17368
17387
|
picture.textureId,
|
|
@@ -17382,7 +17401,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17382
17401
|
};
|
|
17383
17402
|
this.messageSender.sendWithoutResult(message);
|
|
17384
17403
|
};
|
|
17385
|
-
|
|
17404
|
+
NaClDecoder2.prototype.flush = function() {
|
|
17386
17405
|
return __awaiter(this, void 0, void 0, function() {
|
|
17387
17406
|
var message, resultMessage, resultStatus;
|
|
17388
17407
|
return __generator(this, function(_a) {
|
|
@@ -17400,7 +17419,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17400
17419
|
});
|
|
17401
17420
|
});
|
|
17402
17421
|
};
|
|
17403
|
-
|
|
17422
|
+
NaClDecoder2.prototype.reset = function() {
|
|
17404
17423
|
return __awaiter(this, void 0, void 0, function() {
|
|
17405
17424
|
var message, resultMessage, resultStatus;
|
|
17406
17425
|
return __generator(this, function(_a) {
|
|
@@ -17418,7 +17437,7 @@ var require_naclDecoder = __commonJS({
|
|
|
17418
17437
|
});
|
|
17419
17438
|
});
|
|
17420
17439
|
};
|
|
17421
|
-
|
|
17440
|
+
NaClDecoder2.prototype.render = function(picture) {
|
|
17422
17441
|
return __awaiter(this, void 0, void 0, function() {
|
|
17423
17442
|
var firstUint32Array, secondInt32Array, message, resultMessage, resultStatus;
|
|
17424
17443
|
return __generator(this, function(_a) {
|
|
@@ -17450,10 +17469,10 @@ var require_naclDecoder = __commonJS({
|
|
|
17450
17469
|
});
|
|
17451
17470
|
});
|
|
17452
17471
|
};
|
|
17453
|
-
return
|
|
17472
|
+
return NaClDecoder2;
|
|
17454
17473
|
}()
|
|
17455
17474
|
);
|
|
17456
|
-
exports.NaClDecoder =
|
|
17475
|
+
exports.NaClDecoder = NaClDecoder;
|
|
17457
17476
|
}
|
|
17458
17477
|
});
|
|
17459
17478
|
|
|
@@ -17517,6 +17536,17 @@ var require_videoDecoder = __commonJS({
|
|
|
17517
17536
|
var require_dist = __commonJS({
|
|
17518
17537
|
"node_modules/@signageos/nacl-decoder/dist/index.js"(exports) {
|
|
17519
17538
|
"use strict";
|
|
17539
|
+
var __assign = exports && exports.__assign || function() {
|
|
17540
|
+
__assign = Object.assign || function(t) {
|
|
17541
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17542
|
+
s = arguments[i];
|
|
17543
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
17544
|
+
t[p] = s[p];
|
|
17545
|
+
}
|
|
17546
|
+
return t;
|
|
17547
|
+
};
|
|
17548
|
+
return __assign.apply(this, arguments);
|
|
17549
|
+
};
|
|
17520
17550
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17521
17551
|
exports.VideoProfile = exports.ResultStatus = exports.HWAcceleration = exports.NaClDecoder = void 0;
|
|
17522
17552
|
exports.isNaClSupported = isNaClSupported2;
|
|
@@ -17539,21 +17569,25 @@ var require_dist = __commonJS({
|
|
|
17539
17569
|
Object.defineProperty(exports, "VideoProfile", { enumerable: true, get: function() {
|
|
17540
17570
|
return videoDecoder_1.VideoProfile;
|
|
17541
17571
|
} });
|
|
17572
|
+
var DEFAULT_OPTIONS = {
|
|
17573
|
+
timeoutMs: 1e3
|
|
17574
|
+
};
|
|
17542
17575
|
function isNaClSupported2() {
|
|
17543
17576
|
return (
|
|
17544
17577
|
// Keyed by mime type supported in older versions of Chrome that uses NaCl.
|
|
17545
17578
|
navigator.mimeTypes["application/x-nacl"] !== void 0
|
|
17546
17579
|
);
|
|
17547
17580
|
}
|
|
17548
|
-
function createNaClDecoder2() {
|
|
17581
|
+
function createNaClDecoder2(options) {
|
|
17582
|
+
var requiredOptions = __assign(__assign({}, DEFAULT_OPTIONS), options);
|
|
17549
17583
|
if (!isNaClSupported2()) {
|
|
17550
17584
|
throw new Error("NaCl is not supported in this browser.");
|
|
17551
17585
|
}
|
|
17552
17586
|
var messageListeners = (0, messageListeners_1.createMessageListeners)();
|
|
17553
17587
|
var messageReceiver = new messageReceiver_1.MessageReceiver(messageListeners);
|
|
17554
17588
|
var naclModuleEl = (0, module_1.createNaClModule)(messageReceiver.handleMessage.bind(messageReceiver));
|
|
17555
|
-
var messageSender = new messageSender_1.MessageSender(naclModuleEl, messageListeners);
|
|
17556
|
-
return new naclDecoder_1.NaClDecoder(messageSender);
|
|
17589
|
+
var messageSender = new messageSender_1.MessageSender(naclModuleEl, messageListeners, requiredOptions.timeoutMs);
|
|
17590
|
+
return new naclDecoder_1.NaClDecoder(messageSender, naclModuleEl);
|
|
17557
17591
|
}
|
|
17558
17592
|
}
|
|
17559
17593
|
});
|
|
@@ -18047,7 +18081,7 @@ async function initGoEnvironment() {
|
|
|
18047
18081
|
}
|
|
18048
18082
|
|
|
18049
18083
|
// daemon/plain.ts
|
|
18050
|
-
var DAEMON_JS_URL = "supra-client-daemon.js?v=0.0.0-mznacl.
|
|
18084
|
+
var DAEMON_JS_URL = "supra-client-daemon.js?v=0.0.0-mznacl.302";
|
|
18051
18085
|
async function startPlainDaemon() {
|
|
18052
18086
|
const fs = await initBrowserFS();
|
|
18053
18087
|
window.fs = fs;
|
|
@@ -18058,7 +18092,7 @@ async function startPlainDaemon() {
|
|
|
18058
18092
|
}
|
|
18059
18093
|
|
|
18060
18094
|
// daemon/wasm.ts
|
|
18061
|
-
var DAEMON_WASM_URL = "supra-client-daemon.wasm?v=0.0.0-mznacl.
|
|
18095
|
+
var DAEMON_WASM_URL = "supra-client-daemon.wasm?v=0.0.0-mznacl.302";
|
|
18062
18096
|
async function startWasmDaemon() {
|
|
18063
18097
|
await initGoEnvironment();
|
|
18064
18098
|
await startGoDaemon();
|
|
@@ -18080,7 +18114,7 @@ function getGoArgv() {
|
|
|
18080
18114
|
var import_nacl_decoder = __toESM(require_dist());
|
|
18081
18115
|
function initNaCLDecoder() {
|
|
18082
18116
|
if ((0, import_nacl_decoder.isNaClSupported)()) {
|
|
18083
|
-
window.
|
|
18117
|
+
window.createNaClDecoder = import_nacl_decoder.createNaClDecoder;
|
|
18084
18118
|
}
|
|
18085
18119
|
}
|
|
18086
18120
|
|
|
@@ -18127,7 +18161,7 @@ function getGoArgv2(binFile, options) {
|
|
|
18127
18161
|
}
|
|
18128
18162
|
|
|
18129
18163
|
// screen/plain.ts
|
|
18130
|
-
var SCREEN_JS_URL = "supra-client-screen.js?v=0.0.0-mznacl.
|
|
18164
|
+
var SCREEN_JS_URL = "supra-client-screen.js?v=0.0.0-mznacl.302";
|
|
18131
18165
|
async function startPlainScreen(options) {
|
|
18132
18166
|
options = options != null ? options : parseQueryOptions();
|
|
18133
18167
|
initNaCLDecoder();
|
|
@@ -18153,7 +18187,7 @@ async function createH264Decoder() {
|
|
|
18153
18187
|
}
|
|
18154
18188
|
|
|
18155
18189
|
// screen/wasm.ts
|
|
18156
|
-
var SCREEN_WASM_URL = "supra-client-screen.wasm?v=0.0.0-mznacl.
|
|
18190
|
+
var SCREEN_WASM_URL = "supra-client-screen.wasm?v=0.0.0-mznacl.302";
|
|
18157
18191
|
async function startWasmScreen(options) {
|
|
18158
18192
|
options = options != null ? options : parseQueryOptions();
|
|
18159
18193
|
await initH264Decoder();
|